summaryrefslogtreecommitdiff
path: root/layouts/_shortcodes/link.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-15 14:17:39 +0800
committerEltrac <hi@guhub.cn>2025-07-15 14:17:39 +0800
commit272a67d7a8b8752dda3cddf44482e9d85de2c4d0 (patch)
treeade1f3a2b479a5737d87268a5c279b6caee7ae67 /layouts/_shortcodes/link.html
parentc831c88a8622c743799195074777c4ca3f5408f9 (diff)
refactor: replace _footer.scss and _shortcode.scss with UnoCSS
Diffstat (limited to 'layouts/_shortcodes/link.html')
-rw-r--r--layouts/_shortcodes/link.html27
1 files changed, 14 insertions, 13 deletions
diff --git a/layouts/_shortcodes/link.html b/layouts/_shortcodes/link.html
index 1b9c4f79..abd1b1aa 100644
--- a/layouts/_shortcodes/link.html
+++ b/layouts/_shortcodes/link.html
@@ -1,14 +1,15 @@
-<a href="{{.Get "link" }}" target="_blank"
- class="{{ if (.Get "type") }}{{ .Get "type" }}-link{{ else }}blog-link{{ end }}">
- {{ if and (isset .Params "image") .Params.image }}
- <div class="link-image">
- <img src="{{ .Params.image }}" class="no-fancybox" alt="{{ .Params.title }}" />
- </div>
- {{ end }}
- {{ if ne (.Get "type") "podcast" }}
- <div class="link-content">
- <h4>{{.Get "title" }}</h4>
- <p>{{.Get "description" }}</p>
- </div>
- {{ end }}
+{{ if eq (.Get "type") "podcast" }}
+<a href="{{ .Get "link" }}" target="_blank" title="{{ .Get "title" }}"
+ class="block w-[calc(25%_-_1rem)] rounded-md overflow-hidden box-border p-0"
+ style="background-color: var(--block-background-color);
+ color: var(--text-color);text-decoration: none;">
+ <img src="{{ .Get "image" }}" class="block m-0!" alt="{{ .Get "title" }}">
</a>
+{{ else }}
+<a href="{{ .Get "link" }}" target="_blank"
+ class="block w-[calc(50%_-_1rem)] rounded-[1rem] box-border px-[1.5rem]"
+ style="background-color: var(--block-background-color);
+ color: var(--text-color);text-decoration: none;">
+ <h3>{{ .Get "title" }}</h3>
+</a>
+{{ end }}