head: Fix user defining canonical URL resulting in multiple canonical URLs (#133)

* Revert "head: add support for Canonical URLs"

This reverts commit 8af7c551ff.

* Allow user to specify single canonical URL
This commit is contained in:
Cody Brownstein 2020-12-15 09:29:04 -08:00 committed by GitHub
parent 77ff1e6b45
commit 2abc278c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,11 +16,7 @@
{{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }} {{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }}
{{- 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="{{ if .Params.canonicalURL -}} {{ .Params.canonicalURL }} {{- else -}} {{ .Permalink }} {{- end }}" />
{{- $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}}