In 2025 we allowed Markdown formatting of the abstracts, and I forgot that formatting can be as easy as calling markdownify. OK, to be precise, markdownify strips the wrapping `<p>` tags if there is a single paragraph of text, and the docs (1) recommend using RenderString to always keep them. Therefore, markdownify for subtitle, RenderString for the abstract. This does not affect the 2024 abstracts in any noticeable way. (1) https://gohugo.io/functions/transform/markdownify/
59 lines
1.7 KiB
HTML
59 lines
1.7 KiB
HTML
{{/* load schedule file from global resources in assets */}}
|
|
{{ $data := "" }}
|
|
{{ $path := index .Params 0 }}
|
|
{{ with .Page.Resources.Get $path }}
|
|
{{ with unmarshal . }}
|
|
{{ $data = . }}
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ errorf "Unable to get global resource %q" $path }}
|
|
{{ end }}
|
|
|
|
{{/* display each day's events */}}
|
|
{{ range $data.day }}
|
|
{{/* for each day -- assumes day is a slice (array) */}}
|
|
|
|
{{ $date := (index . "-date") }}
|
|
{{ $dayEvents := slice }}
|
|
|
|
<h2 id='{{ index . "-date" }}' >{{ index . "-date" }}</h2>
|
|
|
|
{{ range (compare.Conditional (reflect.IsSlice .room) .room (slice .room)) }}
|
|
{{/* for each room, ensuring room is a slice (array) */}}
|
|
|
|
{{ $roomname := (index . "-name") }}
|
|
|
|
{{ range $event := (compare.Conditional (reflect.IsSlice .event) .event (slice .event)) }}
|
|
{{/* for each event, ensuring event is a slice (array) */}}
|
|
{{/* add date & room to event, append to dayEvents */}}
|
|
{{ $event = $event | merge (dict "date" $date "room" $roomname) }}
|
|
{{ $dayEvents = $dayEvents | append $event }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ range sort $dayEvents "start" }}
|
|
{{/* display all day's events ordered by start time */}}
|
|
<h3>{{ .title }}</h3>
|
|
<p>
|
|
{{ .start }} ({{ .duration }}) ‧ {{ .room }} {{ with .track }}‧ {{ . }}{{ end }}
|
|
</p>
|
|
<p>
|
|
{{ if reflect.IsSlice .persons.person }}
|
|
{{ delimit .persons.person ", " }}
|
|
{{ else }}
|
|
{{ .persons.person }}
|
|
{{ end }}
|
|
</p>
|
|
{{ with .subtitle }}
|
|
<p>{{ . | markdownify }}</p>
|
|
{{ end }}
|
|
{{ with .abstract }}
|
|
<details>
|
|
<summary>Abstract</summary>
|
|
{{ . | $.Page.RenderString (dict "display" "block") }}
|
|
</details>
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
<hr>
|
|
{{ end }}
|