add option to set a custom canonical url

This commit is contained in:
FarisZR 2023-05-01 03:09:37 +02:00 committed by GitHub
parent aae9cf67db
commit bf874c32d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,11 @@
{{- $title := partialCached "data/title" . .RelPermalink -}} {{- $title := partialCached "data/title" . .RelPermalink -}}
<title>{{ $title }}</title> <title>{{ $title }}</title>
<link rel='canonical' href='{{ .Permalink }}'> {{ if .Params.canonicalurl }}
<link rel="canonical" href="{{ .Params.canonicalurl }}">
{{ else }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}
{{- partial "head/style.html" . -}} {{- partial "head/style.html" . -}}
{{- partial "head/script.html" . -}} {{- partial "head/script.html" . -}}