mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02: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:
parent
6b1f2f3cf0
commit
f9565e3931
1 changed files with 7 additions and 1 deletions
|
@ -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" }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue