{{# @name SEO @desc The SEO partial rendered in the of a page. #}} {{# Page title #}} {{ if seo_title }} {{ seo_title }} {{ else }} {{ yield:seo_title }} {{ title }} {{ seo:title_separator ? seo:title_separator : " | " }} {{ seo:change_page_title | where('collection', {collection}) }} {{ if what_to_add == 'collection_title' }} {{ collection:title }} {{ elseif what_to_add == 'custom_text' }} {{ custom_text }} {{ /if }} {{ seo:title_separator ? seo:title_separator : " | " }} {{ /seo:change_page_title }} {{ seo:site_name ? seo:site_name : config:app:name }} {{ /if }} {{# Page description #}} {{ if seo_description }} {{ elseif seo:collection_defaults }} {{ /if }} {{# No index and no follow #}} {{ if (environment == 'local' && !seo:noindex_local) or (environment == 'staging' && !seo:noindex_staging) or (environment == 'production' && !seo:noindex_production) }} {{ if seo_noindex & seo_nofollow }} {{ elseif seo_nofollow }} {{ elseif seo_noindex }} {{ /if }} {{ else }} {{ /if }} {{# Canonical URL #}} {{ if not seo_noindex }} {{ if seo_canonical_type == 'current' }} {{ elseif seo_canonical_type == 'external' }} {{ elseif seo_canonical_type == 'entry' }} {{ /if }} {{ /if }} {{# Open Graph #}} {{ yield:og_header }} {{ if og_title }} {{ elseif seo_title}} {{ else }} {{ /if }} {{ if og_description }} {{ elseif seo_description }} {{ elseif seo:collection_defaults }} {{ /if }} {{ if og_image }} {{ elseif seo:og_image }} {{ /if }} {{ /yield:og_header }} {{ yield:twitter_header }} {{# Twitter #}} {{ if seo:twitter_handle }} {{ if og_title }} {{ elseif seo_title }} {{ else }} {{ /if }} {{ if og_description }} {{ elseif seo_description }} {{ elseif seo:collection_defaults }} {{ /if }} {{ /if }} {{ if twitter_image or seo:twitter_image }} {{ 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 }} {{ /yield:twitter_header }} {{# Trackers #}} {{ if (environment == 'local' && seo.trackers_local) or (environment == 'staging' && seo.trackers_staging) or (environment == 'production' && seo.trackers_production) }} {{ if seo:tracker_type == 'gtm' }} {{ elseif seo:tracker_type == 'gtag' }} {{ /if }} {{ if seo:use_google_site_verification }} {{ /if }} {{ /if }}