diff options
author | Olivier DOSSMANN <git@dossmann.net> | 2019-08-17 20:28:00 +0300 |
---|---|---|
committer | Zhe Zhang <neomana@gmail.com> | 2019-09-20 04:44:45 +0300 |
commit | f666effe196af5f9a578f9b652229c96803a5b98 (patch) | |
tree | 3a567ac0e564b23ea3212fa540549754676d0bb6 | |
parent | 4adddbd1a4c55a886aecfd35013eabf86c451eb4 (diff) |
* 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
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | layouts/index.html | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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" . }} <div class="content"> <div class="posts"> - {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }} {{ range $paginator.Pages }} + {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} {{ range $paginator.Pages }} <div class="post"> <h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2> <span class="post-date">{{ .Date.Format "Jan 2, 2006" }}</span> |