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": {