fixed 自定义配置一言头像

This commit is contained in:
Vaica committed 2026-01-30 19:52:13 +08:00
1 parent 4771f8f163
commit ec6f05539e
3 files changed
+5 -2

No files matched your search

+2
View File
@@ -129,6 +129,8 @@ hasCJKLanguage = true
enable = true enable = true
enableHitokoto = true enableHitokoto = true
hitokotoUrl = "https://v1.hitokoto.cn?c=a&c=b&c=c&c=d&c=i" hitokotoUrl = "https://v1.hitokoto.cn?c=a&c=b&c=c&c=d&c=i"
# 一言弹幕头像,留空则默认使用博客头像
hitokotoAvatar = ""
+1 -1
View File
@@ -396,7 +396,7 @@
barrageList.push({ barrageList.push({
id: h.id, id: h.id,
text: `${h.content}`, text: `${h.content}`,
avatar: 'https://cravatar.cn/avatar/default?d=mp', avatar: config.hitokotoAvatar || 'https://cravatar.cn/avatar/default?d=mp',
url: '#' url: '#'
}); });
} }
+2 -1
View File
@@ -2,7 +2,8 @@
<script> <script>
window.barrageConfig = { window.barrageConfig = {
enableHitokoto: {{ .Site.Params.barrage.enableHitokoto | default false }}, enableHitokoto: {{ .Site.Params.barrage.enableHitokoto | default false }},
hitokotoUrl: "{{ .Site.Params.barrage.hitokotoUrl | default "https://v1.hitokoto.cn" }}" hitokotoUrl: "{{ .Site.Params.barrage.hitokotoUrl | default "https://v1.hitokoto.cn" }}",
hitokotoAvatar: "{{ .Site.Params.barrage.hitokotoAvatar | default .Site.Params.author.avatar }}"
}; };
</script> </script>
<div class="barrager"></div> <div class="barrager"></div>