From 9207dc6c57f99a42b522eb86bd2f0bcbb1a7bb7a Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 24 Apr 2025 16:51:48 +0800 Subject: feat: display book reviews on index page --- assets/css/components/_postlist.scss | 3 ++- hugo.yaml | 1 + layouts/index.html | 14 +++++++++++--- static/img/book-storm.svg | 2 ++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 static/img/book-storm.svg 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; diff --git a/hugo.yaml b/hugo.yaml index 2c720960..0803c7b8 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -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 @@ {{ .Title }} + > + {{ if eq .Section "library" }} + 读《{{ .Title }}》 + {{ else }} + {{ .Title }} + {{ end }} + {{ if eq .Section "fictions" }} 小说 {{ end }} @@ -43,9 +49,11 @@ {{ $firstPost = false }} {{ end }} - {{ if eq .Section "fictions" }} + {{ if or (eq .Section "fictions") (eq .Section "library") }}
- +
{{ end }} 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 @@ + + \ No newline at end of file -- cgit v1.2.3