Skip to content

Commit

Permalink
assign canonical directly if custom value exists (#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanKilleen authored and mmistakes committed Jan 8, 2019
1 parent 2274abb commit 77059e3
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 77059e3

Please sign in to comment.