Fix: Prevent double title issue in SEO metadata by updating seo.html (#4959)

This commit is contained in:
Adel Aloui 2024-08-20 09:55:30 +01:00 committed by GitHub
parent b939edc600
commit 96149caa54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,11 @@
{%- assign title_separator = site.title_separator | default: '-' -%}
{%- assign page_title = page.title | default: site.title | replace: '|', '|' -%}
{%- if page_title contains site.title -%}
{%- assign seo_title = page_title | replace: '|', '|' -%}
{%- else -%}
{%- assign seo_title = page_title | append: " " | append: title_separator | append: " " | append: site.title | replace: '|', '|' -%}
{%- endif -%}
{%- assign page_title = page_title | markdownify | strip_html | strip_newlines | escape_once -%}
{%- assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once -%}