From 531269c60ec2140fd59c4ee15c23c91d67a1213b Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 30 Mar 2021 01:36:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=95=B6=E6=A8=99=E9=A1=8C=E6=9C=89?= =?UTF-8?q?=E7=AC=A6=E8=99=9F'=E6=99=82=EF=BC=8Cdisqus=20=E5=92=8C=20disqu?= =?UTF-8?q?sjs=20=E7=84=A1=E6=B3=95=E5=8A=A0=E8=BC=89=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/includes/third-party/comments/disqus.pug | 4 +++- layout/includes/third-party/comments/disqusjs.pug | 4 +++- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/layout/includes/third-party/comments/disqus.pug b/layout/includes/third-party/comments/disqus.pug index fd44d2a..4c2c727 100644 --- a/layout/includes/third-party/comments/disqus.pug +++ b/layout/includes/third-party/comments/disqus.pug @@ -1,9 +1,11 @@ +- let disqusPageTitle = page.title.replace(/'/ig,"\\'") + script. function loadDisqus () { var disqus_config = function () { this.page.url = '!{ page.permalink }' this.page.identifier = '!{ page.path }' - this.page.title = '!{ page.title }' + this.page.title = '!{ disqusPageTitle }' }; window.disqusReset = () => { diff --git a/layout/includes/third-party/comments/disqusjs.pug b/layout/includes/third-party/comments/disqusjs.pug index 0e8d2f9..e88849a 100644 --- a/layout/includes/third-party/comments/disqusjs.pug +++ b/layout/includes/third-party/comments/disqusjs.pug @@ -1,4 +1,6 @@ - let disqusjsApi = theme.disqusjs.api || 'https://disqus.skk.moe/disqus/' +- let disqusjsPageTitle = page.title.replace(/'/ig,"\\'") + script. function loadDisqusjs () { function addDisqusjsCSS () { @@ -15,7 +17,7 @@ script. siteName: '!{theme.disqusjs.siteName}', identifier: '!{ page.path }', url: '!{ page.permalink }', - title: '!{ page.title }', + title: '!{ disqusjsPageTitle }', api: '!{disqusjsApi}', apikey: '!{theme.disqusjs.apikey}', nocomment: '!{theme.disqusjs.nocomment}', diff --git a/package.json b/package.json index cd743fa..58dc5d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.7.5-b1", + "version": "3.7.5-b2", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": {