From cb274c8ac59d866c581d0eec2617f15acc03dbc5 Mon Sep 17 00:00:00 2001 From: mafendi <76495108+mafendi@users.noreply.github.com> Date: Fri, 2 Feb 2024 00:52:41 +0200 Subject: [PATCH] feat: add canonical to head.html (#269) By adding `canonical` parameter to the front matter and specifying the URL, the canonical URL is added. If no canonical URL is needed to be specified, the layout will use the current page address for canonical tag. Example: ``` --- title: "Page Title" description: "Page description" canonical: "https://canonicalurl.com" --- --- layouts/partials/head.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 59f9cba9..c42e2dee 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,7 +16,12 @@ {{ end -}} - + + {{ with .Params.canonical }} + + {{ else }} + + {{ end }} {{ partial "opengraph.html" . }} {{ template "_internal/schema.html" . -}}