From c68e872f0e5ab1d8f10f5d82af1c7ffcafa2412c Mon Sep 17 00:00:00 2001 From: pai233 Date: Wed, 11 May 2022 13:47:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=86Remark42=E7=9A=84=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E9=85=8D=E7=BD=AE=E5=BD=92=E5=85=A5option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 4 +--- layout/includes/third-party/comments/remark42.pug | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/_config.yml b/_config.yml index 9a785cc..773c7fa 100644 --- a/_config.yml +++ b/_config.yml @@ -360,9 +360,7 @@ remark42: host: # Your Host URL/你的Remark42的部署地址 siteId: remark # Your Site ID/你的站点ID language: en # https://remark42.com/docs/configuration/frontend/#locales - showEmailSubscription: true # Show Email Subscription/是否显示邮件订阅 - simpleView: false # Turn On the Simple View Mode/简单模式 - maxShownComments: 15 # The Max Shown Comments When the System loaded/默认加载时评论的显示数量 + option: # Chat Services # -------------------------------------- diff --git a/layout/includes/third-party/comments/remark42.pug b/layout/includes/third-party/comments/remark42.pug index e2c8b8c..378ee55 100644 --- a/layout/includes/third-party/comments/remark42.pug +++ b/layout/includes/third-party/comments/remark42.pug @@ -1,15 +1,12 @@ -- const { host, siteId, language } = theme.remark42 +- const { host, siteId, language, option } = theme.remark42 script. let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light' - var remark_config = { + var remark_config = Object.assign({ host: '!{host}', site_id: '!{siteId}', components: ['embed'], locale: '!{language}', - show_email_subscription: #{theme.remark42.showEmailSubscription}, - theme: nowTheme, - simple_view: #{theme.remark42.simpleView} - } + },!{JSON.stringify(option)}) script. function loadRemark42(){