mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 16:15:12 +00:00
feat(portfolio): add filters for exclude_tags and page kind
Experimental Portfolio widget support for: content.filters.exclude_tags content.filters.kinds
This commit is contained in:
1 parent
6b1f2f3cf0
commit
f9565e3931
1 file changed
+7
-1
@@ -50,7 +50,7 @@
|
||||
<div class="{{ if or $st.Params.content.filter_button (in (slice "masonry" 3) $view) }}isotope projects-container{{end}} {{if in (slice "masonry" 3) $view}}js-layout-masonry{{else}}row js-layout-row{{end}} {{ if eq $view "showcase" }}project-showcase{{end}}">
|
||||
|
||||
{{/* 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" }}
|
||||
|
||||
Reference in new issue
Block a user