Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zhe/hugo-theme-slim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier DOSSMANN <git@dossmann.net>2019-08-17 20:28:00 +0300
committerZhe Zhang <neomana@gmail.com>2019-09-20 04:44:45 +0300
commitf666effe196af5f9a578f9b652229c96803a5b98 (patch)
tree3a567ac0e564b23ea3212fa540549754676d0bb6
parent4adddbd1a4c55a886aecfd35013eabf86c451eb4 (diff)
Should fix problem with https://github.com/gohugoio/hugoThemes/issues/682:HEADmaster
* 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.md2
-rw-r--r--layouts/index.html2
2 files changed, 3 insertions, 1 deletions
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" . }}
<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>