mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
fix: 修復網站壓縮後,mermaid 會無法生成顯示的Bugs
feat: Valine 增加 option 設置
This commit is contained in:
@@ -317,6 +317,7 @@ valine:
|
|||||||
emojiCDN: # emoji CDN
|
emojiCDN: # emoji CDN
|
||||||
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
|
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
|
||||||
requiredFields: nick,mail # required fields (nick/mail)
|
requiredFields: nick,mail # required fields (nick/mail)
|
||||||
|
option:
|
||||||
|
|
||||||
# utterances
|
# utterances
|
||||||
# https://utteranc.es/
|
# https://utteranc.es/
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
- let option = theme.valine.option ? JSON.stringify(theme.valine.option) : false
|
||||||
- let emojiMaps = '""'
|
- let emojiMaps = '""'
|
||||||
if site.data.valine
|
if site.data.valine
|
||||||
- emojiMaps = JSON.stringify(site.data.valine)
|
- emojiMaps = JSON.stringify(site.data.valine)
|
||||||
@@ -5,7 +6,7 @@ if site.data.valine
|
|||||||
script.
|
script.
|
||||||
function loadValine () {
|
function loadValine () {
|
||||||
function initValine () {
|
function initValine () {
|
||||||
const initData = {
|
let initData = {
|
||||||
el: '#vcomment',
|
el: '#vcomment',
|
||||||
appId: '#{theme.valine.appId}',
|
appId: '#{theme.valine.appId}',
|
||||||
appKey: '#{theme.valine.appKey}',
|
appKey: '#{theme.valine.appKey}',
|
||||||
@@ -26,6 +27,11 @@ script.
|
|||||||
initData.requiredFields= ('!{theme.valine.requiredFields}'.split(','))
|
initData.requiredFields= ('!{theme.valine.requiredFields}'.split(','))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!{Boolean(option)}) {
|
||||||
|
const otherData = !{option}
|
||||||
|
initData = Object.assign({}, initData, otherData)
|
||||||
|
}
|
||||||
|
|
||||||
const valine = new Valine(initData)
|
const valine = new Valine(initData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
layout/includes/third-party/math/mathjax.pug
vendored
2
layout/includes/third-party/math/mathjax.pug
vendored
@@ -41,7 +41,7 @@ script.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var script = document.createElement('script')
|
const script = document.createElement('script')
|
||||||
script.src = '!{theme.CDN.mathjax}'
|
script.src = '!{theme.CDN.mathjax}'
|
||||||
script.id = 'MathJax-script'
|
script.id = 'MathJax-script'
|
||||||
script.async = true
|
script.async = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "3.2.0",
|
"version": "3.3.0-b1",
|
||||||
"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": {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
|||||||
lazySrc +
|
lazySrc +
|
||||||
'="' +
|
'="' +
|
||||||
this.url_for(cover) +
|
this.url_for(cover) +
|
||||||
'">'
|
'" alt="cover">'
|
||||||
if (dateType === 'created') {
|
if (dateType === 'created') {
|
||||||
result +=
|
result +=
|
||||||
'<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i>' +
|
'<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i>' +
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
const { escapeHTML } = require('hexo-util')
|
||||||
|
|
||||||
function mermaid (args, content) {
|
function mermaid (args, content) {
|
||||||
return `<div class="mermaid">${content}</div>`
|
return `<div class="mermaid">${escapeHTML(content)}</div>`
|
||||||
}
|
}
|
||||||
|
|
||||||
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
|||||||
code
|
code
|
||||||
background: $code-background
|
background: $code-background
|
||||||
|
|
||||||
|
.aplayer
|
||||||
|
filter: brightness(.8)
|
||||||
|
|
||||||
// 頭部
|
// 頭部
|
||||||
#page-header
|
#page-header
|
||||||
& > #nav.fixed,
|
& > #nav.fixed,
|
||||||
@@ -103,8 +106,7 @@ if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
|||||||
.error-img,
|
.error-img,
|
||||||
#article-container iframe,
|
#article-container iframe,
|
||||||
img,
|
img,
|
||||||
.gist,
|
.gist
|
||||||
.aplayer
|
|
||||||
filter: brightness(.8)
|
filter: brightness(.8)
|
||||||
|
|
||||||
#aside_content .aside-list > .aside-list-item:not(:last-child)
|
#aside_content .aside-list > .aside-list-item:not(:last-child)
|
||||||
|
|||||||
Reference in New Issue
Block a user