From bc07e401ad04c01e568787695f648cf20fab8e06 Mon Sep 17 00:00:00 2001
From: HactarCE <6060305+HactarCE@users.noreply.github.com>
Date: Wed, 2 Apr 2025 11:25:03 -0400
Subject: [PATCH] :sparkles: Add `canonicalUrl` parameter
---
CHANGELOG.md | 4 ++++
layouts/partials/head.html | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 765495e..419b466 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
+### Added
+
+- `canonicalUrl` parameter for page front matter
+
### Fixed
- Shortcodes placed after code blocks with line numbers are rendered with incorrect spacing ([#987](https://github.com/jpanther/congo/issues/987))
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index efb9c83..8407e31 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -94,7 +94,11 @@
{{ with .Params.robots }}
{{ end }}
-
+ {{ if .Params.canonicalUrl }}
+
+ {{ else }}
+
+ {{ end }}
{{ range .AlternativeOutputFormats -}}
{{ printf `` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }}
{{ end -}}