feat: add option to set a custom canonical url (#1267)

* add option to set a custom canonical url

* style: use `with` to load cannonicalurl

* style: change to canonicalUrl

Frontmatter is case-insensitive so it does not matter

---------

Co-authored-by: FarisZR <35614734+FarisZR@users.noreply.github.com>
This commit is contained in:
Jimmy
2026-02-17 20:01:23 +01:00
committed by GitHub
co-authored by FarisZR
parent 475c956fd6
commit d6448148cf
+5 -1
View File
@@ -8,7 +8,11 @@
{{- $title := partial "data/title" . -}} {{- $title := partial "data/title" . -}}
<title>{{ $title }}</title> <title>{{ $title }}</title>
<link rel='canonical' href='{{ .Permalink }}'> {{ with .Params.canonicalUrl }}
<link rel="canonical" href="{{ . }}">
{{ else }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}
{{- partial "head/custom-font.html" . -}} {{- partial "head/custom-font.html" . -}}
{{- partial "head/style.html" . -}} {{- partial "head/style.html" . -}}