Skip to content

Commit

Permalink
Fix: Prevent double title issue in SEO metadata by updating seo.html
Browse files Browse the repository at this point in the history
  • Loading branch information
alouiadel committed Aug 20, 2024
1 parent b939edc commit 79cf297
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _includes/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
{%- assign title_separator = site.title_separator | default: '-' -%}

{%- assign page_title = page.title | default: site.title | replace: '|', '|' -%}
{%- assign seo_title = page_title | append: " " | append: title_separator | append: " " | append: 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 -%}
Expand Down

0 comments on commit 79cf297

Please sign in to comment.