Files
halo-theme-WarmIsland/src/components/FriendsSection.astro
T
nxxy335 dda86294b0 fix: 按 Halo 应用市场审核意见整改外部资源与隐私(v1.2.5 修订)
- 默认零第三方自动请求:移除 21 个模板的 preconnect/dns-prefetch、PrismJS+autoloader、qrcode-generator 及内置一言/IP 定位 API
- 一言与代码高亮配色改为自托管;欢迎弹窗自定义 IP 接口改为 opt-in;微信分享改为复制链接;LightGallery 按 GPLv3 使用
- README 新增「外部资源与隐私」「验证与回归测试」章节,修正无效链接并补充字体 OFL 来源;同步 docs 与修正虚构的目录树
- friends 等 12 处 #strings.substring 加空值保护;logo 由两份 1.5MB 压缩去重为单份 146KB
- 新增 pnpm audit:external 与打包前置合规审计;制品补齐 34 个 docs 文档与预览图
2026-11-11 14:37:09 +08:00

128 lines
3.2 KiB
Plaintext

---
---
<section
class="wi-section wi-friends"
th:if="${theme.config?.home?.home_friends_enabled == true and pluginFinder.available('PluginLinks')}"
>
<div class="wi-container">
<div class="wi-section__header">
<h2 class="wi-section__title" th:text="${theme.config?.home?.home_friends_title ?: '友链'}">友链</h2>
<span class="wi-section__accent"></span>
</div>
<div class="wi-friends__grid">
<a
th:each="link : ${linkFinder.list()}"
th:href="${link.spec.url}"
th:title="${link.spec.displayName}"
target="_blank"
rel="noopener noreferrer"
class="wi-friends__card"
>
<img
th:if="${link.spec.logo}"
th:src="${link.spec.logo}"
th:alt="${link.spec.displayName}"
class="wi-friends__avatar"
/>
<div
th:unless="${link.spec.logo}"
class="wi-friends__avatar wi-friends__avatar--placeholder"
>
<span th:text="${!#strings.isEmpty(link.spec.displayName) ? #strings.substring(link.spec.displayName, 0, 1) : '·'}"></span>
</div>
<div class="wi-friends__info">
<span class="wi-friends__name" th:text="${link.spec.displayName}"></span>
<span
class="wi-friends__desc"
th:if="${link.spec.description}"
th:text="${link.spec.description}"
></span>
</div>
</a>
</div>
</div>
</section>
<style>
.wi-friends__grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: var(--space-lg);
}
.wi-friends__card {
display: flex;
align-items: center;
gap: var(--space-md);
padding: var(--space-lg);
background: var(--glass-bg);
border: 1px solid var(--glass-border);
border-radius: 12px;
text-decoration: none;
color: inherit;
transition:
transform var(--duration-normal) var(--ease-out-expo),
box-shadow var(--duration-normal) var(--ease-out-expo),
border-color var(--duration-normal) var(--ease-out-expo);
}
.wi-friends__card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg);
border-color: var(--accent);
color: inherit;
}
.wi-friends__avatar {
width: 48px;
height: 48px;
border-radius: 9999px;
object-fit: cover;
flex-shrink: 0;
}
.wi-friends__avatar--placeholder {
display: flex;
align-items: center;
justify-content: center;
background: var(--accent-bg);
color: var(--accent);
font-family: var(--font-sans);
font-size: var(--text-lg);
font-weight: 700;
}
.wi-friends__info {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.wi-friends__name {
font-size: var(--text-md);
font-weight: 600;
color: var(--ink);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.wi-friends__desc {
font-size: var(--text-sm);
color: var(--ink-3);
line-height: var(--leading-snug);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@media (max-width: 640px) {
.wi-friends__grid {
grid-template-columns: 1fr;
gap: var(--space-md);
}
}
</style>