Allow for multiple categories in tables
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user