{{ $section := .Section }}
{{ if eq $section "diary" }}
Фильтры
{{ .Scratch.Set "tags" (index .Site.Taxonomies.tags (slice "diary")) }}
{{ $diaryTags := slice }}
{{ range where .Site.RegularPages "Section" "diary" }}
{{ range .Params.tags }}
{{ $diaryTags = $diaryTags | append . }}
{{ end }}
{{ end }}
{{ $diaryTags = $diaryTags | uniq }}
{{ if $diaryTags }}
Теги
{{ range $diaryTags }}
- {{ . }}
{{ end }}
{{ end }}
{{ else if eq $section "kb" }}
Фильтры
{{ $kbTags := slice }}
{{ range where .Site.RegularPages "Section" "kb" }}
{{ range .Params.tags }}
{{ $kbTags = $kbTags | append . }}
{{ end }}
{{ end }}
{{ $kbTags = $kbTags | uniq }}
{{ if $kbTags }}
Теги
{{ range $kbTags }}
- {{ . }}
{{ end }}
{{ end }}
{{ else if eq $section "plans" }}
Статусы
{{ else if eq $section "guides" }}
Фильтры
{{ $guideTags := slice }}
{{ range where .Site.RegularPages "Section" "guides" }}
{{ range .Params.tags }}
{{ $guideTags = $guideTags | append . }}
{{ end }}
{{ end }}
{{ $guideTags = $guideTags | uniq }}
{{ if $guideTags }}
Теги
{{ range $guideTags }}
- {{ . }}
{{ end }}
{{ end }}
{{ else if eq $section "creds" }}
Фильтры
{{ $credServices := slice }}
{{ range where .Site.RegularPages "Section" "creds" }}
{{ if .Params.service }}
{{ $credServices = $credServices | append .Params.service }}
{{ end }}
{{ end }}
{{ $credServices = $credServices | uniq }}
{{ if $credServices }}
Сервисы
{{ range $credServices }}
- {{ . }}
{{ end }}
{{ end }}
{{ else }}
Разделы
{{ end }}