Add support for comentario.

This commit is contained in:
HighDoping 2024-10-29 11:08:58 +08:00 committed by GitHub
parent 839fbd0ecb
commit 0b123a6b54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View file

@ -117,6 +117,18 @@ params:
host: host:
id: id:
# Comentario client configuration see: https://docs.comentario.app/en/configuration/embedding/comments-tag/
comentario:
url:
autoInit:
autoNonInteractiveSso:
cssOverride:
lang:
liveUpdate:
maxLevel:
noFonts:
theme:
widgets: widgets:
homepage: [] homepage: []
page: [] page: []

View file

@ -166,6 +166,19 @@ params:
cusdis: cusdis:
host: host:
id: id:
# Comentario client configuration see: https://docs.comentario.app/en/configuration/embedding/comments-tag/
comentario:
url:
autoInit:
autoNonInteractiveSso:
cssOverride:
lang:
liveUpdate:
maxLevel:
noFonts:
theme:
widgets: widgets:
homepage: homepage:
- type: search - type: search

View file

@ -0,0 +1,13 @@
<script defer src="{{ .Site.Params.comments.comentario.url }}/comentario.js"></script>
<comentario-comments auto-init="{{ .Site.Params.comments.comentario.autoInit }}"
auto-non-interactive-sso="{{ .Site.Params.comments.comentario.autoNonInteractiveSSO }}"
css-override="{{ .Site.Params.comments.comentario.cssOverride }}" lang="{{ .Site.Params.comments.comentario.lang }}"
live-update="{{ .Site.Params.comments.comentario.liveUpdate }}"
max-level="{{ .Site.Params.comments.comentario.maxLevel }}"
no-fonts="{{ .Site.Params.comments.comentario.noFonts }}"
theme="{{.Site.Params.comments.comentario.theme}}"></comentario-comments>
<script>
window.addEventListener('onColorSchemeChange', (e) => {
document.querySelector('comentario-comments').setAttribute('theme', e.detail);
})
</script>