mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
fix: 當標題有符號'時,disqus 和 disqusjs 無法加載的 bug
This commit is contained in:
parent
6057297f44
commit
531269c60e
@ -1,9 +1,11 @@
|
|||||||
|
- let disqusPageTitle = page.title.replace(/'/ig,"\\'")
|
||||||
|
|
||||||
script.
|
script.
|
||||||
function loadDisqus () {
|
function loadDisqus () {
|
||||||
var disqus_config = function () {
|
var disqus_config = function () {
|
||||||
this.page.url = '!{ page.permalink }'
|
this.page.url = '!{ page.permalink }'
|
||||||
this.page.identifier = '!{ page.path }'
|
this.page.identifier = '!{ page.path }'
|
||||||
this.page.title = '!{ page.title }'
|
this.page.title = '!{ disqusPageTitle }'
|
||||||
};
|
};
|
||||||
|
|
||||||
window.disqusReset = () => {
|
window.disqusReset = () => {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
- let disqusjsApi = theme.disqusjs.api || 'https://disqus.skk.moe/disqus/'
|
- let disqusjsApi = theme.disqusjs.api || 'https://disqus.skk.moe/disqus/'
|
||||||
|
- let disqusjsPageTitle = page.title.replace(/'/ig,"\\'")
|
||||||
|
|
||||||
script.
|
script.
|
||||||
function loadDisqusjs () {
|
function loadDisqusjs () {
|
||||||
function addDisqusjsCSS () {
|
function addDisqusjsCSS () {
|
||||||
@ -15,7 +17,7 @@ script.
|
|||||||
siteName: '!{theme.disqusjs.siteName}',
|
siteName: '!{theme.disqusjs.siteName}',
|
||||||
identifier: '!{ page.path }',
|
identifier: '!{ page.path }',
|
||||||
url: '!{ page.permalink }',
|
url: '!{ page.permalink }',
|
||||||
title: '!{ page.title }',
|
title: '!{ disqusjsPageTitle }',
|
||||||
api: '!{disqusjsApi}',
|
api: '!{disqusjsApi}',
|
||||||
apikey: '!{theme.disqusjs.apikey}',
|
apikey: '!{theme.disqusjs.apikey}',
|
||||||
nocomment: '!{theme.disqusjs.nocomment}',
|
nocomment: '!{theme.disqusjs.nocomment}',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "3.7.5-b1",
|
"version": "3.7.5-b2",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user