From b0ffb4ddc7e681f4034b80abff51b54225ae497d Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 11 Jan 2021 22:14:58 +0000 Subject: [PATCH] feat(widget): allow to constrain Portfolio by set of tags --- wowchemy/layouts/partials/widgets/portfolio.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wowchemy/layouts/partials/widgets/portfolio.html b/wowchemy/layouts/partials/widgets/portfolio.html index 9eb8cb59..a24992f0 100644 --- a/wowchemy/layouts/partials/widgets/portfolio.html +++ b/wowchemy/layouts/partials/widgets/portfolio.html @@ -47,7 +47,15 @@ {{ end }}
- {{ range $idx, $item := where site.RegularPages "Type" $items_type }} + + {{ $query := "" }} + {{ if $st.Params.content.filters.tags }} + {{ $query = where site.Pages "Params.tags" "intersect" $st.Params.content.filters.tags }} + {{ else }} + {{ $query = where site.RegularPages "Type" $items_type }} + {{ end }} + + {{ range $idx, $item := $query }} {{ $link := $item.RelPermalink }} {{ $target := "" }}