mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-22 09:43:11 +01:00
18 lines
No EOL
742 B
Text
18 lines
No EOL
742 B
Text
{{- define "main" -}}
|
|
# {{ with .Params.emoji }}{{.}} {{end}}{{ title (replace .Title "-" " ") }}
|
|
|
|
{{- with .Page.RenderShortcodes }}
|
|
{{- partial "markdown.gmi" . -}}{{ end }}
|
|
|
|
{{ range $bundledEvents := (partial "events.obj" .Data.Pages) -}}
|
|
## {{ (index $bundledEvents 0).Date.Format "Jan 2006" }}
|
|
{{ range $bundledEvents -}}
|
|
{{- $hour := .Date.Format "15" -}}
|
|
{{- $duration := .Duration.Hours -}}
|
|
{{- $span := "evening" }}
|
|
{{- if and (gt $hour 9) (lt $hour 17) }}{{ $span = "daytime" }}{{ end -}}
|
|
{{- if ge $duration 24 }}{{ $span = "multi-day" }}{{ end -}}
|
|
=> {{ .Page.RelPermalink }} {{ with .Page.Params.emoji }}{{ . }} {{ end }}{{ .Date.Format "2006-01-02"}} {{.Page.Title}} ({{ $span }})
|
|
{{ end -}}
|
|
{{- end -}}
|
|
{{- end -}} |