diff options
| author | eltrac <hi@eltr.ac> | 2026-03-23 15:13:24 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-23 15:13:24 +0800 |
| commit | bd9964b53d69da792fbfba129b6dea0ad37a071d (patch) | |
| tree | e398af0d1b40283c917737136e9a70df3adaadcf /layouts/_shortcodes | |
| parent | f14c48001b23feadabb8e4d4e5cff74f43fe9d9f (diff) | |
feat(shortcode/music): add special style to albums
Diffstat (limited to 'layouts/_shortcodes')
| -rw-r--r-- | layouts/_shortcodes/music.html | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/layouts/_shortcodes/music.html b/layouts/_shortcodes/music.html index 31ec45e8..feeb87fb 100644 --- a/layouts/_shortcodes/music.html +++ b/layouts/_shortcodes/music.html @@ -1,17 +1,31 @@ {{ $title := .Get "title" }} {{ $cover := .Get "cover" }} {{ $artist := .Get "artist" }} +{{ $isAlbum := .Get "album" }} + {{ $platforms := slice "bandcamp" "apple" "spotify" "netease" }} {{ $page := . }} <div class="flex flex-col md:flex-row md:justify-between md:items-center gap-2"> <!-- Cover, title, artist --> <div class="flex gap-5 items-center"> - <img class="w-15 h-15 rounded-lg shadow-lg m-0!" - alt="{{ $title }} music cover" - src="{{ $cover }}" loading="lazy" /> + <div class="relative"> + <img class="w-15 h-15 rd-lg shadow-lg m-0!" + alt="{{ $title }} music cover" + src="{{ $cover }}" loading="lazy" /> + {{ if $isAlbum }} + <div class="w-13 h-13 rd-md bg-neutral-400 dark:bg-neutral-600 absolute top-1 left-3 -z-1"></div> + {{ end }} + </div> <div> - <h4 class="m-0 text-size-base">{{ $title }}</h4> + <h4 class="m-0 text-size-base flex items-center gap-2"> + <span>{{ $title }}</span> + {{ if $isAlbum }} + <span class="font-mono bg-neutral-400 dark:bg-neutral-700 text-white + px-1 rd text-xs leading-relaxed hidden sm:inline-block" + >{{ T "music.album" }}</span> + {{ end }} + </h4> <p class="m-0 text-size-sm text-secondary">{{ $artist }}</p> </div> </div> |
