summaryrefslogtreecommitdiff
path: root/layouts/_partials/items/post.html
blob: 1adf86af99b192891ab944fb67dc4306cf3494f7 (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
{{ $ctx := .ctx }}
{{ $showSummary := .showSummary }}
<div class="posts-item w-full my-2"
    style="view-transition-name: post-{{ .ctx.File.UniqueID }}">
    <header class="w-full md:flex md:justify-between">
        <div>
            <p class="font-mono font-secondary">
                <time>{{ .ctx.Date.Format "January 2" }},</time>
                <span>in <a href="/{{ .Section }}/">{{ .ctx.Section }}</a></span>
            </p>
            <h2 class="xerox"
                {{ if $showSummary }} style="margin-bottom: 0"{{ end }}>
                <a
                    href="{{ .ctx.Permalink }}"
                    data-umami-event="🏠 Click post link from index"
                >
                    {{ if eq .ctx.Section "library" }}
                        读《{{ .ctx.Title }}》
                    {{ else }}
                        {{ .ctx.Title }}
                    {{ end }}
                </a>
                {{ if eq .ctx.Section "fictions" }}
                <span class="font-normal text-4 text-[var(--secondary-text-color)]">小说</span>
                {{ end }}
            </h2>
        </div>
        {{ with .ctx.Params.categories }}
        <div class="my-2">
            <a href="/categories/{{ . }}" style="padding: 0.1rem 0.3rem;">
                {{ . }}
            </a>
        </div>
        {{ end }}
    </header>
    {{ if $showSummary }}
        <div class="markdown-body text-size-lg!"
            style="view-transition-name: post-content-{{ .File.UniqueID }}">
            {{ .ctx.Summary }}
        </div>
    {{ end }}
</div>