mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 00:52:19 +01:00
layouts/_default/list.html: Check for page type instead of "section"
Both work effectively the same for my use case, but the "type" is more obvious when looking at the code. See the documentation for Hugo's page variables for more info[0]. [0] http://gohugo.io/templates/variables/#page-variables
This commit is contained in:
parent
42c06c260c
commit
d31626c5a3
@ -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 (where .Data.Pages "Section" "post") }}
|
{{ range first $num_recent_posts (where .Data.Pages "Type" "post") }}
|
||||||
{{ .Render "summary"}}
|
{{ .Render "summary"}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user