diff --git a/README.md b/README.md index 54164053..b5e19f25 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,7 @@ Many of the article defaults here can be overridden on a per article basis by sp |`article.showHeadingAnchors`|boolean|`true`|Whether or not heading anchor links are displayed alongside headings within articles.| |`article.showPagination`|boolean|`true`|Whether or not the next/previous article links are displayed in the article footer.| |`article.showReadingTime`|boolean|`true`|Whether or not article reading times are displayed.| +|`list.groupByYear`|boolean|`true`|Whether or not articles are grouped under years in the article listing.| |`sitemap.excludedKinds`|array of strings|`["taxonomy", "term"]`|Kinds of content that should be excluded from the generated `/sitemap.xml` file. Refer to the [Hugo docs](https://gohugo.io/templates/section-templates/#page-kinds) for acceptable values.| |`taxonomy.showTermCount`|boolean|`true`|Whether or not the number of articles within a taxonomy term is displayed on the taxonomy listing.| |`fathomAnalytics.site`|string|_Not set_|The site code generated by Fathom Analytics for the website. Refer to the [Analytics docs](#analyticshtml) below for more details.| diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 400bf3f8..5f55c1a7 100755 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -26,6 +26,9 @@ title = "Congo" layout = "custom" showList = true +[params.list] + groupByYear = false + [[menu.main]] name = "Blog" pageRef = "blog" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2d5d6baa..1c8b0fbf 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,8 +2,10 @@ {{ partial "section-heading.html" . }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} -

{{ .Key }}

-
+ {{ if $.Site.Params.list.groupByYear }} +

{{ .Key }}

+
+ {{ end }} {{ range .Pages }} {{ partial "article-link.html" . }} {{ end }}