aboutsummaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authoryingyu5658 <i@yingyu5658.me>2026-01-02 11:47:26 +0800
committeryingyu5658 <i@yingyu5658.me>2026-01-02 11:47:26 +0800
commit9009b6b53321a52e63336ecd43c0ba2dd76af97a (patch)
tree6a9ac4c1861fdc1c6f4941465de2b6e86babc2d1 /layouts
parentd1a6cf3fb7016586718ad37d6bb5b74335f0818b (diff)
downloadblog-9009b6b53321a52e63336ecd43c0ba2dd76af97a.tar.gz
blog-9009b6b53321a52e63336ecd43c0ba2dd76af97a.zip
feat: add booklist shortcode
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/style.html23
-rw-r--r--layouts/shortcodes/book.html10
2 files changed, 33 insertions, 0 deletions
diff --git a/layouts/partials/style.html b/layouts/partials/style.html
index 0576b88..8685d39 100644
--- a/layouts/partials/style.html
+++ b/layouts/partials/style.html
@@ -29,6 +29,29 @@
0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
+ .booklist {
+ display: grid;
+ grid-template-columns: repeat(5, 1fr);
+ gap: 20px;
+ }
+
+ .booklist-item {
+ transform: translateZ(0);
+ transition:
+ transform 0.25s,
+ box-shadow 0.25s;
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+ }
+
+ .booklist-item img {
+ height: 100%;
+ }
+
+ .booklist-item:hover {
+ transform: translateY(-5px) translateZ(20px);
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
+ }
+
.social-icons {
display: inline;
font-size: 16px;
diff --git a/layouts/shortcodes/book.html b/layouts/shortcodes/book.html
new file mode 100644
index 0000000..072669b
--- /dev/null
+++ b/layouts/shortcodes/book.html
@@ -0,0 +1,10 @@
+
+<div class="booklist-item">
+ {{ if .Get "url" }}
+ <a href="{{ .Get "url" }}">
+ <img class="book-cover" src="{{ .Get "cover" }}" alt="图书封面" />
+ </a>
+ {{ else }}
+ <img class="book-cover" src="{{ .Get "cover" }}" alt="图书封面" />
+ {{ end }}
+</div>