summaryrefslogtreecommitdiff
path: root/layouts/library/single.html
blob: 4927ad71a1a3cfbd6abe646f82f9ed20d7986104 (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
{{ define "main" }}
    <article id="book-page">
        {{ partial "header.html" . }}
        <div class="markdown-body book-body">
            <div class="book-cover"
                style="view-transition-name: book-{{ .File.UniqueID }}">
                <img src="{{ .Params.cover }}" />
            </div>
            <h3 class="book-title">{{ .Title }}</h3>

            {{- $rating := .Params.rating -}}
            {{- $fullStars := math.Floor $rating -}}
            <div class="book-meta">
                {{- range seq $fullStars }}
                <span class="star">⭐</span>
                {{- end -}}
                <span> / </span>
                <span class="author">{{ .Params.author }}</span>
            </div>

            <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 }}