From a72767da4a1f87a24705b55bf9fcd5435cb5d46b Mon Sep 17 00:00:00 2001 From: Dmitry Kolosov Date: Thu, 6 Jul 2023 16:11:45 +0200 Subject: [PATCH] add param sectionsWithFullContentOnListPage --- README.md | 3 +++ layouts/_default/list.html | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 78d612d..bf17d4f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). - Dark mode (automatic / by switcher) - Pagination - Multiple taxonomies: tags, categories, authors +- Multiple sections: posts, notes, etc with customization - Archive - Table of Contents - Open Graph and Twitter Cards support @@ -97,6 +98,8 @@ params: dateFormat: "2006-01-02" paginationSinglePost: true style: light-without-switcher + mainSections: [ "posts" ] # which sections should be on index/main page + sectionsWithFullContentOnListPage: [ "notes" ] # for which sections content should be displayed on list pages readMore: false # show read more button readNextPosts: 5 # show 5 related posts, 0 by default disableSummary: false diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2f6d7c4..1ce5dc1 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -5,7 +5,8 @@

{{ i18n .Title }}

- {{ $pages := where (where .Pages "Type" "in" site.Params.mainSections) "Params.hidden" "!=" true}} + {{ $showFullContent := in .Site.Params.sectionsWithFullContentOnListPage .Section }} + {{ $pages := where .Pages "Params.hidden" "!=" true}} {{ range $pages }}
@@ -14,6 +15,9 @@ {{ partial "post-language-switcher.html" . }}
+ {{ if $showFullContent }} + {{ .Content }} + {{ end }} {{ partial "post-info.html" . }}
{{ end }}