mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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" . -}}
|
||||
|
||||
@@ -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 `<svg ` `<svg class="icon" ` | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- errorf "Icon does not exist %v" $src -}}
|
||||
{{- end -}}
|
||||
{{- $resource := $resource.Content -}}
|
||||
{{- $resource | replaceRE `<svg ` `<svg class="icon" ` | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- /* fetch svg icon from external source */ -}}
|
||||
<i data-svg-src="{{ $src }}" aria-hidden="true"></i>
|
||||
|
||||
Reference in New Issue
Block a user