mirror of
https://github.com/dillonzq/LoveIt.git
synced 2025-04-12 00:37:37 +02:00
feat(comment): support waline comment (#962)
This commit is contained in:
parent
8a7f9e2672
commit
a1eae5c86d
30 changed files with 100 additions and 0 deletions
|
@ -52,3 +52,6 @@ libFiles:
|
|||
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent
|
||||
cookieconsentCSS: cookieconsent/3.1.1/cookieconsent.min.css
|
||||
cookieconsentJS: cookieconsent/3.1.1/cookieconsent.min.js
|
||||
# waline@2.6.1 https://waline.js.org/
|
||||
walineCSS: waline/2.6.1/waline.css
|
||||
walineJS: waline/2.6.1/waline.js
|
||||
|
|
|
@ -56,3 +56,6 @@ libFiles:
|
|||
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent
|
||||
cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css
|
||||
cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js
|
||||
# waline@2.6.1 https://waline.js.org/
|
||||
walineCSS: '@waline/client@2.6.1/dist/waline.css'
|
||||
walineJS: '@waline/client@2.6.1/dist/waline.min.js'
|
||||
|
|
|
@ -765,6 +765,7 @@ var Theme = /*#__PURE__*/function () {
|
|||
};
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
}
|
||||
if (this.config.comment.waline) Waline.init(this.config.comment.waline);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
|
|
|
@ -26,3 +26,4 @@
|
|||
| [Twemoji](https://github.com/twitter/twemoji) | twemoji | 14.0.2 |
|
||||
| [TypeIt](https://github.com/alexmacarthur/typeit) | typeit | 8.6.0 |
|
||||
| [Valine](https://github.com/xCss/Valine) | valine | 1.5.3 |
|
||||
| [Waline](https://github.com/walinejs/waline) | waline | 2.6.1 |
|
||||
|
|
1
assets/lib/waline/waline.css
Normal file
1
assets/lib/waline/waline.css
Normal file
File diff suppressed because one or more lines are too long
1
assets/lib/waline/waline.js
Normal file
1
assets/lib/waline/waline.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -598,6 +598,15 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
|
|||
lazyLoading = false
|
||||
lightTheme = "light"
|
||||
darkTheme = "dark"
|
||||
# Waline comment config (https://waline.js.org/)
|
||||
# Waline 评论系统设置 (https://waline.js.org/)
|
||||
[params.page.comment.waline]
|
||||
enable = false
|
||||
serverURL = "https://love-it-waline.vercel.app"
|
||||
# automatically adapt the current theme i18n configuration when empty
|
||||
# 为空时自动适配当前主题 i18n 配置
|
||||
lang = ""
|
||||
emoji = ["https://unpkg.com/@waline/emojis@1.0.1/tw-emoji"]
|
||||
# Third-party library config
|
||||
# 第三方库配置
|
||||
[params.page.library]
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "ar_AR"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "ca_ES"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "de_DE"
|
|||
|
||||
[giscusLang]
|
||||
other = "de"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -61,6 +61,9 @@ other = "en_US"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "es_MX"
|
|||
|
||||
[giscusLang]
|
||||
other = "es"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "fr"
|
|||
|
||||
[giscusLang]
|
||||
other = "fr"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "hi_IN"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "id_ID"
|
|||
|
||||
[giscusLang]
|
||||
other = "id"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "it"
|
|||
|
||||
[giscusLang]
|
||||
other = "it"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "ko-KR"
|
|||
|
||||
[giscusLang]
|
||||
other = "ko"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "pl"
|
|||
|
||||
[giscusLang]
|
||||
other = "pl"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "pt_BR"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "pt-BR"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "ro_RO"
|
|||
|
||||
[giscusLang]
|
||||
other = "ro"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "ru_RU"
|
|||
|
||||
[giscusLang]
|
||||
other = "ru"
|
||||
|
||||
[walineLang]
|
||||
other = "ru-RU"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "sr_RS"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -63,6 +63,9 @@ other = "te_IN"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "th_TH"
|
|||
|
||||
[giscusLang]
|
||||
other = "en"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "tr_TR"
|
|||
|
||||
[giscusLang]
|
||||
other = "tr"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "vi"
|
|||
|
||||
[giscusLang]
|
||||
other = "vi"
|
||||
|
||||
[walineLang]
|
||||
other = "en"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -62,6 +62,9 @@ other = "zh_CN"
|
|||
|
||||
[giscusLang]
|
||||
other = "zh-CN"
|
||||
|
||||
[walineLang]
|
||||
other = "zh-CN"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -59,6 +59,9 @@ other = "你的評論 ..."
|
|||
|
||||
[facebookLanguageCode]
|
||||
other = "zh_TW"
|
||||
|
||||
[walineLang]
|
||||
other = "zh-TW"
|
||||
# === partials/comment.html ===
|
||||
|
||||
# === partials/assets.html ===
|
||||
|
|
|
@ -146,6 +146,23 @@
|
|||
Please enable JavaScript to view the comments powered by <a href="https://giscus.app">Giscus</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Waline Comment System */ -}}
|
||||
{{- $waline := $comment.waline | default dict -}}
|
||||
{{- if $waline.enable -}}
|
||||
<div id="waline" class="comment"></div>
|
||||
{{- $source := $cdn.walineCSS | default "lib/waline/waline.css" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $source := $cdn.walineJS | default "lib/waline/waline.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $commentConfig = dict "el" "#waline" "serverURL" $waline.serverURL "lang" ($waline.lang | default (T "walineLang")) | dict "waline" | merge $commentConfig -}}
|
||||
{{- with $waline.emoji -}}
|
||||
{{- $commentConfig = dict "emoji" . | dict "waline" | merge $commentConfig -}}
|
||||
{{- end -}}
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by <a href="https://waline.js.org/">Waline</a>.
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -648,6 +648,7 @@ class Theme {
|
|||
});
|
||||
this.switchThemeEventSet.add(this._giscusOnSwitchTheme);
|
||||
}
|
||||
if (this.config.comment.waline) Waline.init(this.config.comment.waline);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue