Files
docs.a2v.space/themes/a2v/layouts/partials/sidebar.html
T

108 lines
3.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="sidebar-content">
{{ $section := .Section }}
{{ if eq $section "diary" }}
<h6>Фильтры</h6>
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/diary/">Все записи</a></li>
</ul>
{{ .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 }}
<h6 class="mt-3">Теги</h6>
<ul class="nav flex-column">
{{ range $diaryTags }}
<li class="nav-item"><a class="nav-link" href="{{ "/tags/" | relURL }}{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ else if eq $section "kb" }}
<h6>Фильтры</h6>
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/kb/">Все статьи</a></li>
</ul>
{{ $kbTags := slice }}
{{ range where .Site.RegularPages "Section" "kb" }}
{{ range .Params.tags }}
{{ $kbTags = $kbTags | append . }}
{{ end }}
{{ end }}
{{ $kbTags = $kbTags | uniq }}
{{ if $kbTags }}
<h6 class="mt-3">Теги</h6>
<ul class="nav flex-column">
{{ range $kbTags }}
<li class="nav-item"><a class="nav-link" href="{{ "/tags/" | relURL }}{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ else if eq $section "plans" }}
<h6>Статусы</h6>
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/plans/">Все планы</a></li>
<li class="nav-item"><a class="nav-link status-planned" href="/plans/?status=planned">🟡 Запланировано</a></li>
<li class="nav-item"><a class="nav-link status-in-progress" href="/plans/?status=in_progress">🟠 В процессе</a></li>
<li class="nav-item"><a class="nav-link status-done" href="/plans/?status=done">✅ Сделано</a></li>
<li class="nav-item"><a class="nav-link status-cancelled" href="/plans/?status=cancelled">❌ Отменено</a></li>
</ul>
{{ else if eq $section "guides" }}
<h6>Фильтры</h6>
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/guides/">Все инструкции</a></li>
</ul>
{{ $guideTags := slice }}
{{ range where .Site.RegularPages "Section" "guides" }}
{{ range .Params.tags }}
{{ $guideTags = $guideTags | append . }}
{{ end }}
{{ end }}
{{ $guideTags = $guideTags | uniq }}
{{ if $guideTags }}
<h6 class="mt-3">Теги</h6>
<ul class="nav flex-column">
{{ range $guideTags }}
<li class="nav-item"><a class="nav-link" href="{{ "/tags/" | relURL }}{{ . | urlize }}/">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ else if eq $section "creds" }}
<h6>Фильтры</h6>
<ul class="nav flex-column">
<li class="nav-item"><a class="nav-link" href="/creds/">Все креды</a></li>
</ul>
{{ $credServices := slice }}
{{ range where .Site.RegularPages "Section" "creds" }}
{{ if .Params.service }}
{{ $credServices = $credServices | append .Params.service }}
{{ end }}
{{ end }}
{{ $credServices = $credServices | uniq }}
{{ if $credServices }}
<h6 class="mt-3">Сервисы</h6>
<ul class="nav flex-column">
{{ range $credServices }}
<li class="nav-item"><a class="nav-link" href="/creds/?service={{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ else }}
<h6>Разделы</h6>
<ul class="nav flex-column">
{{ range .Site.Menus.main }}
<li class="nav-item"><a class="nav-link" href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
{{ end }}
</div>