Skip to content

Sort Guest Episodes by Date in reverse order #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions layouts/guest/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ <h3>Episodes Featuring {{ .Title }} {{ with .Params.Pronouns }}({{ . }}){{ end }
{{- $.Scratch.Add "guest-names" (slice $names) -}}
{{- end -}}
{{- end -}}

{{- else -}}
{{ $.Scratch.Set "guest-names" (slice .File.BaseFileName) }}
{{- end -}}
{{- end -}}
<div class="list-group guest_episode_list">
{{ range $name := ($.Scratch.Get "guest-names") }}
{{- $.Scratch.Set "guest-name" $name -}}
{{- range $page := (where ( where site.RegularPages "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}}
{{- range $page := (where ( where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections) ".Params.upcoming" "!=" true ) -}}
{{- range $page.Params.guests -}}
{{- if eq . ($.Scratch.Get "guest-name") -}}
{{ if and (isset $.Site.Params "episode_number_style") ($page.Params.episode)}}
{{ if eq $.Site.Params.episode_number_style "parens" }}
{{ if eq $.Site.Params.episode_number_style "parens" }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }} ({{ with $.Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ $page.Params.episode }})</a>
{{ else if eq $.Site.Params.episode_number_style "brackets" }}
<a href="{{ $page.Permalink }}" class= "guest_page_episode_link list-group-item list-group-item-action">{{ $page.Title }} [{{ with $.Site.Params.episode_number_prefix }}{{ . }}{{ end }}{{ $page.Params.episode }}]</a>
Expand Down