Last active
June 14, 2020 12:30
-
-
Save damien1/15817ec00350fe352e1113b230189d78 to your computer and use it in GitHub Desktop.
Hugo Featured Content - using front matter param. example {{< featured-param count=2 >}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $count := .Get "count" | default 3 }} | |
<h3>Featured Posts</h3> | |
<ul> | |
{{ range first $count where (where .Pages "Section" "blog" ) ".Params.featured" "=" true }} | |
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a> | |
</li> | |
{{ end }} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment