feat(icons): 添加favicon模式,自动匹配图标

- 新增配置 icons.mode(manual | favicon),默认 favicon,未配置场景下自动生效
- 模板调用 t3.gstatic.com/faviconV2 获取站点图标;加载中显示旋转占位,失败回退至 Font Awesome 图标
- 新增 ifHttpUrl 与 encodeURIComponent,提升模板安全性与可读性
- 搜索索引优先读取 .icon-fallback,保证 favicon 模式下图标类名一致
- 样式新增 .favicon-icon 与 hover 效果,维持卡片观感一致性
This commit is contained in:
coolzr
2025-10-18 22:32:05 +08:00
parent 95398e074a
commit aa264cc727
6 changed files with 109 additions and 14 deletions

View File

@@ -303,6 +303,10 @@ function ensureConfigDefaults(config) {
result.profile = result.profile || {};
result.social = result.social || [];
result.categories = result.categories || [];
// 图标配置默认值
result.icons = result.icons || {};
// icons.mode: manual | favicon, 默认 favicon
result.icons.mode = result.icons.mode || 'favicon';
// 站点基本信息默认值
result.site.title = result.site.title || 'MeNav导航';