mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 發佈 4.8.0
feat: 支持自定義 giscus 評論系統的 JS 地址
This commit is contained in:
parent
f0588a3967
commit
04e36c8d8a
417
_config.yml
417
_config.yml
@ -1,7 +1,13 @@
|
|||||||
# Main menu navigation (導航目錄)
|
# Navigation bar settings (導航欄設置)
|
||||||
# see https://butterfly.js.org/posts/4aa8abbe/#導航菜單
|
# see https://butterfly.js.org/posts/4aa8abbe/##導航欄設置-Navigation-bar-settings
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
|
nav:
|
||||||
|
logo: # image
|
||||||
|
display_title: true
|
||||||
|
fixed: false # fixed navigation bar
|
||||||
|
|
||||||
|
# Menu 目錄
|
||||||
menu:
|
menu:
|
||||||
# Home: / || fas fa-home
|
# Home: / || fas fa-home
|
||||||
# Archives: /archives/ || fas fa-archive
|
# Archives: /archives/ || fas fa-archive
|
||||||
@ -13,11 +19,6 @@ menu:
|
|||||||
# Link: /link/ || fas fa-link
|
# Link: /link/ || fas fa-link
|
||||||
# About: /about/ || fas fa-heart
|
# About: /about/ || fas fa-heart
|
||||||
|
|
||||||
nav:
|
|
||||||
logo: # image
|
|
||||||
display_title: true
|
|
||||||
fixed: false # fixed navigation bar
|
|
||||||
|
|
||||||
# Code Blocks (代碼相關)
|
# Code Blocks (代碼相關)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@ -28,68 +29,13 @@ highlight_shrink: false # true: shrink the code blocks / false: expand the code
|
|||||||
highlight_height_limit: false # unit: px
|
highlight_height_limit: false # unit: px
|
||||||
code_word_wrap: false
|
code_word_wrap: false
|
||||||
|
|
||||||
# copy settings
|
# Social Settings (社交圖標設置)
|
||||||
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
|
|
||||||
copy:
|
|
||||||
enable: true
|
|
||||||
copyright:
|
|
||||||
enable: false
|
|
||||||
limit_count: 50
|
|
||||||
|
|
||||||
# social settings (社交圖標設置)
|
|
||||||
# formal:
|
# formal:
|
||||||
# icon: link || the description || color
|
# icon: link || the description || color
|
||||||
social:
|
social:
|
||||||
# fab fa-github: https://github.com/xxxxx || Github || '#24292e'
|
# fab fa-github: https://github.com/xxxxx || Github || '#24292e'
|
||||||
# fas fa-envelope: mailto:xxxxxx@gmail.com || Email || '#4a7dbe'
|
# fas fa-envelope: mailto:xxxxxx@gmail.com || Email || '#4a7dbe'
|
||||||
|
|
||||||
# search (搜索)
|
|
||||||
# see https://butterfly.js.org/posts/ceeb73f/#搜索系統
|
|
||||||
# --------------------------------------
|
|
||||||
|
|
||||||
# Algolia search
|
|
||||||
algolia_search:
|
|
||||||
enable: false
|
|
||||||
hits:
|
|
||||||
per_page: 6
|
|
||||||
|
|
||||||
# Local search
|
|
||||||
local_search:
|
|
||||||
enable: false
|
|
||||||
# Preload the search data when the page loads.
|
|
||||||
preload: false
|
|
||||||
# Show top n results per article, show all results by setting to -1
|
|
||||||
top_n_per_article: 1
|
|
||||||
# Unescape html strings to the readable one.
|
|
||||||
unescape: false
|
|
||||||
CDN:
|
|
||||||
|
|
||||||
# Docsearch
|
|
||||||
docsearch:
|
|
||||||
enable: false
|
|
||||||
appId:
|
|
||||||
apiKey:
|
|
||||||
indexName:
|
|
||||||
option:
|
|
||||||
|
|
||||||
# Math (數學)
|
|
||||||
# --------------------------------------
|
|
||||||
# About the per_page
|
|
||||||
# if you set it to true, it will load mathjax/katex script in each page (true 表示每一頁都加載js)
|
|
||||||
# if you set it to false, it will load mathjax/katex script according to your setting (add the 'mathjax: true' in page's front-matter)
|
|
||||||
# (false 需要時加載,須在使用的 Markdown Front-matter 加上 mathjax: true)
|
|
||||||
|
|
||||||
# MathJax
|
|
||||||
mathjax:
|
|
||||||
enable: false
|
|
||||||
per_page: false
|
|
||||||
|
|
||||||
# KaTeX
|
|
||||||
katex:
|
|
||||||
enable: false
|
|
||||||
per_page: false
|
|
||||||
hide_scrollbar: true
|
|
||||||
|
|
||||||
# Image (圖片設置)
|
# Image (圖片設置)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@ -168,14 +114,6 @@ post_meta:
|
|||||||
tags: true # true or false 文章頁是否顯示標籤
|
tags: true # true or false 文章頁是否顯示標籤
|
||||||
label: true # true or false 顯示描述性文字
|
label: true # true or false 顯示描述性文字
|
||||||
|
|
||||||
# wordcount (字數統計)
|
|
||||||
# see https://butterfly.js.org/posts/ceeb73f/#字數統計
|
|
||||||
wordcount:
|
|
||||||
enable: false
|
|
||||||
post_wordcount: true
|
|
||||||
min2read: true
|
|
||||||
total_wordcount: true
|
|
||||||
|
|
||||||
# Display the article introduction on homepage
|
# Display the article introduction on homepage
|
||||||
# 1: description
|
# 1: description
|
||||||
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
|
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
|
||||||
@ -193,6 +131,17 @@ anchor:
|
|||||||
icon: # the unicode value of Font Awesome icon, such as '\3423'
|
icon: # the unicode value of Font Awesome icon, such as '\3423'
|
||||||
auto_update: false # when you scroll in post, the URL will update according to header id.
|
auto_update: false # when you scroll in post, the URL will update according to header id.
|
||||||
|
|
||||||
|
# figcaption (圖片描述文字)
|
||||||
|
photofigcaption: false
|
||||||
|
|
||||||
|
# copy settings
|
||||||
|
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
|
||||||
|
copy:
|
||||||
|
enable: true
|
||||||
|
copyright:
|
||||||
|
enable: false
|
||||||
|
limit_count: 50
|
||||||
|
|
||||||
# Post
|
# Post
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@ -237,9 +186,6 @@ related_post:
|
|||||||
limit: 6 # Number of posts displayed
|
limit: 6 # Number of posts displayed
|
||||||
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||||
|
|
||||||
# figcaption (圖片描述文字)
|
|
||||||
photofigcaption: false
|
|
||||||
|
|
||||||
# post_pagination (分頁)
|
# post_pagination (分頁)
|
||||||
# value: 1 || 2 || false
|
# value: 1 || 2 || false
|
||||||
# 1: The 'next post' will link to old post
|
# 1: The 'next post' will link to old post
|
||||||
@ -256,7 +202,180 @@ noticeOutdate:
|
|||||||
message_prev: It has been
|
message_prev: It has been
|
||||||
message_next: days since the last update, the content of the article may be outdated.
|
message_next: days since the last update, the content of the article may be outdated.
|
||||||
|
|
||||||
# Share System (分享功能)
|
# Footer Settings
|
||||||
|
# --------------------------------------
|
||||||
|
footer:
|
||||||
|
owner:
|
||||||
|
enable: true
|
||||||
|
since: 2020
|
||||||
|
custom_text:
|
||||||
|
copyright: true # Copyright of theme and framework
|
||||||
|
|
||||||
|
# aside (側邊欄)
|
||||||
|
# --------------------------------------
|
||||||
|
|
||||||
|
aside:
|
||||||
|
enable: true
|
||||||
|
hide: false
|
||||||
|
button: true
|
||||||
|
mobile: true # display on mobile
|
||||||
|
position: right # left or right
|
||||||
|
display:
|
||||||
|
archive: true
|
||||||
|
tag: true
|
||||||
|
category: true
|
||||||
|
card_author:
|
||||||
|
enable: true
|
||||||
|
description:
|
||||||
|
button:
|
||||||
|
enable: true
|
||||||
|
icon: fab fa-github
|
||||||
|
text: Follow Me
|
||||||
|
link: https://github.com/xxxxxx
|
||||||
|
card_announcement:
|
||||||
|
enable: true
|
||||||
|
content: This is my Blog
|
||||||
|
card_recent_post:
|
||||||
|
enable: true
|
||||||
|
limit: 5 # if set 0 will show all
|
||||||
|
sort: date # date or updated
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
card_categories:
|
||||||
|
enable: true
|
||||||
|
limit: 8 # if set 0 will show all
|
||||||
|
expand: none # none/true/false
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
card_tags:
|
||||||
|
enable: true
|
||||||
|
limit: 40 # if set 0 will show all
|
||||||
|
color: false
|
||||||
|
orderby: random # Order of tags, random/name/length
|
||||||
|
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
card_archives:
|
||||||
|
enable: true
|
||||||
|
type: monthly # yearly or monthly
|
||||||
|
format: MMMM YYYY # eg: YYYY年MM月
|
||||||
|
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||||
|
limit: 8 # if set 0 will show all
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
card_webinfo:
|
||||||
|
enable: true
|
||||||
|
post_count: true
|
||||||
|
last_push_date: true
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
|
||||||
|
# busuanzi count for PV / UV in site
|
||||||
|
# 訪問人數
|
||||||
|
busuanzi:
|
||||||
|
site_uv: true
|
||||||
|
site_pv: true
|
||||||
|
page_pv: true
|
||||||
|
|
||||||
|
# Time difference between publish date and now (網頁運行時間)
|
||||||
|
# Formal: Month/Day/Year Time or Year/Month/Day Time
|
||||||
|
runtimeshow:
|
||||||
|
enable: false
|
||||||
|
publish_date:
|
||||||
|
|
||||||
|
# Aside widget - Newest Comments
|
||||||
|
newest_comments:
|
||||||
|
enable: false
|
||||||
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
|
limit: 6
|
||||||
|
storage: 10 # unit: mins, save data to localStorage
|
||||||
|
avatar: true
|
||||||
|
|
||||||
|
# Bottom right button (右下角按鈕)
|
||||||
|
# --------------------------------------
|
||||||
|
|
||||||
|
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
||||||
|
translate:
|
||||||
|
enable: false
|
||||||
|
# The text of a button
|
||||||
|
default: 繁
|
||||||
|
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
|
||||||
|
defaultEncoding: 2
|
||||||
|
# Time delay
|
||||||
|
translateDelay: 0
|
||||||
|
# The text of the button when the language is Simplified Chinese
|
||||||
|
msgToTraditionalChinese: '繁'
|
||||||
|
# The text of the button when the language is Traditional Chinese
|
||||||
|
msgToSimplifiedChinese: '簡'
|
||||||
|
|
||||||
|
# Read Mode (閲讀模式)
|
||||||
|
readmode: true
|
||||||
|
|
||||||
|
# dark mode
|
||||||
|
darkmode:
|
||||||
|
enable: true
|
||||||
|
# Toggle Button to switch dark/light mode
|
||||||
|
button: true
|
||||||
|
# Switch dark/light mode automatically (自動切換 dark mode和 light mode)
|
||||||
|
# autoChangeMode: 1 Following System Settings, if the system doesn't support dark mode, it will switch dark mode between 6 pm to 6 am
|
||||||
|
# autoChangeMode: 2 Switch dark mode between 6 pm to 6 am
|
||||||
|
# autoChangeMode: false
|
||||||
|
autoChangeMode: false
|
||||||
|
|
||||||
|
# show scroll percent in scroll-to-top button
|
||||||
|
rightside_scroll_percent: false
|
||||||
|
|
||||||
|
# Don't modify the following settings unless you know how they work (非必要請不要修改 )
|
||||||
|
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
|
||||||
|
# Don't repeat 不要重複
|
||||||
|
rightside_item_order:
|
||||||
|
enable: false
|
||||||
|
hide: # readmode,translate,darkmode,hideAside
|
||||||
|
show: # toc,chat,comment
|
||||||
|
|
||||||
|
# Math (數學)
|
||||||
|
# --------------------------------------
|
||||||
|
# About the per_page
|
||||||
|
# if you set it to true, it will load mathjax/katex script in each page (true 表示每一頁都加載js)
|
||||||
|
# if you set it to false, it will load mathjax/katex script according to your setting (add the 'mathjax: true' in page's front-matter)
|
||||||
|
# (false 需要時加載,須在使用的 Markdown Front-matter 加上 mathjax: true)
|
||||||
|
|
||||||
|
# MathJax
|
||||||
|
mathjax:
|
||||||
|
enable: false
|
||||||
|
per_page: false
|
||||||
|
|
||||||
|
# KaTeX
|
||||||
|
katex:
|
||||||
|
enable: false
|
||||||
|
per_page: false
|
||||||
|
hide_scrollbar: true
|
||||||
|
|
||||||
|
# search (搜索)
|
||||||
|
# see https://butterfly.js.org/posts/ceeb73f/#搜索系統
|
||||||
|
# --------------------------------------
|
||||||
|
|
||||||
|
# Algolia search
|
||||||
|
algolia_search:
|
||||||
|
enable: false
|
||||||
|
hits:
|
||||||
|
per_page: 6
|
||||||
|
|
||||||
|
# Local search
|
||||||
|
local_search:
|
||||||
|
enable: false
|
||||||
|
# Preload the search data when the page loads.
|
||||||
|
preload: false
|
||||||
|
# Show top n results per article, show all results by setting to -1
|
||||||
|
top_n_per_article: 1
|
||||||
|
# Unescape html strings to the readable one.
|
||||||
|
unescape: false
|
||||||
|
CDN:
|
||||||
|
|
||||||
|
# Docsearch
|
||||||
|
docsearch:
|
||||||
|
enable: false
|
||||||
|
appId:
|
||||||
|
apiKey:
|
||||||
|
indexName:
|
||||||
|
option:
|
||||||
|
|
||||||
|
# Share System (分享)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
# AddThis
|
# AddThis
|
||||||
@ -433,15 +552,6 @@ messenger:
|
|||||||
pageID:
|
pageID:
|
||||||
lang: zh_TW # Language en_US/zh_CN/zh_TW and so on
|
lang: zh_TW # Language en_US/zh_CN/zh_TW and so on
|
||||||
|
|
||||||
# Footer Settings
|
|
||||||
# --------------------------------------
|
|
||||||
footer:
|
|
||||||
owner:
|
|
||||||
enable: true
|
|
||||||
since: 2020
|
|
||||||
custom_text:
|
|
||||||
copyright: true # Copyright of theme and framework
|
|
||||||
|
|
||||||
# Analysis
|
# Analysis
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@ -538,6 +648,14 @@ rightside-bottom:
|
|||||||
# Enter transitions (開啓網頁進入效果)
|
# Enter transitions (開啓網頁進入效果)
|
||||||
enter_transitions: true
|
enter_transitions: true
|
||||||
|
|
||||||
|
# Typewriter Effect (打字效果)
|
||||||
|
# https://github.com/disjukr/activate-power-mode
|
||||||
|
activate_power_mode:
|
||||||
|
enable: false
|
||||||
|
colorful: true # open particle animation (冒光特效)
|
||||||
|
shake: true # open shake (抖動特效)
|
||||||
|
mobile: false
|
||||||
|
|
||||||
# Background effects (背景特效)
|
# Background effects (背景特效)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
@ -566,14 +684,6 @@ canvas_nest:
|
|||||||
count: 99 # the number of lines, default: 99.
|
count: 99 # the number of lines, default: 99.
|
||||||
mobile: false
|
mobile: false
|
||||||
|
|
||||||
# Typewriter Effect (打字效果)
|
|
||||||
# https://github.com/disjukr/activate-power-mode
|
|
||||||
activate_power_mode:
|
|
||||||
enable: false
|
|
||||||
colorful: true # open particle animation (冒光特效)
|
|
||||||
shake: true # open shake (抖動特效)
|
|
||||||
mobile: false
|
|
||||||
|
|
||||||
# Mouse click effects: fireworks (鼠標點擊效果: 煙火特效)
|
# Mouse click effects: fireworks (鼠標點擊效果: 煙火特效)
|
||||||
fireworks:
|
fireworks:
|
||||||
enable: false
|
enable: false
|
||||||
@ -655,122 +765,13 @@ preloader:
|
|||||||
# pace theme (see https://codebyzach.github.io/pace/)
|
# pace theme (see https://codebyzach.github.io/pace/)
|
||||||
pace_css_url:
|
pace_css_url:
|
||||||
|
|
||||||
# aside (側邊欄)
|
# wordcount (字數統計)
|
||||||
# --------------------------------------
|
# see https://butterfly.js.org/posts/ceeb73f/#字數統計
|
||||||
|
wordcount:
|
||||||
aside:
|
|
||||||
enable: true
|
|
||||||
hide: false
|
|
||||||
button: true
|
|
||||||
mobile: true # display on mobile
|
|
||||||
position: right # left or right
|
|
||||||
display:
|
|
||||||
archive: true
|
|
||||||
tag: true
|
|
||||||
category: true
|
|
||||||
card_author:
|
|
||||||
enable: true
|
|
||||||
description:
|
|
||||||
button:
|
|
||||||
enable: true
|
|
||||||
icon: fab fa-github
|
|
||||||
text: Follow Me
|
|
||||||
link: https://github.com/xxxxxx
|
|
||||||
card_announcement:
|
|
||||||
enable: true
|
|
||||||
content: This is my Blog
|
|
||||||
card_recent_post:
|
|
||||||
enable: true
|
|
||||||
limit: 5 # if set 0 will show all
|
|
||||||
sort: date # date or updated
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
card_categories:
|
|
||||||
enable: true
|
|
||||||
limit: 8 # if set 0 will show all
|
|
||||||
expand: none # none/true/false
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
card_tags:
|
|
||||||
enable: true
|
|
||||||
limit: 40 # if set 0 will show all
|
|
||||||
color: false
|
|
||||||
orderby: random # Order of tags, random/name/length
|
|
||||||
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
card_archives:
|
|
||||||
enable: true
|
|
||||||
type: monthly # yearly or monthly
|
|
||||||
format: MMMM YYYY # eg: YYYY年MM月
|
|
||||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
|
||||||
limit: 8 # if set 0 will show all
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
card_webinfo:
|
|
||||||
enable: true
|
|
||||||
post_count: true
|
|
||||||
last_push_date: true
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
|
|
||||||
# busuanzi count for PV / UV in site
|
|
||||||
# 訪問人數
|
|
||||||
busuanzi:
|
|
||||||
site_uv: true
|
|
||||||
site_pv: true
|
|
||||||
page_pv: true
|
|
||||||
|
|
||||||
# Time difference between publish date and now (網頁運行時間)
|
|
||||||
# Formal: Month/Day/Year Time or Year/Month/Day Time
|
|
||||||
runtimeshow:
|
|
||||||
enable: false
|
enable: false
|
||||||
publish_date:
|
post_wordcount: true
|
||||||
|
min2read: true
|
||||||
# Aside widget - Newest Comments
|
total_wordcount: true
|
||||||
newest_comments:
|
|
||||||
enable: false
|
|
||||||
sort_order: # Don't modify the setting unless you know how it works
|
|
||||||
limit: 6
|
|
||||||
storage: 10 # unit: mins, save data to localStorage
|
|
||||||
avatar: true
|
|
||||||
|
|
||||||
# Bottom right button (右下角按鈕)
|
|
||||||
# --------------------------------------
|
|
||||||
|
|
||||||
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
|
||||||
translate:
|
|
||||||
enable: false
|
|
||||||
# The text of a button
|
|
||||||
default: 繁
|
|
||||||
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
|
|
||||||
defaultEncoding: 2
|
|
||||||
# Time delay
|
|
||||||
translateDelay: 0
|
|
||||||
# The text of the button when the language is Simplified Chinese
|
|
||||||
msgToTraditionalChinese: '繁'
|
|
||||||
# The text of the button when the language is Traditional Chinese
|
|
||||||
msgToSimplifiedChinese: '簡'
|
|
||||||
|
|
||||||
# Read Mode (閲讀模式)
|
|
||||||
readmode: true
|
|
||||||
|
|
||||||
# dark mode
|
|
||||||
darkmode:
|
|
||||||
enable: true
|
|
||||||
# Toggle Button to switch dark/light mode
|
|
||||||
button: true
|
|
||||||
# Switch dark/light mode automatically (自動切換 dark mode和 light mode)
|
|
||||||
# autoChangeMode: 1 Following System Settings, if the system doesn't support dark mode, it will switch dark mode between 6 pm to 6 am
|
|
||||||
# autoChangeMode: 2 Switch dark mode between 6 pm to 6 am
|
|
||||||
# autoChangeMode: false
|
|
||||||
autoChangeMode: false
|
|
||||||
|
|
||||||
# show scroll percent in scroll-to-top button
|
|
||||||
rightside_scroll_percent: false
|
|
||||||
|
|
||||||
# Don't modify the following settings unless you know how they work (非必要請不要修改 )
|
|
||||||
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
|
|
||||||
# Don't repeat 不要重複
|
|
||||||
rightside_item_order:
|
|
||||||
enable: false
|
|
||||||
hide: # readmode,translate,darkmode,hideAside
|
|
||||||
show: # toc,chat,comment
|
|
||||||
|
|
||||||
# Lightbox (圖片大圖查看模式)
|
# Lightbox (圖片大圖查看模式)
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
@ -789,7 +790,6 @@ fancybox: true
|
|||||||
|
|
||||||
# abcjs (樂譜渲染)
|
# abcjs (樂譜渲染)
|
||||||
# See https://github.com/paulrosen/abcjs
|
# See https://github.com/paulrosen/abcjs
|
||||||
# ---------------
|
|
||||||
abcjs:
|
abcjs:
|
||||||
enable: false
|
enable: false
|
||||||
per_page: true
|
per_page: true
|
||||||
@ -940,6 +940,7 @@ CDN:
|
|||||||
# twikoo:
|
# twikoo:
|
||||||
# waline_js:
|
# waline_js:
|
||||||
# waline_css:
|
# waline_css:
|
||||||
|
# giscus:
|
||||||
# sharejs:
|
# sharejs:
|
||||||
# sharejs_css:
|
# sharejs_css:
|
||||||
# mathjax:
|
# mathjax:
|
||||||
|
|||||||
28
layout/includes/third-party/comments/giscus.pug
vendored
28
layout/includes/third-party/comments/giscus.pug
vendored
@ -1,16 +1,20 @@
|
|||||||
- const { repo, repo_id, category_id, option } = theme.giscus
|
- const { repo, repo_id, category_id, theme:themes, option } = theme.giscus
|
||||||
- const themes = theme.giscus.theme
|
- const giscusUrl = theme.asset.giscus || 'https://giscus.app/client.js'
|
||||||
script.
|
- const giscusOriginUrl = new URL(giscusUrl).origin
|
||||||
function loadGiscus () {
|
|
||||||
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
|
||||||
|
|
||||||
|
script.
|
||||||
|
function getGiscusTheme () {
|
||||||
|
return document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadGiscus () {
|
||||||
const config = Object.assign({
|
const config = Object.assign({
|
||||||
src: 'https://giscus.app/client.js',
|
src: '!{giscusUrl}',
|
||||||
'data-repo': '!{repo}',
|
'data-repo': '!{repo}',
|
||||||
'data-repo-id': '!{repo_id}',
|
'data-repo-id': '!{repo_id}',
|
||||||
'data-category-id': '!{category_id}',
|
'data-category-id': '!{category_id}',
|
||||||
'data-mapping': 'pathname',
|
'data-mapping': 'pathname',
|
||||||
'data-theme': nowTheme,
|
'data-theme': getGiscusTheme(),
|
||||||
'data-reactions-enabled': '1',
|
'data-reactions-enabled': '1',
|
||||||
crossorigin: 'anonymous',
|
crossorigin: 'anonymous',
|
||||||
async: true
|
async: true
|
||||||
@ -24,17 +28,15 @@ script.
|
|||||||
}
|
}
|
||||||
|
|
||||||
function changeGiscusTheme () {
|
function changeGiscusTheme () {
|
||||||
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
|
||||||
|
|
||||||
function sendMessage(message) {
|
function sendMessage(message) {
|
||||||
const iframe = document.querySelector('iframe.giscus-frame');
|
const iframe = document.querySelector('iframe.giscus-frame')
|
||||||
if (!iframe) return;
|
if (!iframe) return
|
||||||
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
iframe.contentWindow.postMessage({ giscus: message }, '!{giscusOriginUrl}')
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessage({
|
sendMessage({
|
||||||
setConfig: {
|
setConfig: {
|
||||||
theme: theme
|
theme: getGiscusTheme()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "4.8.0-b2",
|
"version": "4.8.0",
|
||||||
"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": {
|
||||||
|
|||||||
14
plugins.yml
14
plugins.yml
@ -1,11 +1,11 @@
|
|||||||
algolia_search:
|
algolia_search:
|
||||||
name: algoliasearch
|
name: algoliasearch
|
||||||
file: dist/algoliasearch-lite.umd.js
|
file: dist/algoliasearch-lite.umd.js
|
||||||
version: 4.16.0
|
version: 4.17.0
|
||||||
instantsearch:
|
instantsearch:
|
||||||
name: instantsearch.js
|
name: instantsearch.js
|
||||||
file: dist/instantsearch.production.min.js
|
file: dist/instantsearch.production.min.js
|
||||||
version: 4.53.0
|
version: 4.54.0
|
||||||
pjax:
|
pjax:
|
||||||
name: pjax
|
name: pjax
|
||||||
file: pjax.min.js
|
file: pjax.min.js
|
||||||
@ -37,7 +37,7 @@ disqusjs_css:
|
|||||||
twikoo:
|
twikoo:
|
||||||
name: twikoo
|
name: twikoo
|
||||||
file: dist/twikoo.all.min.js
|
file: dist/twikoo.all.min.js
|
||||||
version: 1.6.11
|
version: 1.6.14
|
||||||
waline_js:
|
waline_js:
|
||||||
name: '@waline/client'
|
name: '@waline/client'
|
||||||
file: dist/waline.js
|
file: dist/waline.js
|
||||||
@ -121,12 +121,12 @@ pangu:
|
|||||||
fancybox_css:
|
fancybox_css:
|
||||||
name: '@fancyapps/ui'
|
name: '@fancyapps/ui'
|
||||||
file: dist/fancybox/fancybox.css
|
file: dist/fancybox/fancybox.css
|
||||||
version: 5.0.14
|
version: 5.0.15
|
||||||
other_name: fancyapps-ui
|
other_name: fancyapps-ui
|
||||||
fancybox:
|
fancybox:
|
||||||
name: '@fancyapps/ui'
|
name: '@fancyapps/ui'
|
||||||
file: dist/fancybox/fancybox.umd.js
|
file: dist/fancybox/fancybox.umd.js
|
||||||
version: 5.0.14
|
version: 5.0.15
|
||||||
other_name: fancyapps-ui
|
other_name: fancyapps-ui
|
||||||
medium_zoom:
|
medium_zoom:
|
||||||
name: medium-zoom
|
name: medium-zoom
|
||||||
@ -183,11 +183,11 @@ prismjs_autoloader:
|
|||||||
artalk_js:
|
artalk_js:
|
||||||
name: artalk
|
name: artalk
|
||||||
file: dist/Artalk.js
|
file: dist/Artalk.js
|
||||||
version: 2.5.2
|
version: 2.5.4
|
||||||
artalk_css:
|
artalk_css:
|
||||||
name: artalk
|
name: artalk
|
||||||
file: dist/Artalk.css
|
file: dist/Artalk.css
|
||||||
version: 2.5.2
|
version: 2.5.4
|
||||||
pace_js:
|
pace_js:
|
||||||
name: pace-js
|
name: pace-js
|
||||||
other_name: pace
|
other_name: pace
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user