Allow for multiple categories in tables

This commit is contained in:
2025-01-17 15:36:01 +01:00
parent e4ad157a54
commit ca6250bbf6
3 changed files with 16 additions and 15 deletions

View File

@@ -12,6 +12,7 @@
{{- end -}}
{{- end -}}
{{- $cat := .Get "category" -}}
{{/* warnf "%#v" $cat */}}
{{- $showAge := .Get "showAge" | default false -}}
{{- $list = sort $list "start" -}}
{{- $list = sort $list "title" -}}
@@ -29,8 +30,10 @@
</thead>
<tbody>
{{ range $list -}}
{{- if ne .class $cat }}{{ continue }}{{ end -}}
{{/* warnf "%#v" . */}}
{{- $cats := slice .class -}}
{{- if eq (printf "%T" .class) "[]interface {}" }}{{ $cats = .class }}{{ end -}}
{{- if not (in $cats $cat) }}{{ continue }}{{ end -}}
{{/* warnf "%T %#v" .class . */}}
<tr>
<td>
{{ .title }}{{ with .subtitle }} - {{ . }}{{ end }}