{{ with $st.Content }}{{ . }}{{ end }}
{{ if $st.Params.content.filter_button }}
{{ $filter_default := default (int $st.Params.content.filter_default) 0 }}
{{/* Parse default filter tag from front matter in the form of either tag name or CSS class name. */}}
{{ $default_filter_tag_raw := (index $st.Params.content.filter_button ($filter_default)).tag }}
{{ $default_filter_tag := printf ".js-id-%s" (replace $default_filter_tag_raw " " "-") }}
{{ if or (eq (substr $default_filter_tag_raw 0 1) "*") (eq (substr $default_filter_tag_raw 0 1) ".") }}
{{ $default_filter_tag = $default_filter_tag_raw }}
{{ end }}
{{ $default_filter_tag }}
{{/* Only show filter buttons if there are multiple filters. */}}
{{ if gt (len $st.Params.content.filter_button) 1 }}
{{ range $idx, $item := $st.Params.content.filter_button }}
{{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}}
{{ $data_filter := printf ".js-id-%s" (replace .tag " " "-") }}
{{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }}
{{ $data_filter = .tag }}
{{ end }}
{{ .name }}
{{ end }}