1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-12-19 00:52:19 +01:00

layouts: Only list posts on front page and sidebar

We don't want to list other top-level pages like "About" here, they
will be enumerated in the header.
This commit is contained in:
Alan Orth 2016-09-14 16:35:04 +03:00
parent 5b0405e69c
commit 42c06c260c
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
{{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }} {{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }}
{{ range first $num_recent_posts .Data.Pages }} {{ range first $num_recent_posts (where .Data.Pages "Section" "post") }}
{{ .Render "summary"}} {{ .Render "summary"}}
{{ end }} {{ end }}

View File

@ -11,7 +11,7 @@
<section class="sidebar-module"> <section class="sidebar-module">
<h4>Recent Posts</h4> <h4>Recent Posts</h4>
<ol class="list-unstyled"> <ol class="list-unstyled">
{{ range first $num_recent_posts .Site.Pages }} {{ range first $num_recent_posts (where .Site.Pages "Section" "post") }}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li> <li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{ end }} {{ end }}
</ol> </ol>