bunteshaus.de/themes/buha/layouts/partials/tools/categories.html

48 lines
1.8 KiB
HTML
Raw Normal View History

2022-03-27 19:58:39 +02:00
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- $tags := slice -}}
{{- $categories := slice -}}
{{ range $pages }}
{{- if .Params.tags -}}
{{- $tags = $tags | append .Params.tags -}}
{{ end }}
{{- if .Params.categories -}}
{{- $categories = $categories | append .Params.categories -}}
{{ end }}
{{ end }}
{{- $categories := $categories | uniq -}}
{{- $tags := $tags | uniq -}}
<label for="categories">{{ i18n "categories" }}</label>
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="categories" name="categories">
{{ range sort $categories }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="category" id="{{ . }}-cat" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-cat">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
<label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" />
<label for="tags">{{ i18n "tags" }}</label>
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="tags" name="tags">
{{ range sort $tags }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="tags" id="{{ . }}-tag" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-tag">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
<label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newtag" id="newtag" placeholder="" />