-
Notifications
You must be signed in to change notification settings - Fork 61
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
Change from "aka" field to "guest_group" field for multi-guest #159
Comments
Make sure to update the REFERENCE file with this. |
I think that for #137, the way this will be handled is like this: we have the part where it selects all the guests: {{ $paginator := .Paginate (where .Data.Pages.ByTitle "Type" "guest") }}
{{ range $paginator.Pages }} now what we would do is check to see if {{- if and (isset .Params "guest_group") (ne .Params.guest_group "") -}} then inside here we will do another {{ range first 1 (where .Data.Pages. "Type" "in" site.Params.mainSections).ByDate.Reverse }} NOTE: actually maybe something like this:
what I don't know happens is if the range in the {{ $paginator := .Paginate (where .Data.Pages.ByTitle "Type" "guest") }}
{{ range $paginator.Pages.GroupByParam "guest_group" }}
{{ range first 1 .Pages.ByDate.Reverse }}
// display guest nonsense
{{ end }}
{{ end }}
{{ end }} then, in {{- if and (isset .Params "guest_group") (ne .Params.guest_group "") -}}
// do something to get all the guests in the guest group
// note: might need to put .Params "guest_group" into a Scratch for use in the next query
{{ range where .Site.Pages "Params.guest_group" (.Params "guest_group") }}
// shove all those guest names into an array (using Scratch probably)
{{ .Scratch.Add "guest-names" (slice .File.BaseFileName) }}
{{ end }}
// step through the array and list every episode for each of those guests
{{- else -}}
{{ $.Scratch.Add "guest-names" (slice .File.BaseFileName) }}
{{ end }}
{{ range $name := $.Scratch.Get "guest-names") }}
{{- $.Scratch.Set "guest-name" $name -}}
{{- range $page := where $.Site.Pages "Type" "episode" -}}
{{- range $page.Params.guests -}}
{{- if eq . ($.Scratch.Get "guest-name") -}}
<a href = "{{$page.Permalink}}" class = "guest_page_episode_link list-group-item list-group-item-action">{{$page.Title}}</a>
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}} |
One thing that isn't handled is backward-compatibility with "aka"...I don't think we need to do it for If we wanted to be fancy though, it would look like this: {{- else -}}
{{- with .Params.Aka -}}
{{ range $name := . }}
{{ .Scratch.Add "guest-names" (slice .File.BaseFileName) }}
{{- end -}}
{{- end -}}
{{ $.Scratch.Add "guest-names" (slice .File.BaseFileName) }}
{{ end }} that's not super elegant, since |
ooh. it might be more elegant to do this: {{- with .Params.guest_group -}}
{{- range where .Site.Pages "Params.guest_group" . -}}
{{- .Scratch.Add "guest-names" (slice .File.BaseFileName) -}}
{{- end -}}
{{- end -}}
{{- with .Params.Aka -}}
{{- range $name := . -}}
{{- $.Scratch.Set "guest-names" (slice $name) -}}
{{- end - }}
{{- end -}}
{{ $.Scratch.Add "guest-names" (slice .File.BaseFileName) }} |
* Fix typo in REFERENCE * Update REFERENCE with guest_group * Add support for grouping guests on guest list page Fixes #137 * Add support for guest_group to guest pages Fixes #159 * Fix AKA bug Signed-off-by: Matt Stratton <[email protected]>
If there are multiple guests, they should all have a matching
guest_group
field, which ties them together.This is an optional field and only used if you have multiple versions of a guest.
The text was updated successfully, but these errors were encountered: