mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-27 04:34:29 +01:00
Alan Orth
d31626c5a3
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
10 lines
217 B
HTML
10 lines
217 B
HTML
{{ define "main" }}
|
|
|
|
{{ $num_recent_posts := .Site.Params.num_recent_posts | default "5" }}
|
|
|
|
{{ range first $num_recent_posts (where .Data.Pages "Type" "post") }}
|
|
{{ .Render "summary"}}
|
|
{{ end }}
|
|
|
|
{{ end }}
|