diff --git a/resources/fieldsets/globals_seo_social_defaults.yaml b/resources/fieldsets/globals_seo_social_defaults.yaml index d5715ed..c8be16e 100644 --- a/resources/fieldsets/globals_seo_social_defaults.yaml +++ b/resources/fieldsets/globals_seo_social_defaults.yaml @@ -11,27 +11,3 @@ fields: instructions_position: below instructions: 'The default OG image. Can be overridden per entry. The recommended size is 1200px x 630px. This image will be focal cropped to this dimension.' width: 50 - - - handle: twitter_image - field: common.image - config: - container: social_images - localizable: true - listable: hidden - display: 'Twitter image' - instructions_position: below - instructions: 'The default Twitter image. Can be overridden per entry. Images should have an aspect ratio of 2:1 with minimum dimensions of 300x157. This image will be focal cropped to this dimension.' - width: 50 - - - handle: twitter_handle - field: - listable: hidden - display: 'Twitter handle' - width: 50 - input_type: text - type: text - localizable: true - instructions: 'The Twitter user name that should be included with Twitter Card tags.' - instructions_position: below - prepend: '@' - antlers: false diff --git a/resources/fieldsets/seo_open_graph.yaml b/resources/fieldsets/seo_open_graph.yaml index c2f6f66..914910e 100644 --- a/resources/fieldsets/seo_open_graph.yaml +++ b/resources/fieldsets/seo_open_graph.yaml @@ -28,14 +28,3 @@ fields: instructions: "This entry's OG image. Defaults to global site OG image. The recommended size is 1200px x 630px. The image will be focal cropped to this dimension." instructions_position: below width: 50 - - - handle: twitter_image - field: common.image - config: - mode: grid - container: social_images - listable: hidden - display: 'Twitter image' - instructions: "This entry's Twitter image. Defaults to global site Twitter image. Images should have an aspect ratio of 2:1 with minimum dimensions of 300x157. This image will be focal cropped to this dimension." - instructions_position: below - width: 50 diff --git a/resources/views/snippets/_fallback_description.antlers.html b/resources/views/snippets/_fallback_description.antlers.html index 4954033..598868a 100644 --- a/resources/views/snippets/_fallback_description.antlers.html +++ b/resources/views/snippets/_fallback_description.antlers.html @@ -1,6 +1,6 @@ {{# @name Fallback description - @desc Get the fallback description for meta, og and twitter. + @desc Get the fallback description for meta and og. #}} {{ seo:collection_defaults | where('collection', {collection}) }} diff --git a/resources/views/snippets/_seo.antlers.html b/resources/views/snippets/_seo.antlers.html index 0e32b5a..67b6c0c 100644 --- a/resources/views/snippets/_seo.antlers.html +++ b/resources/views/snippets/_seo.antlers.html @@ -142,39 +142,6 @@ {{ /if }} -{{# Twitter #}} -{{ if twitter_image or seo:twitter_image }} - - - {{ if og_title }} - - {{ else }} - - {{ /if }} - {{ if og_description }} - - {{ elseif seo_description }} - - {{ elseif seo:collection_defaults }} - - {{ /if }} - {{ if twitter_image }} - - {{ asset :url="twitter_image" }} - {{ if alt }} - - {{ /if }} - {{ /asset }} - {{ elseif seo:twitter_image }} - - {{ asset :url="seo:twitter_image" }} - {{ if alt }} - - {{ /if }} - {{ /asset }} - {{ /if }} -{{ /if }} - {{# Trackers #}} {{ if (environment == 'local' && seo:trackers_local) or diff --git a/resources/views/social_images.antlers.html b/resources/views/social_images.antlers.html index 3f1aefa..746b540 100644 --- a/resources/views/social_images.antlers.html +++ b/resources/views/social_images.antlers.html @@ -1,6 +1,6 @@ {{# @name Social Images - @desc The template for generating Social Images. By default two sizes, one for the regular OG protocol and one for Twitter. + @desc The template for generating Social Images. By default it includes the size for the OG protocol. #}} @@ -24,11 +24,7 @@

OG

- {{# The Twitter template. #}} -
-

Twitter

- {{ partial:statamic-peak-seo::components/social_image selector="twitter" style="width: 1200px; height: 600px" }} -
+ {{# Repeat for future OG sizes. RIP Twitter. #}} diff --git a/src/Jobs/GenerateSocialImagesJob.php b/src/Jobs/GenerateSocialImagesJob.php index f6eee17..790c3ca 100644 --- a/src/Jobs/GenerateSocialImagesJob.php +++ b/src/Jobs/GenerateSocialImagesJob.php @@ -52,7 +52,6 @@ public function handle() // Delete any old images/meta remaining. collect([ $this->item->get('og_image'), - $this->item->get('twitter_image'), ]) ->filter() ->unique() @@ -68,7 +67,6 @@ public function handle() // Generate, save and set default og image/meta. $file = "{$title}-og-{$unique}.png"; - $image = $this->setupBrowsershot() ->windowSize(1200, 630) ->select('#og') @@ -81,19 +79,7 @@ public function handle() $container->makeAsset($file)->save(); $this->item->set('og_image', $file)->save(); - // Generate, save and set default twitter image/meta. - $file = "{$title}-twitter-{$unique}.png"; - $image = $this->setupBrowsershot() - ->windowSize(1200, 600) - ->select('#twitter') - ->waitUntilNetworkIdle(); - if (strtolower(config("filesystems.disks.{$container->disk}.driver") == 's3')) { - $disk->put($file, $image->screenshot()); - } else { - $image->save($disk->path($file)); - } - $container->makeAsset($file)->save(); - $this->item->set('twitter_image', $file)->save(); + // Repeat for other sizes. Artisan::call('cache:clear'); }