📝 Update documentation for .canonicalUrl

This commit is contained in:
James Panther
2025-06-22 11:49:07 +10:00
parent e5da41b4c2
commit 228c253944
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -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
@@ -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.|
+5 -3
View File
@@ -95,9 +95,9 @@
<meta name="robots" content="{{ . }}" />
{{ end }}
{{ if .Params.canonicalUrl }}
<link rel="canonical" href="{{ .Params.canonicalUrl }}">
<link rel="canonical" href="{{ .Params.canonicalUrl }}" />
{{ else }}
<link rel="canonical" href="{{ .Permalink }}">
<link rel="canonical" href="{{ .Permalink }}" />
{{ end }}
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }}
@@ -133,7 +133,9 @@
{{/* Schema */}}
{{ partial "schema.html" . }}
{{/* Me */}}
{{ with .Site.Language.Params.Author.name }}<meta name="author" content="{{ . }}" />{{ end }}
{{ with .Site.Language.Params.Author.name }}
<meta name="author" content="{{ . }}" />
{{ end }}
{{ with .Site.Language.Params.Author.links }}
{{ range $links := . }}
{{ range $name, $url := $links }}<link href="{{ $url }}" rel="me" />{{ end }}