summaryrefslogtreecommitdiffstats
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authoryingyu5658 <i@yingyu5658.me>2025-12-14 11:38:31 +0800
committeryingyu5658 <i@yingyu5658.me>2025-12-14 11:38:31 +0800
commitb3ebd8526dc1e7b0d7d5420b38f7dc43f185a979 (patch)
treeb27a8a48662a8a22dde59605235359924f842604 /layouts/shortcodes
parent259f5ac57a14569e24682f905c917a2c017ef283 (diff)
downloadblog-b3ebd8526dc1e7b0d7d5420b38f7dc43f185a979.tar.gz
blog-b3ebd8526dc1e7b0d7d5420b38f7dc43f185a979.zip
docs: post weekly
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/music.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/layouts/shortcodes/music.html b/layouts/shortcodes/music.html
new file mode 100644
index 0000000..583b0b0
--- /dev/null
+++ b/layouts/shortcodes/music.html
@@ -0,0 +1,37 @@
+<!-- 这里的代码来自 https://github.com/BigCoke233/geek-death-project/blob/master/layouts/_shortcodes/music.html -->
+<!-- 为了适配需求,我做了部分修改 -->
+<div class="music-card">
+ <!-- Cover, title, artist -->
+ <div class="music-info">
+ <img class="music-cover"
+ src="{{ .Get "cover" }}" loading="lazy" alt="Cover" />
+ <div class="music-text">
+ <h4 class="music-title">{{ .Get "title" }}</h4>
+ <p class="music-artist">{{ .Get "artist" }}</p>
+ </div>
+ </div>
+
+ <!-- Links -->
+ <div class="music-links">
+ {{ with .Get "apple" }}
+ <a href="{{ . }}" class="music-btn" target="_blank" title="在 Apple Music 中打开" data-tooltip>
+ <img src="/images/apple-music.png" loading="lazy" class="music-icon" alt="Apple Music" />
+ <span class="music-btn-text">Apple Music</span>
+ </a>
+ {{ end }}
+
+ {{ with .Get "netease" }}
+ <a href="{{ . }}" class="music-btn" target="_blank" title="在网易云音乐中打开" data-tooltip>
+ <img src="/images/netease-music.png" loading="lazy" class="music-icon" alt="Netease Music" />
+ <span class="music-btn-text">网易云</span>
+ </a>
+ {{ end }}
+
+ {{ with .Get "spotify" }}
+ <a href="{{ . }}" class="music-btn" target="_blank" title="在 Spotify 中打开" data-tooltip>
+ <img src="/images/spotify.png" loading="lazy" class="music-icon" alt="Spotify" />
+ <span class="music-btn-text">Spotify</span>
+ </a>
+ {{ end }}
+ </div>
+</div>