From 809a0fd4b36e51124ce66fa83565ddcf8c899de3 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Wed, 18 Dec 2024 20:58:42 +0800 Subject: [PATCH] :bug: Fix(ignore): PostChat and PostSummary config merge error --- layouts/partials/plugin/post-chat-ai.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/layouts/partials/plugin/post-chat-ai.html b/layouts/partials/plugin/post-chat-ai.html index 9e4b6ef3..47ee4415 100644 --- a/layouts/partials/plugin/post-chat-ai.html +++ b/layouts/partials/plugin/post-chat-ai.html @@ -3,10 +3,17 @@ PostChat: https://postchat.zhheo.com/addCode.html PostSummary: https://postchat.zhheo.com/summary.html TODO dark/light mode switch + TODO 表格的序号排除摘要 */ -}} {{- $params := partial "function/params.html" -}} -{{- $chatConfig := .Param "postChat" -}} -{{- $summaryConfig := .Param "postSummary" -}} +{{- $chatConfig := .Site.Params.postChat -}} +{{- $summaryConfig := .Site.Params.postSummary -}} +{{- with .Params.postChat -}} + {{- $chatConfig = . | merge .Site.Params.postChat -}} +{{- end -}} +{{- with .Params.postSummary -}} + {{- $summaryConfig = . | merge .Site.Params.postSummary -}} +{{- end -}} {{- $key := $chatConfig.key | default $summaryConfig.key -}} {{- $sourcePrefix := "https://ai.tianli0.top/static/public/" -}} {{- $jsMap := dict @@ -65,8 +72,8 @@ {{- $blackDom := slice ".expiration-reminder" "meting-js" + ".lnt" -}} - {{/* 合并 $blackDom 和 $chatConfig.blackDom */}} {{- with $chatConfig.blackDom -}} {{- $blackDom = $blackDom | append . -}} {{- end -}} @@ -79,7 +86,7 @@ "height" $chatConfig.height "fill" $chatConfig.fill "backgroundColor" $chatConfig.backgroundColor - "upLoadWeb" $chatConfig.upLoadWeb + "upLoadWeb" (cond .IsHome false $chatConfig.upLoadWeb) "showInviteLink" $chatConfig.showInviteLink "userTitle" $chatConfig.userTitle "userDesc" $chatConfig.userDesc