Add `keywords` front matter support

pull/436/head
James Panther 2023-01-10 16:33:33 +11:00
parent 5fbe11611b
commit 3fcd6211a8
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
3 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- Front matter keywords support on a per article basis
- Indonesian translation ([#398](https://github.com/jpanther/congo/pull/398))
- Mastodon sharing links ([#405](https://github.com/jpanther/congo/pull/405))
- `homepage.recentLimit` parameter to adjust the maximum number of recent items listed on the homepage ([#411](https://github.com/jpanther/congo/pull/411))

View File

@ -20,6 +20,7 @@ Front matter parameter default values are inherited from the theme's [base confi
|`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.|
|`keywords`|_Not set_|Any keywords that should be included in the article metadata.|
|`menu`|_Not set_|When a value is provided, a link to this article will appear in the named menus. Valid values are `main` or `footer`.|
|`robots`|_Not set_|String that indicates how robots should handle this article. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.|
|`sharingLinks`|`article.sharingLinks`|Which sharing links to display at the end of this article. When not provided, or set to `false` no links will be displayed.|

View File

@ -16,8 +16,8 @@
{{- end }}
{{/* Metadata */}}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
{{ with .Site.Params.keywords -}}
<meta name="keywords" content="{{ . }}" />
{{ with union .Site.Params.keywords .Params.keywords -}}
<meta name="keywords" content="{{ delimit . `, `}}" />
{{- end }}
{{ with .Site.Params.robots }}
<meta name="robots" content="{{ . }}" />