From 14a6aba0b556d278f09a8271202ee3d2c5d8c791 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Wed, 27 Oct 2021 10:48:29 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Add=20groupByYear=20to=20front?= =?UTF-8?q?=20matter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + exampleSite/content/docs/front-matter.md | 1 + layouts/_default/list.html | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0e8bb3c..32fecb8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - French translation ([#18](https://github.com/jpanther/congo/pull/18)) +- Grouping by year can now be specificed in front matter on list pages ### Changed diff --git a/exampleSite/content/docs/front-matter.md b/exampleSite/content/docs/front-matter.md index b8913d2d..9634c34d 100644 --- a/exampleSite/content/docs/front-matter.md +++ b/exampleSite/content/docs/front-matter.md @@ -18,6 +18,7 @@ Front matter parameter default values are inherited from the theme's [base confi |`externalUrl`|string|_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.| |`editURL`|string|`article.editURL`|When `showEdit` is active, the URL for the edit link.| |`editAppendPath`|boolean|`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`|boolean|`list.groupByYear`|Whether or not articles are grouped by year on list pages.| |`menu`|string or array|_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`|string|_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`|array of strings|`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.| diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3d87210b..76388cc3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,7 +3,7 @@ {{ if gt .Pages 0 }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ if $.Site.Params.list.groupByYear }} + {{ if $.Params.groupByYear | default ($.Site.Params.list.groupByYear | default true) }}

{{ .Key }}