summaryrefslogtreecommitdiff
path: root/layouts/library
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-06-05 13:06:36 +0800
committerEltrac <hi@guhub.cn>2025-06-05 13:06:36 +0800
commit871662725c287c73fcf55a1212f176679a690f04 (patch)
tree74c6dfb9e92788d84394cbeb576875093b199b43 /layouts/library
parente1e10964030858ce41cb0cf578c9f2abeab018f1 (diff)
chore: configure pagefind for better UX
- set up correct title metadata - set up sorting data - exclude certain selectors
Diffstat (limited to 'layouts/library')
-rw-r--r--layouts/library/single.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/library/single.html b/layouts/library/single.html
index 3bd00ca3..fa53149b 100644
--- a/layouts/library/single.html
+++ b/layouts/library/single.html
@@ -8,7 +8,7 @@
src="{{ .Params.cover }}"
/>
</div>
- <h1 class="book-title">{{ .Title }}</h1>
+ <h1 class="book-title" data-pagefind-meta="title">{{ .Title }}</h1>
{{- $rating := .Params.rating -}}
{{- $fullStars := math.Floor $rating -}}
<p class="book-author">
@@ -35,7 +35,10 @@
{{ .Content }}
</div>
<div class="book-footer">
- <p>于 {{ .Date.Format "2006-01-02" }} 读完</p>
+ <p>于 <time
+ data-pagefind-sort="date[data-date], weight[data-weight]"
+ data-date="{{ .Date.Format "2006-01-02" }}"
+ data-weight="10">{{ .Date.Format "2006-01-02" }}</time> 读完</p>
</div>
</div>
{{ partial "components/comment.html" . }}