From 3682a2a1d31d5ec8be2f7067ed21cfb0760d1ef7 Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Tue, 7 May 2024 17:06:01 +0800
Subject: [PATCH] :lipstick: Style: update card link image style
---
assets/css/_shortcodes/_cardlink.scss | 10 +++++++++-
layouts/partials/plugin/link.html | 10 +++++-----
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/assets/css/_shortcodes/_cardlink.scss b/assets/css/_shortcodes/_cardlink.scss
index 25287013..d3651ee9 100644
--- a/assets/css/_shortcodes/_cardlink.scss
+++ b/assets/css/_shortcodes/_cardlink.scss
@@ -76,7 +76,7 @@
white-space: nowrap;
}
- &icon-shortcut {
+ &shortcut-icon {
width: 4rem;
height: 4rem;
flex-shrink: 0;
@@ -91,6 +91,14 @@
}
}
+ &shortcut-image {
+ width: 4rem;
+ height: 4rem !important;
+ flex-shrink: 0;
+ margin-left: 0.25rem;
+ object-fit: cover;
+ }
+
[data-theme='dark'] & {
&content {
background-color: rgba(61, 62, 65, 0.88);
diff --git a/layouts/partials/plugin/link.html b/layouts/partials/plugin/link.html
index 86186ade..9f01deb9 100644
--- a/layouts/partials/plugin/link.html
+++ b/layouts/partials/plugin/link.html
@@ -44,7 +44,7 @@
{{- $cardIcon := .CardIcon -}}
{{- if $url.Host | and (eq .CardIcon true) -}}
{{- $cardIcon = false -}}
- {{- /* 中国大陆地区无法使用,如果你有更好的 API 或者方案,欢迎 PR! */ -}}
+ {{- /* 实验性功能:中国大陆地区无法使用,如果你有更好的 API 或者方案,欢迎 PR! */ -}}
{{- $favicon := partial "function/get-remote-image.html" (dict "Path" (add "https://www.google.com/s2/favicons?sz=64&domain=" $url.Host) "Pass" true) -}}
{{- with $favicon -}}
{{- $cardIcon = .RelPermalink -}}
@@ -72,16 +72,16 @@
{{- if .Download -}}
-
+
{{- else -}}
{{- with $cardIcon -}}
{{- if (strings.HasPrefix . "fa") -}}
-
+
{{- else -}}
-
+
{{- end -}}
{{- else -}}
-
+
{{- end -}}
{{- end -}}