Add support for canonical links
Add a `relcanonical: <URL>` item to the frontmatter and this will then make sure that the `<link rel="canonical" >` value is set properly.
This commit is contained in:
parent
0d4d8a8e3c
commit
739499b106
2 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,9 @@
|
||||||
{{ template "_internal/twitter_cards.html" . }}
|
{{ template "_internal/twitter_cards.html" . }}
|
||||||
<!------ ADD PAGE SPECIFIC HEADERS ------->
|
<!------ ADD PAGE SPECIFIC HEADERS ------->
|
||||||
{{ block "header" . }} {{ end }}
|
{{ block "header" . }} {{ end }}
|
||||||
|
{{ with .Params.relcanonical }}
|
||||||
|
{{ partial "misc/canonical.html" . }}
|
||||||
|
{{ end }}
|
||||||
<!--================= add analytics if enabled =========================-->
|
<!--================= add analytics if enabled =========================-->
|
||||||
{{- partial "analytics.html" . -}}
|
{{- partial "analytics.html" . -}}
|
||||||
<script>
|
<script>
|
||||||
|
|
1
layouts/partials/misc/canoncial.html
Normal file
1
layouts/partials/misc/canoncial.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<link rel="canonical" href="{{ . | relLangURL }}" itemprop="url" />
|
Loading…
Add table
Add a link
Reference in a new issue