summaryrefslogtreecommitdiff
path: root/layouts/term/term.html
blob: 2c9a4d59e37af561de2058ed6b09ce0420bc2bb4 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{{ define "main" }}
    <article class="posts termlist-page">
        {{ partial "components/post-page-header.html" . }}
        {{ partial "components/breadcrumbs.html" . }}

        <div class="term-list">

            <!-- Posts under this Term -->
            <ul class="term-list-posts">
                {{ range where .Pages "Section" "not in" (slice "cards" "library") }}
                <li>
                    <a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Post Link from Category Page">
                        {{ .Title }}{{ with .Params.subtitle }}:<span class="posts-subtitle">{{. }}</span>
                        {{ end }}
                    </a>
                    <time>
                        {{ .Date.Format "2006-1-2" }}
                    </time>
                </li>
                {{ end }}
            </ul>

            <!-- Cards under this Term -->
            {{ $cards := where .Pages "Section" "eq" "cards" }}
            {{ if gt (len $cards) 0 }}
            <h2>{{ T "termPage.cards" }}</h2>
            <div class="term-list-cards cards-section outbox small">
                {{ range $cards }}
                <div class="card">
                    <h3>
                        <a href="{{ .RelPermalink }}" data-umami-event="🗃️ Click Card Link from Category Page">
                            {{ .Title }}
                        </a>
                    </h3>
                    <p>{{ .Summary }}</p>
                </div>
                {{ end }}
            </div>
            {{ end }}

            <!-- Books under this Term -->
            {{ $books := where .Pages "Section" "eq" "library" }}
            {{ if gt (len $books) 0 }}
            <h2>{{ T "termPage.books" }}</h2>
            <div class="book-group">
                {{ range $books }}
                <div class="book{{ if eq .Params.rating 1 }} badbook{{ end }}{{ if eq .Params.rating 5 }} goodbook{{ end }}">
                    <a href="{{ .Permalink }}" class="book-cover" style="view-transition-name: book-{{ .Title }}">
                        <img
                            class="lazy" src="{{ .Params.cover }}"
                            style="view-transition-name: book-{{ .File.UniqueID }}" />
                    </a>
                </div>
                {{ end }}
            </div>
            {{ end }}
        </div>
    </article>
    {{ partial "footer.html" . }}
{{ end }}