Permalink
Browse files

talk widget: Add `exclude_selected` option to hide selected talks

Close #623
  • Loading branch information...
gcushen committed Aug 10, 2018
1 parent beaa10b commit f1a32966f3aed7ca1a003445b1afd8a99f2d7b91
Showing with 10 additions and 1 deletion.
  1. +2 −0 exampleSite/content/home/talks.md
  2. +8 −1 layouts/partials/widgets/talks.html
@@ -18,5 +18,7 @@ count = 10
# 1 = Detailed
list_format = 0
# Exclude talks that are shown in the Selected Talks widget?
exclude_selected = false
+++
@@ -19,7 +19,14 @@ <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ range first $page.Params.count (sort (where $.Site.RegularPages "Type" "talk") ".Params.time_start" "desc") }}
{{ $.Scratch.Set "talks" (where $.Site.RegularPages "Type" "talk") }}
{{/* Exclude talks shown in Selected Talks widget? */}}
{{ if $page.Params.exclude_selected }}
{{ $.Scratch.Set "talks" (where ($.Scratch.Get "talks") ".Params.selected" "!=" true) }}
{{ end }}
{{ range first $page.Params.count (sort ($.Scratch.Get "talks") ".Params.time_start" "desc") }}
{{ if eq $page.Params.list_format 1 }}
{{ partial "talk_li_detailed" . }}
{{ else }}

0 comments on commit f1a3296

Please sign in to comment.