From 8af7c551ffb45e31d545373f88c78b38f660cf8d Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 13 Dec 2020 16:36:30 +0530 Subject: [PATCH] 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"] --- layouts/partials/head.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 4a4d4665..408cee02 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,6 +17,10 @@ {{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> +{{- $canonical := cond (.IsHome) .Site.Params.canonical .Params.canonical }} +{{- range $canonical }} + +{{- end }} {{- if .Site.Params.analytics.google.SiteVerificationTag }} {{- end}}