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:
David G. Simmons 2024-10-15 13:59:30 -04:00
parent 0d4d8a8e3c
commit 739499b106
No known key found for this signature in database
GPG key ID: 3E0F418F1D0ABB96
2 changed files with 4 additions and 1 deletions

View file

@ -8,7 +8,9 @@
{{ template "_internal/twitter_cards.html" . }}
<!------ ADD PAGE SPECIFIC HEADERS ------->
{{ block "header" . }} {{ end }}
{{ with .Params.relcanonical }}
{{ partial "misc/canonical.html" . }}
{{ end }}
<!--================= add analytics if enabled =========================-->
{{- partial "analytics.html" . -}}
<script>

View file

@ -0,0 +1 @@
<link rel="canonical" href="{{ . | relLangURL }}" itemprop="url" />