💥 支持雙評論系統配置/評論配置整理

 增加mac light 代碼框
 增加文章過期提醒配置
 文章copyright 可單獨配置
 card-category 中category名稱和數字限制一行顯示
 簡繁轉換優化,placeholder文字也會被轉換
🐛 修復配置PWA參數時,如果網站是子目錄時,會出現加載不到文件的bugs
調整當card-category有收縮按鈕時的顯示佈局
This commit is contained in:
Jerry
2020-06-25 23:13:55 +08:00
parent 67b49c01ba
commit 4d34208391
47 changed files with 1098 additions and 817 deletions

View File

@@ -1,15 +1,30 @@
script#utterances_comment(src=theme.CDN.utterances
repo=theme.utterances.repo
issue-term=theme.utterances.issue_term
theme= theme.display_mode === 'dark' ? theme.utterances.dark_theme : theme.utterances.light_theme
crossorigin="anonymous"
async)
#utterances-wrap
script.
function loadUtterances () {
let ele = document.createElement('script')
ele.setAttribute('id', 'utterances_comment')
ele.setAttribute('src', '!{url_for(theme.CDN.utterances)}')
ele.setAttribute('repo', '!{theme.utterances.repo}')
ele.setAttribute('issue-term', '!{theme.utterances.issue_term}')
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
ele.setAttribute('theme', nowTheme)
ele.setAttribute('crossorigin', 'anonymous')
ele.setAttribute('async', 'true')
document.getElementById('utterances-wrap').insertAdjacentElement('afterbegin',ele)
}
if ('!{defaultComment}' === 'Utterances' || !{theme.comments.load_begin}) {
window.addEventListener('load', loadUtterances)
}
else {
function loadOtherComment () {
loadUtterances()
}
}
if theme.darkmode.enable
script.
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
document.getElementById('utterances_comment').setAttribute('theme',themeNow)
function utterancesTheme () {
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
const message = {