diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-24 16:51:48 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-24 16:51:48 +0800 |
| commit | 9207dc6c57f99a42b522eb86bd2f0bcbb1a7bb7a (patch) | |
| tree | 0c5b1fc45d547abe0271bcf94a03486d2f0d1d2d | |
| parent | d8e62892c512c013ff4af462efac37482467380b (diff) | |
feat: display book reviews on index page
| -rw-r--r-- | assets/css/components/_postlist.scss | 3 | ||||
| -rw-r--r-- | hugo.yaml | 1 | ||||
| -rw-r--r-- | layouts/index.html | 14 | ||||
| -rw-r--r-- | static/img/book-storm.svg | 2 |
4 files changed, 16 insertions, 4 deletions
diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss index 68adca84..9f25359f 100644 --- a/assets/css/components/_postlist.scss +++ b/assets/css/components/_postlist.scss @@ -13,6 +13,7 @@ flex-direction: column; margin: 1rem 0; .posts-item { + overflow: hidden; width: 100%; border-bottom: 1px solid var(--border-color); margin: 0.5rem 0; @@ -56,7 +57,7 @@ right: 0; opacity: 0.25; z-index: -1; - transform: rotateY(180deg); + transform: rotateY(180deg) rotate(-25deg); img { width: 8rem; height: 8rem; @@ -85,6 +85,7 @@ params: mainSections: - posts - fictions + - library favicon: /favicon.png extraCSSFiles: - /pagefind/pagefind-ui.css diff --git a/layouts/index.html b/layouts/index.html index 8ec76d08..19ac50fa 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -20,7 +20,13 @@ <a href="{{ .Permalink }}" data-umami-event="Click post link from index" - >{{ .Title }}</a> + > + {{ if eq .Section "library" }} + 读《{{ .Title }}》 + {{ else }} + {{ .Title }} + {{ end }} + </a> {{ if eq .Section "fictions" }} <span class="posts-item-title-pill">小说</span> {{ end }} @@ -43,9 +49,11 @@ {{ $firstPost = false }} <!-- 更新为非第一篇 --> {{ end }} <!-- 如果是小说,则显示图标 --> - {{ if eq .Section "fictions" }} + {{ if or (eq .Section "fictions") (eq .Section "library") }} <div class="posts-item-icon invert-if-dark"> - <img src="/img/skull-slices.svg" /> + <img src="{{ if eq .Section "fictions" }} + {{ .Site.BaseURL }}img/skull-slices.svg{{ else }} + {{ .Site.BaseURL }}img/book-storm.svg{{ end }}" /> </div> {{ end }} </div> diff --git a/static/img/book-storm.svg b/static/img/book-storm.svg new file mode 100644 index 00000000..7d88bed7 --- /dev/null +++ b/static/img/book-storm.svg @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --> +<svg width="800px" height="800px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path fill="#000000" d="M256.313 29.844c-16.47-.022-32.95 2.724-49.282 8.343l5.69 16.563L17.53 123l6.19 17.656L231.405 68.03l-5.562-15.905c19.548-4.75 38.93-4.86 58.5-.5l-5.72 16.406 207.688 72.626L492.47 123 299.624 55.562l5.906-17.374c-16.29-5.517-32.75-8.322-49.217-8.344zm-.657 49.593L46.25 152.844l42.406 29.53c70.69-11.9 160.54 31.24 166.906-90.25 2.175 32.524 10.254 53.188 22.282 66.282 6.658 7.576 14.5 12.432 23.687 15.688.04.015.086.016.126.03.216.077.44.145.656.22 33.978 12.23 80.744 1.187 121.344 8.03l41.406-29.155-209.406-73.782zm.47 81.032c-.263.413-.516.842-.782 1.25-12.194 18.6-29.79 28.466-48.656 33.03-3.486.843-7.013 1.528-10.594 2.094l41.437 74.094-67.25 16.78 31.345 61.594-61.813-54L283.938 496.75l-61.875-143.625 52.438 69.5L235.03 320l58.5-10.094-17.092-52.75 93.468 141.28-81.47-196.748 56.845 83.406L323 197.75c-5.9-.68-11.71-1.63-17.375-3-18.865-4.564-36.494-14.43-48.688-33.03-.27-.413-.548-.832-.812-1.25z"/></svg>
\ No newline at end of file |
