fix: 當標題有符號'時,disqus 和 disqusjs 無法加載的 bug

pull/559/head
Jerry 4 years ago
parent 6057297f44
commit 531269c60e

@ -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 = () => {

@ -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}',

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

Loading…
Cancel
Save