Skip to content

Commit

Permalink
assign canonical directly if custom value exists (mmistakes#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanKilleen authored and chukycheese committed Sep 18, 2023
1 parent d384248 commit 6f607a3
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 @@ -14,7 +14,11 @@
{%- assign seo_title = seo_title | markdownify | strip_html | strip_newlines | escape_once -%}
{%- endif -%}

{%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %}
{% if page.canonical_url %}
{%- assign canonical_url = page.canonical_url %}
{% else %}
{%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %}
{% endif %}

{%- assign seo_description = page.description | default: page.excerpt | default: site.description -%}
{%- if seo_description -%}
Expand Down

0 comments on commit 6f607a3

Please sign in to comment.