{{# @name SEO @desc The SEO partial rendered in the of your page. #}} {{# Page title #}} {{ seperator = seo:title_separator ?? " | " }} {{ site_name = seo:site_name ?? config:app:name }} {{ if seo_title }} {{ seo_title }} {{ elseif seo:change_page_title | where('collection', collection) }} {{ seo:change_page_title | where('collection', collection) }} {{ if manipulate_title == 'collection_title' }} {{ title }} {{ seperator }} {{ collection:title }} {{ seperator }} {{ site_name }} {{ elseif manipulate_title == 'custom_text' }} {{ title }} {{ seperator }} {{ custom_text }} {{ seperator }} {{ site_name }} {{ elseif manipulate_title == 'replace_title' }} {{ custom_text }} {{ /if }} {{ /seo:change_page_title }} {{ else }} {{ yield:seo_title }}{{ title }} {{ seperator }} {{ site_name }} {{ /if }} {{# Page description #}} {{ if seo_description }} {{ elseif seo:collection_defaults }} {{ /if }} {{# Resolve noindex: entry override → global default → index #}} {{ _resolved_noindex = false }} {{ if seo_noindex == 'noindex' }} {{ _resolved_noindex = true }} {{ elseif seo_noindex == 'inherit' || !seo_noindex }} {{ if collection }} {{ seo:collection_indexing_defaults | where('collection', collection) }} {{ if noindex == 'noindex' }} {{ _resolved_noindex = true }} {{ /if }} {{ /seo:collection_indexing_defaults }} {{ elseif taxonomy }} {{ seo:taxonomy_indexing_defaults | where('taxonomy', taxonomy) }} {{ if noindex == 'noindex' }} {{ _resolved_noindex = true }} {{ /if }} {{ /seo:taxonomy_indexing_defaults }} {{ /if }} {{ /if }} {{# No index, no follow and hreflang tags. #}} {{ if (environment == 'local' && !seo:noindex_local) or (environment == 'staging' && !seo:noindex_staging) or (environment == 'production' && !seo:noindex_production) }} {{ if _resolved_noindex && seo_nofollow }} {{ elseif seo_nofollow }} {{ elseif _resolved_noindex }} {{ else }} {{ /if }} {{# hreflang tags #}} {{ if seo:hreflang_auto }} {{ if not _resolved_noindex and seo_canonical_type == 'entry' and current_url === permalink }} {{ locales all="false" }} {{ if site:attributes:identifier === locale:attributes:identifier }} {{# Resolve noindex: entry override → global default → index #}} {{ _resolved_noindex_alternate = false }} {{ get_content :url="url" }} {{ if seo_noindex == 'noindex' }} {{ _resolved_noindex_alternate = true }} {{ elseif seo_noindex == 'inherit' || !seo_noindex }} {{ if collection }} {{ seo:collection_indexing_defaults | where('collection', collection) }} {{ if noindex == 'noindex' }} {{ _resolved_noindex_alternate = true }} {{ /if }} {{ /seo:collection_indexing_defaults }} {{ elseif taxonomy }} {{ seo:taxonomy_indexing_defaults | where('taxonomy', taxonomy) }} {{ if noindex == 'noindex' }} {{ _resolved_noindex_alternate = true }} {{ /if }} {{ /seo:taxonomy_indexing_defaults }} {{ /if }} {{ /if }} {{ /get_content }} {{ unless _resolved_noindex_alternate }} {{ /unless}} {{ /if }} {{ /locales }} {{ /if }} {{ /if }} {{ else }} {{ /if }} {{# Canonical URL #}} {{ if not _resolved_noindex }} {{ if seo_canonical_type == 'current' }} {{ elseif seo_canonical_type == 'external' }} {{ elseif seo_canonical_type == 'entry' }} {{ /if }} {{ /if }} {{# Auto add pagination link's when using statamic-peak-tools::components/_pagination.antlers.html. #}} {{ yield:pagination }} {{# Knowledge graph JSON-ld #}} {{ if seo:json_ld_type && seo:json_ld_type != 'none' }} {{ /if }} {{ if schema_jsonld }} {{ /if }} {{# Breadcrumbs JSON-ld #}} {{ if seo:breadcrumbs && segment_1 }} {{ /if }} {{# Open Graph #}} {{ if og_title }} {{ else }} {{ /if }} {{ if og_description }} {{ elseif seo_description }} {{ elseif seo:collection_defaults }} {{ /if }} {{ if og_image }} {{ elseif seo:og_image }} {{ /if }} {{# Trackers #}} {{ if (environment == 'local' && seo:trackers_local) or (environment == 'staging' && seo:trackers_staging) or (environment == 'production' && seo:trackers_production) }} {{ if seo:tracker_type == 'gtm' || seo:tracker_type == 'gtag' || seo:tracker_type == 'sgtm' }} {{ /if }} {{ if seo:use_consent_banner && (seo:tracker_type == 'gtm' || seo:tracker_type == 'gtag' || seo:tracker_type == 'sgtm') }} {{ /if }} {{ if seo:tracker_type == 'gtm' }} {{ elseif seo:tracker_type == 'gtag' }} {{ elseif seo:tracker_type == 'sgtm' }} {{ elseif seo:tracker_type == 'scripts' && !seo:use_consent_banner }} {{ seo:scripts }} {{ script_fragments }} {{ if type == 'script_tag' }} {{ else }} ') }} {{ /if }} {{ /script_fragments }} {{ /seo:scripts }} {{ /if }} {{# Render this stack in all your layouts after opening the . #}} {{ push:seo_body }} {{ if seo:use_consent_banner }} {{ partial:statamic-peak-seo::components/consent_banner }} {{ /if }} {{ /push:seo_body }} {{ if seo:use_google_site_verification }} {{ /if }} {{ if seo:use_fathom }} {{ /if }} {{ if seo:use_matomo }} {{ /if }} {{ if seo:use_plausible && seo:plausible }} {{ /if }} {{ if seo:use_umami && seo:umami_website_id && seo:umami_script_url }} {{ /if }} {{ if seo:use_cloudflare_web_analytics }} {{ /if }} {{ /if }}