summaryrefslogtreecommitdiff
path: root/layouts/library/single.html
blob: 6eb32a94016ada193e77c66fed34f86550c7d23e (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
{{ define "main" }}
    <article id="book-page">
        <div class="book-page-header">
            <div class="book-cover"
                style="view-transition-name: book-{{ .File.UniqueID }}">
                <img
                    class="lazy"
                    src="{{ .Params.cover }}!thumbnail"
                    data-src="{{ .Params.cover }}"
                />
            </div>
            <h1 class="book-title">{{ .Title }}</h1>
            {{- $rating := .Params.rating -}}
            {{- $fullStars := math.Floor $rating -}}
            <p class="book-author">
                {{ .Params.author }}
            </p>
            <p class="book-rating">
                {{- range seq $fullStars }}
                <span class="star">⭐</span>
                {{- end -}}
            </p>
            <!-- 导航作用的骷髅头图标 -->
            <div>
                <a href="{{ .Site.LanguagePrefix }}/library"
                    class="title-image-container">
                    <img src="/header.png" alt="Logo"
                        class="invert-if-dark title-image"
                        style="view-transition-name: title-image"
                    />
                </a>
            </div>
        </div>
        <div class="markdown-body book-body">
            <div class="book-content">
                {{ .Content }}
            </div>
            <div class="book-footer">
                <p>于 {{ .Date.Format "2006-01-02" }} 读完</p>
            </div>
        </div>
        {{ partial "components/comment.html" . }}
    </article>
{{ end }}