diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fd2c0ab..8e7c9241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fix an unclosed `

` tag in `page__hero.html`, near `page.header.actions`. - Remove overlay and revert X to hamburger icon when popup disappears. [#3958](https://github.com/mmistakes/minimal-mistakes/pull/3958) +- Fix SEO title when it contains a vertical bar. [#3094](https://github.com/mmistakes/minimal-mistakes/pull/3094) [#3113](https://github.com/mmistakes/minimal-mistakes/pull/3113) ### Enhancements @@ -18,6 +19,7 @@ - Add popup parameter to `{% include figure %}` to enable Magnific Popup. [#3119](https://github.com/mmistakes/minimal-mistakes/pull/3119) - Add target attribute for navigation link. [#3056](https://github.com/mmistakes/minimal-mistakes/pull/3056) - Split schema to a separate include file. [#3085](https://github.com/mmistakes/minimal-mistakes/pull/3085) +- Cleanup `_includes/seo.html`. ### Documentation & Maintenance diff --git a/_includes/seo.html b/_includes/seo.html index be147858..8c2f6f72 100644 --- a/_includes/seo.html +++ b/_includes/seo.html @@ -1,10 +1,5 @@ -{%- if site.url -%} - {%- assign seo_url = site.url | append: site.baseurl -%} -{%- endif -%} -{%- assign seo_url = seo_url | default: site.github.url -%} - -{% assign title_separator = site.title_separator | default: '-' %} +{%- 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: '|', '|' -%} @@ -12,11 +7,7 @@ {%- assign page_title = page_title | markdownify | strip_html | strip_newlines | escape_once -%} {%- assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once -%} -{% if page.canonical_url %} - {%- assign canonical_url = page.canonical_url %} -{% else %} - {%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %} -{% endif %} +{%- assign canonical_url = page.canonical_url | default: page.url | replace: "/index.html", "/" | absolute_url %} {%- assign seo_description = page.description | default: page.excerpt | default: site.description -%} {%- if seo_description -%} @@ -30,14 +21,9 @@ {%- assign author_twitter = author.twitter | replace: "@", "" -%} {%- endif -%} -{%- assign page_large_image = page.header.og_image | default: page.header.overlay_image | default: page.header.image | absolute_url -%} -{%- assign page_large_image = page_large_image | escape -%} - -{%- assign page_teaser_image = page.header.teaser | default: site.og_image | absolute_url -%} -{%- assign page_teaser_image = page_teaser_image | escape -%} - -{%- assign site_og_image = site.og_image | absolute_url -%} -{%- assign site_og_image = site_og_image | escape -%} +{%- assign page_large_image = page.header.og_image | default: page.header.overlay_image | default: page.header.image | absolute_url | escape -%} +{%- assign page_teaser_image = page.header.teaser | default: site.og_image | absolute_url | escape -%} +{%- assign site_og_image = site.og_image | absolute_url | escape -%} {%- if page.date -%} {%- assign og_type = "article" -%} diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 6431cf5d..8dbfa9de 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -5,7 +5,7 @@ permalink: "/docs/history/" excerpt: Change log of enhancements and bug fixes made to the theme. sidebar: nav: docs -last_modified_at: '2024-05-05T17:36:29+08:00' +last_modified_at: '2024-05-05T18:13:22+08:00' toc: false --- @@ -21,6 +21,7 @@ toc: false - Fix an unclosed `

` tag in `page__hero.html`, near `page.header.actions`. - Remove overlay and revert X to hamburger icon when popup disappears. [#3958](https://github.com/mmistakes/minimal-mistakes/pull/3958) +- Fix SEO title when it contains a vertical bar. [#3094](https://github.com/mmistakes/minimal-mistakes/pull/3094) [#3113](https://github.com/mmistakes/minimal-mistakes/pull/3113) ### Enhancements @@ -33,6 +34,7 @@ toc: false - Add popup parameter to `{% include figure %}` to enable Magnific Popup. [#3119](https://github.com/mmistakes/minimal-mistakes/pull/3119) - Add target attribute for navigation link. [#3056](https://github.com/mmistakes/minimal-mistakes/pull/3056) - Split schema to a separate include file. [#3085](https://github.com/mmistakes/minimal-mistakes/pull/3085) +- Cleanup `_includes/seo.html`. ### Documentation & Maintenance