mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 09:02:18 +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:
parent
5b0405e69c
commit
42c06c260c
@ -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 }}
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user