layouts: Make featured posts configurable

For now it gets the first three posts with "featured: true" in their
frontmatter and displays them in a random order (so no control over
the placement of large feature or two smaller features).

TODO: gracefully handle the case where there are no pages with the
"featured: true" frontmatter so new users don't see a super weird
and broken front page.
This commit is contained in:
2020-12-28 10:03:41 +02:00
parent 40c902ae8a
commit f28cf4615c
3 changed files with 3 additions and 95 deletions

View File

@ -39,7 +39,7 @@
</h3>
{{ $truncate := default true .Site.Params.truncate }}
{{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{ $paginator := .Paginate (where .Site.RegularPages "Params.featured" "ne" true) }}
{{ range $paginator.Pages }}
{{ if $truncate }}
{{ .Render "summary" }}