fix: 修复Hugo版本兼容性问题
This commit is contained in:
1 parent
5a00965c1a
commit
36f6622775
2 files changed
+10
-13
No files matched your search
@@ -8,7 +8,6 @@
|
|||||||
- 名称:{{ .Site.Params.message_info.name | default .Site.Params.artalk.site }}<br>
|
- 名称:{{ .Site.Params.message_info.name | default .Site.Params.artalk.site }}<br>
|
||||||
- 简介:{{ .Site.Params.message_info.description | default .Site.Params.author.description }}<br>
|
- 简介:{{ .Site.Params.message_info.description | default .Site.Params.author.description }}<br>
|
||||||
- 链接:{{ .Site.Params.message_info.url | default .Site.BaseURL }}<br>
|
- 链接:{{ .Site.Params.message_info.url | default .Site.BaseURL }}<br>
|
||||||
- 订阅:{{ "rss.xml" | absURL }}<br>
|
|
||||||
- 图标:{{ .Site.Params.message_info.icon | default .Site.Params.author.avatar }}
|
- 图标:{{ .Site.Params.message_info.icon | default .Site.Params.author.avatar }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -78,11 +78,11 @@
|
|||||||
{{/* Fetch friend data at build time — no runtime network requests */}}
|
{{/* Fetch friend data at build time — no runtime network requests */}}
|
||||||
{{ $linkHosts := slice }}
|
{{ $linkHosts := slice }}
|
||||||
{{ $linkNames := slice }}
|
{{ $linkNames := slice }}
|
||||||
{{ with resources.GetRemote "https://api.usj.cc/api/links?all=1" }}
|
{{ $linksResult := try (resources.GetRemote "https://api.usj.cc/api/links?all=1") }}
|
||||||
{{ with .Err }}
|
{{ if $linksResult.Err }}
|
||||||
{{ warnf "Links API fetch failed: %s" . }}
|
{{ warnf "Links API fetch failed: %s" $linksResult.Err }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Content | transform.Unmarshal }}
|
{{ with $linksResult.Value | transform.Unmarshal }}
|
||||||
{{ range .links }}
|
{{ range .links }}
|
||||||
{{ $host := "" }}
|
{{ $host := "" }}
|
||||||
{{ with .url | urls.Parse }}
|
{{ with .url | urls.Parse }}
|
||||||
@@ -97,7 +97,6 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script>
|
<script>
|
||||||
window.friendLinks = {{ dict "hosts" $linkHosts "names" $linkNames | jsonify | safeJS }};
|
window.friendLinks = {{ dict "hosts" $linkHosts "names" $linkNames | jsonify | safeJS }};
|
||||||
@@ -105,11 +104,11 @@
|
|||||||
|
|
||||||
{{ $feedHosts := slice }}
|
{{ $feedHosts := slice }}
|
||||||
{{ $feedNames := slice }}
|
{{ $feedNames := slice }}
|
||||||
{{ with resources.GetRemote "https://api.usj.cc/api/feeds" }}
|
{{ $feedsResult := try (resources.GetRemote "https://api.usj.cc/api/feeds") }}
|
||||||
{{ with .Err }}
|
{{ if $feedsResult.Err }}
|
||||||
{{ warnf "Feeds API fetch failed: %s" . }}
|
{{ warnf "Feeds API fetch failed: %s" $feedsResult.Err }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Content | transform.Unmarshal }}
|
{{ with $feedsResult.Value | transform.Unmarshal }}
|
||||||
{{ range .feeds }}
|
{{ range .feeds }}
|
||||||
{{ $host := "" }}
|
{{ $host := "" }}
|
||||||
{{ with .url | urls.Parse }}
|
{{ with .url | urls.Parse }}
|
||||||
@@ -124,7 +123,6 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<script>
|
<script>
|
||||||
window.friendFeeds = {{ dict "hosts" $feedHosts "names" $feedNames | jsonify | safeJS }};
|
window.friendFeeds = {{ dict "hosts" $feedHosts "names" $feedNames | jsonify | safeJS }};
|
||||||
|
|||||||
Reference in new issue
Block a user