mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +00:00
publication widget: Add option to exclude selected publications
Add `exclude_selected = false` option to frontmatter of publication widget. See #385
This commit is contained in:
1 parent
b6e1dd2710
commit
eaccab614e
2 files changed
+7
No files matched your search
@@ -31,5 +31,8 @@ list_format = 3
|
||||
# 5: Book
|
||||
# 6: Book chapter
|
||||
publication_type = "-1"
|
||||
|
||||
# Exclude publications that are shown in the Selected Publications widget?
|
||||
exclude_selected = false
|
||||
+++
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
{{ $.Scratch.Set "recent_pubs" (where $.Site.RegularPages "Type" "publication") }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $page.Params.exclude_selected }}
|
||||
{{ $.Scratch.Set "recent_pubs" ( ($.Scratch.Get "recent_pubs") | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.selected" "!=" true) ) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $recent_pubs := $.Scratch.Get "recent_pubs" }}
|
||||
{{ range first $page.Params.count $recent_pubs }}
|
||||
{{ if eq $page.Params.list_format 1 }}
|
||||
|
||||
Reference in new issue
Block a user