From f666effe196af5f9a578f9b652229c96803a5b98 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Sat, 17 Aug 2019 19:28:00 +0200 Subject: Should fix problem with https://github.com/gohugoio/hugoThemes/issues/682: * add mainSections in README.md file to choose "post" as main articles * fix layouts/index.html to permit user to choose which main section it needs --- README.md | 2 ++ layouts/index.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc02f7d..9eedbcd 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ You could add `params` into your site's `config.toml` file: Content = false # takes true or false # if both are set to true, summary is shown. # FooterMsg = "Copyright Me 2016. Powered by Hugo." + mainSections = ["post"] ``` if you use `config.yaml`, it could look like: @@ -45,6 +46,7 @@ params: Content: false # takes true or false # if both are set to true, summary is shown # FooterMsg: "Custom footer message. Powered by Hugo." + mainSections: ["post"] ``` ### Enable Disqus to your post diff --git a/layouts/index.html b/layouts/index.html index 91bdc41..2e82058 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -10,7 +10,7 @@ {{ partial "header.html" . }}
- {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} {{ range $paginator.Pages }} + {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} {{ range $paginator.Pages }}

{{ .Title }}

-- cgit v1.2.3