diff options
| author | Eltrac <hi@guhub.cn> | 2025-06-05 13:06:36 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-06-05 13:06:36 +0800 |
| commit | 227fb4cb419a44132340963f78147e8df604a0ee (patch) | |
| tree | 74c6dfb9e92788d84394cbeb576875093b199b43 /layouts/posts | |
| parent | 3dce316661f461723a70efcbebbf428f44db3c33 (diff) | |
chore: configure pagefind for better UX
- set up correct title metadata
- set up sorting data
- exclude certain selectors
Former-commit-id: 871662725c287c73fcf55a1212f176679a690f04
Diffstat (limited to 'layouts/posts')
| -rw-r--r-- | layouts/posts/single.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 0fe65678..d31c9f30 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -9,7 +9,7 @@ {{ partial "components/banner.html" . }} <!-- Title and Subtitle --> <h1 class="post-title"> - {{ .Title }} + <span data-pagefind-meta="title">{{ .Title }}</span> {{ with .Params.subtitle }} <small class="post-subtitle">{{ . }}</small> {{ end }} @@ -37,7 +37,10 @@ {{ $fuzzyTime = "深夜" }} {{ end }} - <time class="post-date" datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}"> + <time class="post-date" + datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}" + data-pagefind-sort="date[datetime], weight[data-weight]" + data-weight="{{ if .Params.featured }}30{{ else }}20{{ end }}"> {{ .Date.Format "2006年1月2日" }} {{ $fuzzyTime }} </time> {{ end }} |
