blob: 48e6924cbf8f7ac1b5a8621cfc79591fa03f5171 (
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
|
{{- $books := where .Site.Pages "Section" "library" -}}
{{- $book := index (where $books "File.BaseFileName" (.Get 0)) 0 -}}
{{- if $book }}
<div class="markdown-body text-size-lg md:text-size-xl">
<div class="mx-auto max-w-[50%] ">
<img class="block w-full" src="{{ $book.Params.cover }}" />
</div>
<h3 class="book-title">
<a href="{{ $book.Permalink }}">{{ $book.Title }}</a>
</h3>
{{- $rating := $book.Params.rating -}}
{{- $fullStars := math.Floor $rating -}}
<div class="rating">
<span>评分:</span>
{{- range seq $fullStars }}
<span class="star">★</span>
{{- end -}}
</div>
<div class="book-content">
{{ $book.Content }}
</div>
</div>
{{- else }}
<p style="color: red;">⚠️ 无法找到书评: {{ .Get 0 }}</p>
{{- end }}
|