summaryrefslogtreecommitdiff
path: root/layouts/_partials/term/term-header.html
blob: e0501b65b46df975b0d36bd621ae1ec48bc298d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div class="term-header">
    <h1 class="flex items-center justify-between"
        style="view-transition-name: category-{{ .Title }}">
        <!-- Tag/Category icon and name -->
        <div>
        {{ if or (hasPrefix .Page.Params.icon "http://") (hasPrefix .Page.Params.icon "https://") }}
                <img src="{{ .Page.Params.icon }}" alt="{{ .Page.LinkTitle }}"
                    style="height:1em;width:1em">
        {{ else }}
            {{ .Page.Params.icon }}
        {{ end }}
        {{ if and (eq .Data.Singular "tag") (not .Params.icon) }}#{{ end }}
        {{ .Title }}
        </div>
        <!-- Filter buttons -->
        <div>
            {{ if eq .Data.Singular "tag" }}
            <button class="bg-transparent dark:invert" id="hide-weekly"
                data-tooltip='{{ T "termFilterButton.hideWeekly" . }}'>
                <img src="/img/crow.svg" alt="Hide Weekly"
                    class="w-6 h-6 block hover:animate-swing" />
            </button>
            {{ end }}
            <button class="bg-transparent dark:invert" id="reverse-order"
                data-tooltip='{{ T "termFilterButton.reverseOrder" . }}'>
                <img src="/img/clockwork.svg" alt="Reverse Order"
                    class="w-6 h-6 block hover:rotate-180 transition-transform" />
            </button>
        </div>
    </h1>
    {{ with .Params.description | markdownify }}
        <p class="term-description">{{ . }}</p>
    {{ end }}
</div>