From 228c253944ccd3cfb0cf3e39c39916444f27d17b Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Sun, 22 Jun 2025 11:49:07 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20documentation=20for=20`?= =?UTF-8?q?.canonicalUrl`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- exampleSite/content/docs/front-matter/index.md | 1 + layouts/partials/head.html | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee93ce8..6b52330 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added -- `canonicalUrl` parameter for article front matter ([#1046](https://github.com/jpanther/congo/pull/1046)) +- New `canonicalUrl` parameter support in article front matter ([#1046](https://github.com/jpanther/congo/pull/1046)) ### Changed diff --git a/exampleSite/content/docs/front-matter/index.md b/exampleSite/content/docs/front-matter/index.md index 4932051..d06865f 100644 --- a/exampleSite/content/docs/front-matter/index.md +++ b/exampleSite/content/docs/front-matter/index.md @@ -25,6 +25,7 @@ Front matter parameter default values are inherited from the theme's [base confi |`thumbnail`|`"*thumb*"`_|The text pattern to match the thumbnail image filename for this article.| |`thumbnailAlt`|`featureAlt`|The alternative text description for the thumbnail image.| |`externalUrl`|_Not set_|If this article is published on a third-party website, the URL to this article. Providing a URL will prevent a content page being generated and any references to this article will link directly to the third-party website.| +|`canonicalUrl`|`.Permalink`|When set, this overrides the canonical URL metadata for the article.| |`editURL`|`article.editURL`|When `showEdit` is active, the URL for the edit link.| |`editAppendPath`|`article.editAppendPath`|When `showEdit` is active, whether or not the path to the current article should be appended to the URL set at `editURL`.| |`groupByYear`|`list.groupByYear`|Whether or not articles are grouped by year on list pages.| diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8407e31..b8f8385 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -95,9 +95,9 @@ {{ end }} {{ if .Params.canonicalUrl }} - + {{ else }} - + {{ end }} {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }} @@ -133,7 +133,9 @@ {{/* Schema */}} {{ partial "schema.html" . }} {{/* Me */}} - {{ with .Site.Language.Params.Author.name }}{{ end }} + {{ with .Site.Language.Params.Author.name }} + + {{ end }} {{ with .Site.Language.Params.Author.links }} {{ range $links := . }} {{ range $name, $url := $links }}{{ end }}