From f9565e3931c430ede909feccb0747e84b293a76f Mon Sep 17 00:00:00 2001 From: Geo Date: Wed, 11 May 2022 20:26:23 +0100 Subject: [PATCH] feat(portfolio): add filters for exclude_tags and page kind Experimental Portfolio widget support for: content.filters.exclude_tags content.filters.kinds --- wowchemy/layouts/partials/widgets/portfolio.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wowchemy/layouts/partials/widgets/portfolio.html b/wowchemy/layouts/partials/widgets/portfolio.html index 0fd360ed..6d0384fd 100644 --- a/wowchemy/layouts/partials/widgets/portfolio.html +++ b/wowchemy/layouts/partials/widgets/portfolio.html @@ -50,7 +50,7 @@
{{/* Query */}} - {{ $query := site.RegularPages }} + {{ $query := site.Pages }} {{/* Filters */}} {{ with $st.Params.content.page_type }} @@ -63,6 +63,12 @@ {{ with $st.Params.content.filters.tags }} {{ $query = where $query "Params.tags" "intersect" . }} {{ end }} + {{ with $st.Params.content.filters.exclude_tags }} + {{ $query = $query | symdiff (where site.Pages "Params.tags" "intersect" .) }} + {{ end }} + {{ with ($st.Params.content.filters.kinds | default (slice "page")) }} + {{ $query = where $query "Kind" "in" . }} + {{ end }} {{/* Sort */}} {{ $sort_by := $st.Params.content.sort_by | default "Date" }}