Skip to content

Commit

Permalink
Should fix problem with gohugoio/hugoThemes#682:
Browse files Browse the repository at this point in the history
  * 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
  • Loading branch information
blankoworld authored and zhe committed Sep 20, 2019
1 parent 4adddbd commit f666eff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit f666eff

Please # to comment.