diff options
| author | Cody Brownstein <25962175+cbrownstein@users.noreply.github.com> | 2020-12-15 09:29:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-15 22:59:04 +0530 |
| commit | 2abc278c69e21eb5fddae7d330eb83a5428db700 (patch) | |
| tree | 2763009ea74636284665b517288a518816cc8df7 | |
| parent | 77ff1e6b452ad64eeee5178667827323d0a1644d (diff) | |
head: Fix user defining canonical URL resulting in multiple canonical URLs (#133)
* Revert "head: add support for Canonical URLs"
This reverts commit 8af7c551ffb45e31d545373f88c78b38f660cf8d.
* Allow user to specify single canonical URL
| -rw-r--r-- | layouts/partials/head.html | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0583700..c759d58 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,11 +16,7 @@ {{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }} {{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> <meta name="author" content="{{ (partial "author.html" . ) }}"> -<link rel="canonical" href="{{ .Permalink }}" /> -{{- $canonical := cond (.IsHome) .Site.Params.canonical .Params.canonical }} -{{- range $canonical }} -<link rel="canonical" href="{{ trim . " " }}" /> -{{- end }} +<link rel="canonical" href="{{ if .Params.canonicalURL -}} {{ .Params.canonicalURL }} {{- else -}} {{ .Permalink }} {{- end }}" /> {{- if .Site.Params.analytics.google.SiteVerificationTag }} <meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" /> {{- end}} |
