diff --git a/exampleSite/content/home/projects.md b/exampleSite/content/home/projects.md index 61aca8ee..70b496e7 100644 --- a/exampleSite/content/home/projects.md +++ b/exampleSite/content/home/projects.md @@ -18,6 +18,10 @@ weight = 50 view = 1 # Filter toolbar. + +# Default filter index (e.g. 0 corresponds to the first `[[filter]]` instance below). +filter_default = 0 + # Add or remove as many filters (`[[filter]]` instances) as you like. # Use "*" tag to show all projects or an existing tag prefixed with "." to filter by specific tag. # To remove toolbar, delete/comment all instances of `[[filter]]` below. diff --git a/layouts/partials/widgets/projects.html b/layouts/partials/widgets/projects.html index ec228eab..4adb056d 100644 --- a/layouts/partials/widgets/projects.html +++ b/layouts/partials/widgets/projects.html @@ -10,13 +10,18 @@
{{ . | markdownify }}
{{ end }} + {{ $filter_default := default (int $page.Params.filter_default) 0 }} + {{ with $page.Params.filter }} + {{ (index $page.Params.filter ($filter_default)).tag }} + {{ end }} +