From b5419ef704d4ea4903185adbc82d1a765ae2a202 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 10 Jul 2026 21:12:56 +0800 Subject: [PATCH] fix(assets): fix nil pointer in icon.html and correct QQ icon names Use `with` block to guard against nil resource in icon.html, preventing panic when `resources.Get` fails. Correct simple-icons names from `tencentqq` to `qq` for QQ and QQ Group social links. --- assets/data/social.yml | 4 ++-- layouts/_partials/init/index.html | 2 +- layouts/_partials/plugin/icon.html | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/data/social.yml b/assets/data/social.yml index 9b7ac665..bba5638d 100644 --- a/assets/data/social.yml +++ b/assets/data/social.yml @@ -539,7 +539,7 @@ qq: Template: https://wpa.qq.com/msgrd?v=3&uin=%v&site=qq&menu=yes Title: QQ Icon: - Simpleicons: tencentqq + Simpleicons: qq # 069: QQ Group qqgroup: @@ -547,7 +547,7 @@ qqgroup: Prefix: https://qm.qq.com/q/ Title: QQ Group Icon: - Simpleicons: tencentqq + Simpleicons: qq # 070: Diaspora diaspora: diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 3f5c5c23..2428768d 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v1.0.0-mrevbfi8" -}} +{{- hugo.Store.Set "version" "v1.0.0-mreyhf6g" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/_partials/plugin/icon.html b/layouts/_partials/plugin/icon.html index cb5c7d5f..33739bcd 100644 --- a/layouts/_partials/plugin/icon.html +++ b/layouts/_partials/plugin/icon.html @@ -23,12 +23,12 @@ {{- end -}} {{- if (urls.Parse $src).Host | not -}} - {{- $resource := resources.Get $src | minify -}} - {{ if not $resource }} + {{- with resources.Get $src -}} + {{- $resource := . | resources.Minify -}} + {{- $resource.Content | replaceRE `