mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-27 07:25:53 -05:00
head: add support for Canonical URLs
cc: #104 usage => in site config.yml (used for home page only) => canonical: ["https://www.example.com" , "https://blog.example.com"] in per-page vars => canonical: ["https://www.example.com/page1" , "https://blog.example.com/pages/page1"]
This commit is contained in:
parent
b7f5dd10f1
commit
8af7c551ff
@ -17,6 +17,10 @@
|
|||||||
{{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}">
|
{{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}">
|
||||||
<meta name="author" content="{{ (partial "author.html" . ) }}">
|
<meta name="author" content="{{ (partial "author.html" . ) }}">
|
||||||
<link rel="canonical" href="{{ .Permalink }}" />
|
<link rel="canonical" href="{{ .Permalink }}" />
|
||||||
|
{{- $canonical := cond (.IsHome) .Site.Params.canonical .Params.canonical }}
|
||||||
|
{{- range $canonical }}
|
||||||
|
<link rel="canonical" href="{{ trim . " " }}" />
|
||||||
|
{{- end }}
|
||||||
{{- if .Site.Params.analytics.google.SiteVerificationTag }}
|
{{- if .Site.Params.analytics.google.SiteVerificationTag }}
|
||||||
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
|
<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" />
|
||||||
{{- end}}
|
{{- end}}
|
||||||
|
Loading…
Reference in New Issue
Block a user