Skip to content

Commit

Permalink
⚡ Perf: add embed blockDoms for PostChat only
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Dec 18, 2024
1 parent 5931bf3 commit 1d09297
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/single/expiration-reminder.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{- $type = "warning" -}}
{{- $icon = "fa-exclamation-triangle" -}}
{{- end -}}
<div class="details admonition {{ $type }} open">
<div class="expiration-reminder details admonition {{ $type }} open">
<div class="details-summary admonition-title">
<i class="icon fa-solid {{ $icon }} fa-fw" aria-hidden="true"></i>{{ T (printf "admonition.%v" $type) }}<i class="details-icon fa-solid fa-angle-right fa-fw" aria-hidden="true"></i>
</div>
Expand Down
10 changes: 9 additions & 1 deletion layouts/partials/single/post-chat-ai.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
{{- /* PostChat */ -}}
{{- if $chatConfig.enable -}}
{{- $sourceOpts = dict "Attr" (printf "data-postChat_key=%q" $key) | merge $sourceOpts -}}
{{- $blackDom := slice
".expiration-reminder"
"meting-js"
-}}
{{/* 合并 $blackDom 和 $chatConfig.blackDom */}}
{{- with $chatConfig.blackDom -}}
{{- $blackDom = $blackDom | append . -}}
{{- end -}}
{{- $postChatConfig := dict
"userMode" $chatConfig.userMode
"defaultInput" $chatConfig.defaultInput
Expand All @@ -71,7 +79,7 @@
"userTitle" $chatConfig.userTitle
"userDesc" $chatConfig.userDesc
"addButton" $chatConfig.addButton
"blackDom" $chatConfig.blackDom
"blackDom" $blackDom
"frameWidth" $chatConfig.frameWidth
"frameHeight" $chatConfig.frameHeight
"userIcon" $chatConfig.userIcon
Expand Down

0 comments on commit 1d09297

Please sign in to comment.