mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
Compare commits
42 Commits
7
.github/ISSUE_TEMPLATE.md
vendored
7
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +1,15 @@
|
|||||||
<!--
|
<!--
|
||||||
IMPORTANT: Please follow the template to create a new issue.
|
IMPORTANT: Please follow the template to create a new issue.
|
||||||
重要:請依照該模板來提交。
|
重要:請依照該模板來提交。
|
||||||
|
|
||||||
|
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
|
||||||
|
如果你是由舊版本升級到新版,運行時出現報錯,請首先把config裏新的內容複製到舊的butterfly設置去
|
||||||
|
|
||||||
|
If you are a problem when visit the website, please open your browser 'developer tools (shortcut F12)' and check the console if there is an error, include your website address in the feedback
|
||||||
|
如果你是線上訪問出現問題,請檢查瀏覽器‘開發人員工具(快捷鍵F12)’的console是否有報錯,反饋時附上你的網站
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
## I want to create a new issue <!-- 我想要建立一個新的issue -->
|
## I want to create a new issue <!-- 我想要建立一個新的issue -->
|
||||||
|
|
||||||
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->
|
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->
|
||||||
|
|||||||
21
.github/stale.yml
vendored
Normal file
21
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 30
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
- bug
|
||||||
|
- enhancement
|
||||||
|
- Solved
|
||||||
|
- documentation
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: wontfix
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
||||||
24
README.md
24
README.md
@@ -1,21 +1,17 @@
|
|||||||
# hexo-theme-butterfly
|
# hexo-theme-butterfly
|
||||||
|
|
||||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.1.0-blue"/></a>
|
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.3.5-blue"/></a>
|
||||||
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
||||||
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-3.0+-0e83c"/></a>
|
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a>
|
||||||
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-6.0-blur"/></a>
|
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||||
|
|
||||||
Demo: https://demo.jerryc.me/
|
|
||||||
|
|
||||||
JerryC: https://jerryc.me/
|
|
||||||
|
|
||||||
|
|
||||||
|
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||||
|
|
||||||
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Stable branch:
|
Stable branch [recommend]:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||||
@@ -39,7 +35,15 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Bu
|
|||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Documentation is [here](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
|
Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW` and `zh-CN`
|
||||||
|
|
||||||
|
You can also join the Chat Group.
|
||||||
|
|
||||||
|
[ 💬 Join QQ Group [recommend]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||||
|
|
||||||
|
[ 💬 Join Telegram Group](https://t.me/hexo_butterfly)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|||||||
22
README_CN.md
22
README_CN.md
@@ -1,20 +1,17 @@
|
|||||||
# hexo-theme-butterfly
|
# hexo-theme-butterfly
|
||||||
|
|
||||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.1.0-blue"/></a>
|
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.3.5-blue"/></a>
|
||||||
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
||||||
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-3.0+-0e83c"/></a>
|
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a>
|
||||||
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-6.0-blur"/></a>
|
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||||
|
|
||||||
Demo: https://demo.jerryc.me/
|
|
||||||
|
|
||||||
JerryC: https://jerryc.me/
|
|
||||||
|
|
||||||
|
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||||
|
|
||||||
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
||||||
|
|
||||||
## 安裝
|
## 安裝
|
||||||
|
|
||||||
在你的博客根目錄裏
|
在你的博客根目錄裡安裝穩定版【推薦】
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||||
@@ -37,9 +34,16 @@ theme: Butterfly
|
|||||||
|
|
||||||
## 文檔
|
## 文檔
|
||||||
|
|
||||||
可查看[這裏](https://jerryc.me/posts/21cfbf15)
|
可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15)
|
||||||
|
|
||||||
|
你也可以加入群組
|
||||||
|
|
||||||
|
[ 💬 QQ群 [推薦]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||||
|
|
||||||
|
[ 💬Telegram群](https://t.me/hexo_butterfly)
|
||||||
|
|
||||||
## 截圖
|
## 截圖
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|||||||
399
_config.yml
399
_config.yml
@@ -15,10 +15,6 @@ menu:
|
|||||||
- Music || /music/ || fa fa-music
|
- Music || /music/ || fa fa-music
|
||||||
- Movie || /movies/ || fa fa-film
|
- Movie || /movies/ || fa fa-film
|
||||||
|
|
||||||
# Favicon
|
|
||||||
# ---------------
|
|
||||||
favicon: /img/favicon.ico
|
|
||||||
|
|
||||||
# PWA
|
# PWA
|
||||||
# See https://github.com/JLHwung/hexo-offline
|
# See https://github.com/JLHwung/hexo-offline
|
||||||
# ---------------
|
# ---------------
|
||||||
@@ -42,19 +38,19 @@ code_word_wrap: false
|
|||||||
|
|
||||||
# copy setting
|
# copy setting
|
||||||
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
|
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
|
||||||
# copyright 複製的内容後面加上版權信息
|
# copyright 複製的內容後面加上版權信息
|
||||||
copy:
|
copy:
|
||||||
enable: true # true 開啓 / false 禁止
|
enable: true # true 開啟 / false 禁止
|
||||||
copyright: false
|
copyright: false
|
||||||
|
|
||||||
# social settings
|
# social settings
|
||||||
# formal:
|
# formal:
|
||||||
# icon: link
|
# icon: link || the description
|
||||||
# ---------------
|
# ---------------
|
||||||
social:
|
social:
|
||||||
fa fa-github: https://github.com/jerryc127
|
fa fa-github: https://github.com/jerryc127 || Github
|
||||||
fa fa-envelope: mailto:xxxxxxxx@gmail.com
|
fa fa-envelope: mailto:xxxxxxx@gmail.com || Email
|
||||||
fa fa-rss: /atom.xml
|
fa fa-rss: /atom.xml || RSS
|
||||||
|
|
||||||
#### search ####
|
#### search ####
|
||||||
# Algolia search
|
# Algolia search
|
||||||
@@ -67,10 +63,10 @@ algolia_search:
|
|||||||
labels:
|
labels:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
||||||
hits_stats: "${hits} results found in ${time} ms"
|
hits_stats: '${hits} results found in ${time} ms'
|
||||||
|
|
||||||
# Local search
|
# Local search
|
||||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#本地搜索
|
# Please see doc for more details: https://docs.jerryc.me/config.html#本地搜索
|
||||||
# ---------------
|
# ---------------
|
||||||
local_search:
|
local_search:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -79,7 +75,7 @@ local_search:
|
|||||||
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
||||||
|
|
||||||
# MathJax
|
# MathJax
|
||||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#MathJax
|
# Please see doc for more details: https://docs.jerryc.me/config.html#mathjax
|
||||||
# ---------------
|
# ---------------
|
||||||
mathjax:
|
mathjax:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -96,45 +92,88 @@ katex:
|
|||||||
per_page: false
|
per_page: false
|
||||||
hide_scrollbar: true
|
hide_scrollbar: true
|
||||||
|
|
||||||
|
# mermaid
|
||||||
|
# see https://github.com/knsv/mermaid
|
||||||
|
# -------------------------------
|
||||||
|
mermaid:
|
||||||
|
enable: false
|
||||||
|
# built-in themes: default/forest/dark/neutral
|
||||||
|
theme: default
|
||||||
|
|
||||||
|
# Favicon
|
||||||
|
# ---------------
|
||||||
|
favicon: /img/favicon.png
|
||||||
|
|
||||||
# Post info settings
|
# Post info settings
|
||||||
# ---------------
|
# ---------------
|
||||||
avatar: /img/avatar.png
|
avatar:
|
||||||
|
img: /img/avatar.png
|
||||||
|
effect: false # 頭像會一直轉圈
|
||||||
|
|
||||||
# the banner image of index
|
# the banner image of index
|
||||||
index_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/index.jpg
|
index_img:
|
||||||
|
|
||||||
# if the banner of page not setting,it will show the top_img
|
# if the banner of page not setting,it will show the top_img
|
||||||
default_top_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/index.jpg
|
default_top_img: https://i.loli.net/2020/05/01/IuWi8QbHvzjlOPw.jpg
|
||||||
|
|
||||||
# the default cover of the post
|
|
||||||
default_cover: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/default.png
|
|
||||||
|
|
||||||
# the banner image of archive page
|
# the banner image of archive page
|
||||||
archive_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/archive.jpg
|
archive_img:
|
||||||
|
|
||||||
# the banner image of tag page
|
# the banner image of tag page
|
||||||
tag_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/tag.png
|
# tag page, look like https://xxxxxxxxx.com/tags/butterfly
|
||||||
|
tag_img:
|
||||||
|
|
||||||
# the banner image of category page
|
# the banner image of category page
|
||||||
category_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/category.jpg
|
# category page, look like https://xxxxxxxxx.com/categories/butterfly
|
||||||
|
category_img:
|
||||||
|
|
||||||
# 如果你有使用hexo-douban去生成movie界面,可配置這個
|
# 如果你有使用hexo-douban,可配置這個
|
||||||
movies_img: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/top_img/movie.jpg
|
# douban:
|
||||||
|
# meta: false
|
||||||
|
# movies_img:
|
||||||
|
# books_img:
|
||||||
|
# games_img:
|
||||||
|
|
||||||
|
cover:
|
||||||
|
# 是否顯示文章封面
|
||||||
|
index_enable: true
|
||||||
|
aside_enable: true
|
||||||
|
archives_enable: true
|
||||||
|
# 封面顯示的位置
|
||||||
|
# 三個值可配置 left , right , both
|
||||||
|
position: both
|
||||||
|
# 當沒有設置cover時,默認的封面顯示
|
||||||
|
default_cover:
|
||||||
|
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||||
|
|
||||||
# if the photo link cannot connect,it will show that
|
# if the photo link cannot connect,it will show that
|
||||||
lodding_bg:
|
lodding_bg:
|
||||||
flink: /img/friend_404.gif #404后圖片
|
flink: /img/friend_404.gif #404後圖片
|
||||||
post_page: /img/404.jpg #404后圖片
|
post_page: /img/404.jpg #404後圖片
|
||||||
# post: /img/loading.gif ##加載動畫
|
# post: /img/loading.gif ##加載動畫
|
||||||
|
|
||||||
post_meta:
|
# A simple 404 page
|
||||||
date_type: both # or created or updated 文章日期是创建日或者更新日或都显示
|
error_404:
|
||||||
categories: true # or false 是否显示分类
|
enable: false
|
||||||
tags: true # or false 是否显示标签
|
subtitle: 'Page Not Found'
|
||||||
|
background:
|
||||||
|
|
||||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#字数统计
|
post_meta:
|
||||||
|
page:
|
||||||
|
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
|
||||||
|
categories: true # true or false 主頁是否顯示分類
|
||||||
|
tags: false # true or false 主頁是否顯示標籤
|
||||||
|
post:
|
||||||
|
date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
|
||||||
|
categories: true # true or false 文章頁是否顯示分類
|
||||||
|
tags: true # true or false 文章頁是否顯示標籤
|
||||||
|
|
||||||
|
# Please see doc for more details: https://docs.jerryc.me/config.html#字數統計
|
||||||
wordcount:
|
wordcount:
|
||||||
enable: false
|
enable: false
|
||||||
|
post_wordcount: true
|
||||||
|
min2read: true
|
||||||
|
total_wordcount: true
|
||||||
|
|
||||||
toc:
|
toc:
|
||||||
enable: true
|
enable: true
|
||||||
@@ -146,6 +185,7 @@ auto_open_sidebar:
|
|||||||
|
|
||||||
post_copyright:
|
post_copyright:
|
||||||
enable: true
|
enable: true
|
||||||
|
decode: false
|
||||||
license: CC BY-NC-SA 4.0
|
license: CC BY-NC-SA 4.0
|
||||||
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||||
|
|
||||||
@@ -181,7 +221,20 @@ addtoany:
|
|||||||
disqus:
|
disqus:
|
||||||
enable: false
|
enable: false
|
||||||
shortname:
|
shortname:
|
||||||
count: false # top_img顯示評論數
|
count: false # dispaly comment count in top_img
|
||||||
|
|
||||||
|
# Disqus.js版評論系統,應對大陸長城的折中方案,兼容原版:https://github.com/SukkaW/DisqusJS
|
||||||
|
# API 申請地址:https://disqus.com/api/applications/
|
||||||
|
# 與 disqus 共用樣式
|
||||||
|
disqusjs:
|
||||||
|
enable: false
|
||||||
|
shortname:
|
||||||
|
siteName:
|
||||||
|
apikey:
|
||||||
|
api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址
|
||||||
|
admin:
|
||||||
|
adminLabel:
|
||||||
|
count: false # dispaly comment count in top_img
|
||||||
|
|
||||||
laibili:
|
laibili:
|
||||||
enable: false
|
enable: false
|
||||||
@@ -194,27 +247,58 @@ gitalk:
|
|||||||
repo:
|
repo:
|
||||||
owner:
|
owner:
|
||||||
admin:
|
admin:
|
||||||
language: # en , zh-CN , zh-TW
|
language: zh-CN # en , zh-CN , zh-TW
|
||||||
count: false # top_img顯示評論數
|
perPage: 10 # Pagination size, with maximum 100.
|
||||||
|
distractionFreeMode: false # Facebook-like distraction free mode.
|
||||||
|
pagerDirection: last # Comment sorting direction, available values are last and first.
|
||||||
|
createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
|
||||||
|
count: false # dispaly comment count in top_img
|
||||||
|
|
||||||
# valine comment system. https://valine.js.org
|
# valine comment system. https://valine.js.org
|
||||||
valine:
|
valine:
|
||||||
enable: false # if you want use valine,please set this value is true
|
enable: false # if you want use valine,please set this value is true
|
||||||
appId: # leancloud application app id
|
appId: # leancloud application app id
|
||||||
appKey: # leancloud application app key
|
appKey: # leancloud application app key
|
||||||
notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
|
notify: false # valine mail notify (true/false) Deprecated in v1.4.0+
|
||||||
verify: false # valine verify code (true/false)
|
verify: false # valine verify code (true/false) Deprecated in v1.4.0+
|
||||||
pageSize: 10 # comment list page size
|
pageSize: 10 # comment list page size
|
||||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||||
lang: en # i18n: zh-cn/en
|
lang: en # i18n: zh-CN/zh-TW/en/ja
|
||||||
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
|
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
|
||||||
guest_info: nick,mail,link #valine comment header info
|
guest_info: nick,mail,link #valine comment header info
|
||||||
bg: /img/comment_bg.png # valine background
|
recordIP: false # Record reviewer IP
|
||||||
count: false # top_img顯示評論數
|
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
|
||||||
|
emojiCDN: # emoji CDN
|
||||||
|
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
|
||||||
|
requiredFields: nick,mail # required fields nick/mail/link
|
||||||
|
bg: # valine background
|
||||||
|
count: false # dispaly comment count in top_img
|
||||||
|
|
||||||
|
# utterances
|
||||||
|
# https://utteranc.es/
|
||||||
|
utterances:
|
||||||
|
enable: false
|
||||||
|
repo:
|
||||||
|
# 可選 pathname/url/title/og:title
|
||||||
|
issue_term: pathname
|
||||||
|
# 可選 github-light/github-dark/github-dark-orange/icy-dark/dark-blue/photon-dark
|
||||||
|
light_theme: github-light
|
||||||
|
dark_theme: photon-dark
|
||||||
|
|
||||||
|
# Facebook Comments Plugin
|
||||||
|
# https://developers.facebook.com/docs/plugins/comments/
|
||||||
|
facebook_comments:
|
||||||
|
enable: false
|
||||||
|
app_id:
|
||||||
|
user_id: # optional
|
||||||
|
pageSize: 10 # The number of comments to show
|
||||||
|
order_by: social # social/time/reverse_time
|
||||||
|
lang: en_US # Language en_US/zh_CN/zh_TW and so on
|
||||||
|
count: false
|
||||||
|
|
||||||
##### Footer Settings ####
|
##### Footer Settings ####
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
since: 2019
|
since: 2020
|
||||||
|
|
||||||
footer_custom_text:
|
footer_custom_text:
|
||||||
|
|
||||||
@@ -246,6 +330,13 @@ google_adsense:
|
|||||||
client:
|
client:
|
||||||
enable_page_level_ads: true
|
enable_page_level_ads: true
|
||||||
|
|
||||||
|
# 廣告插入位置
|
||||||
|
# 適用於開啓手動廣告的配置
|
||||||
|
# ad:
|
||||||
|
# index:
|
||||||
|
# aside:
|
||||||
|
# post:
|
||||||
|
|
||||||
#### 站長驗證 ####
|
#### 站長驗證 ####
|
||||||
# Google Webmaster tools verification setting
|
# Google Webmaster tools verification setting
|
||||||
# See: https://www.google.com/webmasters/
|
# See: https://www.google.com/webmasters/
|
||||||
@@ -263,16 +354,6 @@ baidu_site_verification:
|
|||||||
# see http://zhanzhang.so.com/
|
# see http://zhanzhang.so.com/
|
||||||
qihu_site_verification:
|
qihu_site_verification:
|
||||||
|
|
||||||
# 友情鏈接界面設置
|
|
||||||
Flink:
|
|
||||||
headline: 友情鏈接
|
|
||||||
info_headline: 我的Blog資料
|
|
||||||
name: Blog 名字: JerryC
|
|
||||||
address: Blog 地址: https://jerryc.me/
|
|
||||||
avatar: Blog 頭像: https://jerryc.me/img/avatar.png
|
|
||||||
info: Blog 簡介: 今日事,今日畢
|
|
||||||
comment: 如果需要交換友鏈,請留言
|
|
||||||
|
|
||||||
# 打賞按鈕
|
# 打賞按鈕
|
||||||
reward:
|
reward:
|
||||||
enable: true
|
enable: true
|
||||||
@@ -288,7 +369,15 @@ reward:
|
|||||||
related_post:
|
related_post:
|
||||||
enable: true
|
enable: true
|
||||||
limit: 6 # 顯示推薦文章數目
|
limit: 6 # 顯示推薦文章數目
|
||||||
date_type: created # or created or updated 文章日期顯示创建日或者更新日
|
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||||
|
|
||||||
|
# figcaption
|
||||||
|
# 圖片描述文字
|
||||||
|
photofigcaption: false
|
||||||
|
|
||||||
|
# anchor
|
||||||
|
# when you scroll in post, the url will update according to header id.
|
||||||
|
anchor: false
|
||||||
|
|
||||||
#### 美化/效果 ####
|
#### 美化/效果 ####
|
||||||
#--------------------------------
|
#--------------------------------
|
||||||
@@ -303,21 +392,20 @@ related_post:
|
|||||||
# button_hover: "#FF7242"
|
# button_hover: "#FF7242"
|
||||||
# text_selection: "#00c4b6"
|
# text_selection: "#00c4b6"
|
||||||
# link_color: "#99a9bf"
|
# link_color: "#99a9bf"
|
||||||
# meta_color: '#858585'
|
# meta_color: "#858585"
|
||||||
# hr_color: "#A4D8FA"
|
# hr_color: "#A4D8FA"
|
||||||
# read-mode-bg_color: '#FAF9DE'
|
# code_foreground: "#F47466"
|
||||||
# inline-code-color: '#F47466'
|
# code_background: "rgba(27, 31, 35, .05)"
|
||||||
|
# toc_color: "#00c4b6"
|
||||||
|
# blockquote_padding_color: "#49b1f5"
|
||||||
|
# blockquote_background_color: "#49b1f5"
|
||||||
|
|
||||||
# 主頁設置
|
# 主頁設置
|
||||||
# 默認top_img全屏,site_info在中間
|
# 默認top_img全屏,site_info在中間
|
||||||
# 使用默認, 都無需填寫(建議默認)
|
# 使用默認, 都無需填寫(建議默認)
|
||||||
|
index_site_info_top: # 主頁標題距離頂部距離 例如 300px/300em/300rem/10%
|
||||||
index_top_img_height: # 主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
|
index_top_img_height: # 主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
|
||||||
|
|
||||||
# 主頁文章COVER顯示位置
|
|
||||||
# 三個值可配置 left , right , both
|
|
||||||
# left(全部圖片顯示在左邊),right(全部圖片顯示在右邊),both(左右左右順序顯示)
|
|
||||||
index_post_cover: both
|
|
||||||
|
|
||||||
# category和tag頁的UI設置
|
# category和tag頁的UI設置
|
||||||
# index 值代表 UI將與首頁的UI一樣
|
# index 值代表 UI將與首頁的UI一樣
|
||||||
# 默認跟archives頁面UI一樣
|
# 默認跟archives頁面UI一樣
|
||||||
@@ -335,7 +423,7 @@ background:
|
|||||||
footer_bg: false
|
footer_bg: false
|
||||||
|
|
||||||
# 背景特效
|
# 背景特效
|
||||||
# 避免卡頓,建議只開啓一個
|
# 避免卡頓,建議只開啟一個
|
||||||
# canvas_ribbon 禁止彩帶背景
|
# canvas_ribbon 禁止彩帶背景
|
||||||
# See: https://github.com/hustcc/ribbon.js
|
# See: https://github.com/hustcc/ribbon.js
|
||||||
canvas_ribbon:
|
canvas_ribbon:
|
||||||
@@ -355,7 +443,7 @@ canvas_ribbon_piao:
|
|||||||
# https://github.com/hustcc/canvas-nest.js
|
# https://github.com/hustcc/canvas-nest.js
|
||||||
canvas_nest:
|
canvas_nest:
|
||||||
enable: false
|
enable: false
|
||||||
color: "0,0,255" #color of lines, default: '0,0,0'; RGB values: (R,G,B).(note: use ',' to separate.)
|
color: '0,0,255' #color of lines, default: '0,0,0'; RGB values: (R,G,B).(note: use ',' to separate.)
|
||||||
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
||||||
zIndex: -1 # z-index property of the background, default: -1.
|
zIndex: -1 # z-index property of the background, default: -1.
|
||||||
count: 99 # the number of lines, default: 99.
|
count: 99 # the number of lines, default: 99.
|
||||||
@@ -368,8 +456,8 @@ activate_power_mode:
|
|||||||
shake: true # 抖動特效
|
shake: true # 抖動特效
|
||||||
|
|
||||||
# 鼠標點擊效果
|
# 鼠標點擊效果
|
||||||
# 避免卡頓,建議只開啓一個
|
# 避免卡頓,建議只開啟一個
|
||||||
# 點擊烟火特效
|
# 點擊煙火特效
|
||||||
fireworks:
|
fireworks:
|
||||||
enable: false
|
enable: false
|
||||||
|
|
||||||
@@ -381,33 +469,22 @@ click_heart:
|
|||||||
ClickShowText:
|
ClickShowText:
|
||||||
enable: false
|
enable: false
|
||||||
text:
|
text:
|
||||||
- 富强
|
- I
|
||||||
- 民主
|
- LOVE
|
||||||
- 文明
|
- YOU
|
||||||
- 和谐
|
|
||||||
- 自由
|
|
||||||
- 平等
|
|
||||||
- 公正
|
|
||||||
- 法治
|
|
||||||
- 爱国
|
|
||||||
- 敬业
|
|
||||||
- 诚信
|
|
||||||
- 友善
|
|
||||||
fontSize: 15px
|
fontSize: 15px
|
||||||
|
|
||||||
# 頭像會一直轉圈
|
|
||||||
avatar_effect: false
|
|
||||||
|
|
||||||
# 網站顯示模式
|
# 網站顯示模式
|
||||||
# light 默認模式
|
# light 默認模式
|
||||||
# dark 黑暗模式(不建議)
|
# dark 黑暗模式(不建議)
|
||||||
display_mode: light
|
display_mode: light
|
||||||
|
|
||||||
# 美化post頁顯示
|
# 美化頁面顯示
|
||||||
post_beautify:
|
beautify:
|
||||||
enable: false
|
enable: false
|
||||||
|
field: post # site/post
|
||||||
title-prefix-icon: '\f0c1'
|
title-prefix-icon: '\f0c1'
|
||||||
title-prefix-icon-color: "#F47466"
|
title-prefix-icon-color: '#F47466'
|
||||||
|
|
||||||
# 全局字體
|
# 全局字體
|
||||||
font:
|
font:
|
||||||
@@ -428,42 +505,65 @@ hr:
|
|||||||
icon-top: -20px
|
icon-top: -20px
|
||||||
|
|
||||||
# 主頁subtitle
|
# 主頁subtitle
|
||||||
# 打字效果
|
|
||||||
subtitle:
|
subtitle:
|
||||||
enable: true
|
enable: true
|
||||||
|
# 打字效果
|
||||||
|
effect: true
|
||||||
|
# 循環或者只打字一次
|
||||||
|
loop: false
|
||||||
# source調用第三方服務
|
# source調用第三方服務
|
||||||
# source: false 關閉調用
|
# source: false 關閉調用
|
||||||
# source: 1 調用金山詞霸的每日一句(簡體)
|
# source: 1 調用搏天api的隨機語錄(簡體) https://api.btstu.cn/
|
||||||
# source: 2 調用一言网的一句話(簡體) #https://hitokoto.cn/
|
# source: 2 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||||
# source: 3 調用一句网(簡體) http://yijuzhan.com/
|
# source: 3 調用一句網(簡體) http://yijuzhan.com/
|
||||||
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
|
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||||
# subtitle 會先顯示 source , 再顯示 sub 的内容
|
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||||
source: false
|
source: false
|
||||||
# (如果有英文逗號' , ',請使用轉義字符 ,)
|
# (如果有英文逗號' , ',請使用轉義字符 ,)
|
||||||
|
# 如果關閉打字效果,subtitle只會顯示sub的第一行文字
|
||||||
sub:
|
sub:
|
||||||
- 今日事,今日畢
|
- 今日事,今日畢
|
||||||
- Never put off till tomorrow what you can do today
|
- Never put off till tomorrow what you can do today
|
||||||
|
|
||||||
|
# fontawesome圖標
|
||||||
|
# 默認使用的是 fontawesome v4版本的圖標
|
||||||
|
fontawesome_v5:
|
||||||
|
enable: false
|
||||||
|
|
||||||
|
# 加載動畫 Loading Animation
|
||||||
|
preloader: false
|
||||||
|
|
||||||
#### 側邊欄 ####
|
#### 側邊欄 ####
|
||||||
#-------------------------------------
|
#-------------------------------------
|
||||||
# 手機頁面( 顯示寬度 < 768px )是否顯示aside内容
|
|
||||||
aside_mobile: true
|
|
||||||
|
|
||||||
# 側邊欄顯示設置
|
# 側邊欄顯示設置
|
||||||
aside:
|
aside:
|
||||||
|
enable: true
|
||||||
|
mobile: true # 手機頁面( 顯示寬度 < 768px )是否顯示aside內容
|
||||||
position: right # left or right
|
position: right # left or right
|
||||||
card_author: true
|
card_author:
|
||||||
card_announcement: true
|
enable: true
|
||||||
card_recent_post: true
|
description:
|
||||||
card_categories: true
|
card_announcement:
|
||||||
card_tags: true
|
enable: true
|
||||||
card_archives: true
|
content: This is my Blog
|
||||||
|
card_recent_post:
|
||||||
|
enable: true
|
||||||
|
limit: 5 # if set 0 will show all
|
||||||
|
card_categories:
|
||||||
|
enable: true
|
||||||
|
limit: 8 # if set 0 will show all
|
||||||
|
card_tags:
|
||||||
|
enable: true
|
||||||
|
limit: 40 # if set 0 will show all
|
||||||
|
color: false
|
||||||
|
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
|
||||||
card_webinfo: true
|
card_webinfo: true
|
||||||
|
|
||||||
# 網站公告
|
|
||||||
announcement:
|
|
||||||
content: 感謝訪問本站,若喜歡請收藏 ^_^
|
|
||||||
|
|
||||||
# busuanzi count for PV / UV in site
|
# busuanzi count for PV / UV in site
|
||||||
# 訪問人數
|
# 訪問人數
|
||||||
busuanzi:
|
busuanzi:
|
||||||
@@ -485,30 +585,31 @@ translate:
|
|||||||
enable: true
|
enable: true
|
||||||
# 默認按鈕顯示文字
|
# 默認按鈕顯示文字
|
||||||
default: 繁
|
default: 繁
|
||||||
#网站默认语言,1: 繁體中文, 2: 简体中文
|
#網站默認語言,1: 繁體中文, 2: 簡體中文
|
||||||
defaultEncoding: 2
|
defaultEncoding: 2
|
||||||
#延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
#延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0
|
||||||
translateDelay: 0
|
translateDelay: 0
|
||||||
#博客网址
|
#博客網址
|
||||||
cookieDomain: "https://xxx/"
|
cookieDomain: 'https://xxx/'
|
||||||
#當文字是簡體時,按鈕顯示的文字
|
#當文字是簡體時,按鈕顯示的文字
|
||||||
msgToTraditionalChinese: "繁"
|
msgToTraditionalChinese: '繁'
|
||||||
#當文字是繁體時,按鈕顯示的文字
|
#當文字是繁體時,按鈕顯示的文字
|
||||||
msgToSimplifiedChinese: "简"
|
msgToSimplifiedChinese: '簡'
|
||||||
|
|
||||||
#閲讀模式
|
#閲讀模式
|
||||||
readmode:
|
readmode:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
# 夜間模式
|
# dark mode
|
||||||
darkmode:
|
darkmode:
|
||||||
enable: true
|
enable: true
|
||||||
|
# dark mode和 light mode切換按鈕
|
||||||
|
button: true
|
||||||
# 自動切換 dark mode和 light mode
|
# 自動切換 dark mode和 light mode
|
||||||
# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
|
# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
|
||||||
# autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
|
# autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
|
||||||
# autoChangeMode: false 取消自動切換
|
# autoChangeMode: false 取消自動切換
|
||||||
autoChangeMode: false
|
autoChangeMode: 1
|
||||||
|
|
||||||
#### other ####
|
#### other ####
|
||||||
#------------------------------------------------
|
#------------------------------------------------
|
||||||
@@ -532,8 +633,8 @@ fancybox:
|
|||||||
snackbar:
|
snackbar:
|
||||||
enable: false
|
enable: false
|
||||||
position: bottom-left
|
position: bottom-left
|
||||||
bg_light: "#49b1f5" #light mode時彈窗背景
|
bg_light: '#49b1f5' #light mode時彈窗背景
|
||||||
bg_dark: "#2d3035" #dark mode時彈窗背景
|
bg_dark: '#2d3035' #dark mode時彈窗背景
|
||||||
|
|
||||||
#百度推送
|
#百度推送
|
||||||
baidu_push:
|
baidu_push:
|
||||||
@@ -544,6 +645,12 @@ baidu_push:
|
|||||||
instantpage:
|
instantpage:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
|
# https://github.com/vinta/pangu.js
|
||||||
|
# 中英文之間添加空格
|
||||||
|
pangu:
|
||||||
|
enable: false
|
||||||
|
field: page # page/post
|
||||||
|
|
||||||
# Note (Bootstrap Callout)
|
# Note (Bootstrap Callout)
|
||||||
# https://muse.theme-next.org/docs/tag-plugins/note
|
# https://muse.theme-next.org/docs/tag-plugins/note
|
||||||
note:
|
note:
|
||||||
@@ -560,9 +667,8 @@ note:
|
|||||||
light_bg_offset: 0
|
light_bg_offset: 0
|
||||||
|
|
||||||
# 圖片懶加載
|
# 圖片懶加載
|
||||||
# https://github.com/aFarkas/lazysizes
|
# https://github.com/ApoorvSaxena/lozad.js
|
||||||
lazyload:
|
lazyload: false
|
||||||
enable: true
|
|
||||||
|
|
||||||
# 避免重複網址分散seo
|
# 避免重複網址分散seo
|
||||||
canonical: true
|
canonical: true
|
||||||
@@ -578,28 +684,34 @@ twitter_meta: true
|
|||||||
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
|
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
|
||||||
Open_Graph_meta: true
|
Open_Graph_meta: true
|
||||||
|
|
||||||
# CDN
|
# 開啟hexo自帶的緩存,加快生成速度
|
||||||
# 網站必須
|
fragment_cache: true
|
||||||
# 可根據需要自行添加js/css
|
|
||||||
CDN_USE:
|
|
||||||
css:
|
|
||||||
- /css/index.css
|
|
||||||
- https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
|
||||||
# - https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css #fontawesomeV5_css
|
|
||||||
|
|
||||||
js:
|
# inject
|
||||||
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js
|
# 插入代码到头部</head>之前 和 尾部</body>之前
|
||||||
- /js/utils.js
|
inject:
|
||||||
- /js/main.js
|
head:
|
||||||
|
# - <link rel="stylesheet" href="xxxxx">
|
||||||
|
bottom:
|
||||||
|
# - <script src="xxxx"></script>
|
||||||
|
|
||||||
# CDN
|
# CDN
|
||||||
# 非必要不要修改
|
# 非必要不要修改
|
||||||
CDN:
|
CDN:
|
||||||
|
# main
|
||||||
|
main_css: /css/index.css
|
||||||
|
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
||||||
|
main: /js/main.js
|
||||||
|
utils: /js/utils.js
|
||||||
|
|
||||||
# comments
|
# comments
|
||||||
blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js
|
blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js
|
||||||
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
|
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
|
||||||
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
|
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
|
||||||
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
|
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
|
||||||
|
disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js
|
||||||
|
disqusjs_css: https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css
|
||||||
|
utterances: https://utteranc.es/client.js
|
||||||
|
|
||||||
# share
|
# share
|
||||||
addtoany: https://static.addtoany.com/menu/page.js
|
addtoany: https://static.addtoany.com/menu/page.js
|
||||||
@@ -607,40 +719,51 @@ CDN:
|
|||||||
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css
|
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css
|
||||||
|
|
||||||
# search
|
# search
|
||||||
|
local_search: /js/search/local-search.js
|
||||||
|
algolia_js: /js/search/algolia.js
|
||||||
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js
|
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js
|
||||||
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
|
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
|
||||||
|
|
||||||
|
# math
|
||||||
mathjax: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
mathjax: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
||||||
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
||||||
katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js
|
katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js
|
||||||
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css
|
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css
|
||||||
|
mermaid: https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
|
||||||
|
|
||||||
#不蒜子計數器
|
# count
|
||||||
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
|
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
|
||||||
|
|
||||||
# 背景特效
|
# background effect
|
||||||
canvas_ribbon: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/canvas-ribbon.js
|
canvas_ribbon: /js/third-party/canvas-ribbon.js
|
||||||
canvas_ribbon_piao: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/piao.js
|
canvas_ribbon_piao: /js/third-party/piao.js
|
||||||
canvas_nest: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/canvas-nest.js
|
canvas_nest: /js/third-party/canvas-nest.js
|
||||||
|
|
||||||
lazyload: https://cdn.jsdelivr.net/npm/lazysizes@latest/lazysizes.min.js
|
lazyload: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
|
||||||
instantpage: https://cdn.jsdelivr.net/npm/instant.page@latest/instantpage.min.js
|
instantpage: https://cdn.jsdelivr.net/npm/instant.page@latest/instantpage.min.js
|
||||||
|
|
||||||
typed: https://cdn.jsdelivr.net/npm/typed.js
|
typed: https://cdn.jsdelivr.net/npm/typed.js
|
||||||
js_cookies: https://cdn.jsdelivr.net/npm/js-cookie/dist/js.cookie.min.js
|
js_cookies: https://cdn.jsdelivr.net/npm/js-cookie/dist/js.cookie.min.js
|
||||||
|
pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
|
||||||
|
|
||||||
|
# photo
|
||||||
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
||||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
|
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
|
||||||
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
|
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
|
||||||
|
|
||||||
|
# snackbar
|
||||||
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css
|
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css
|
||||||
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js
|
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js
|
||||||
|
|
||||||
#鼠标点击特效
|
# 鼠標點擊特效
|
||||||
anime: https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js
|
anime: https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js
|
||||||
activate_power_mode: https://cdn.jsdelivr.net/npm/activate-power-mode/dist/activate-power-mode.min.js
|
activate_power_mode: /js/third-party/activate-power-mode.js
|
||||||
fireworks: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/fireworks.js
|
fireworks: /js/third-party/fireworks.js
|
||||||
click_heart: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/click_heart.js
|
click_heart: /js/third-party/click_heart.js
|
||||||
ClickShowText: https://cdn.jsdelivr.net/gh/jerryc127/butterfly_cdn@2.1.0/js/ClickShowText.js
|
ClickShowText: /js/third-party/ClickShowText.js
|
||||||
|
|
||||||
|
# fontawesome
|
||||||
|
fontawesome_v4: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
||||||
|
fontawesome_v5: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
|
||||||
|
|
||||||
|
# 簡繁轉換
|
||||||
translate: /js/tw_cn.js
|
translate: /js/tw_cn.js
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ page:
|
|||||||
|
|
||||||
sticky: Sticky
|
sticky: Sticky
|
||||||
no_title: No title
|
no_title: No title
|
||||||
archives: Archives
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: Created
|
created: Created
|
||||||
@@ -27,12 +26,13 @@ post:
|
|||||||
wordcount: Word count
|
wordcount: Word count
|
||||||
min2read: "Reading time: %s min"
|
min2read: "Reading time: %s min"
|
||||||
page_pv: Post View
|
page_pv: Post View
|
||||||
comments: comments
|
comments: Comments
|
||||||
copyright:
|
copyright:
|
||||||
author: Author
|
author: Author
|
||||||
link: Link
|
link: Link
|
||||||
copyright_notice: Copyright Notice
|
copyright_notice: Copyright Notice
|
||||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||||
|
recommend: Recommend
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
@@ -61,21 +61,21 @@ aside:
|
|||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
card_bookmark: Add to bookmark
|
card_bookmark: Bookmark
|
||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: Info
|
headline: Info
|
||||||
article_name: Article
|
article_name: Article
|
||||||
runtime_name: Run time
|
runtime_name: Run time
|
||||||
|
site_wordcount: Total Count
|
||||||
site_uv_name: UV
|
site_uv_name: UV
|
||||||
site_pv_name: PV
|
site_pv_name: PV
|
||||||
|
more_button: More
|
||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
|
|
||||||
bookmark:
|
bookmark:
|
||||||
title: Bookmark
|
title: Bookmark
|
||||||
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: Read Mode
|
readmode_title: Read Mode
|
||||||
font_plus_title: Increase font size
|
font_plus_title: Increase font size
|
||||||
@@ -101,5 +101,8 @@ Snackbar:
|
|||||||
message_next: to bookmark this page
|
message_next: to bookmark this page
|
||||||
chs_to_cht: Traditional Chinese Activated Manually
|
chs_to_cht: Traditional Chinese Activated Manually
|
||||||
cht_to_chs: Simplified Chinese Activated Manually
|
cht_to_chs: Simplified Chinese Activated Manually
|
||||||
day_to_night: Light Mode Activated Manually
|
day_to_night: Dark Mode Activated Manually
|
||||||
night_to_day: Dark Mode Activated Manually
|
night_to_day: Light Mode Activated Manually
|
||||||
|
|
||||||
|
error_title: Page not found
|
||||||
|
loading: Loading...
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ page:
|
|||||||
|
|
||||||
sticky: Sticky
|
sticky: Sticky
|
||||||
no_title: No title
|
no_title: No title
|
||||||
archives: Archives
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: Created
|
created: Created
|
||||||
@@ -27,12 +26,13 @@ post:
|
|||||||
wordcount: Word count
|
wordcount: Word count
|
||||||
min2read: "Reading time: %s min"
|
min2read: "Reading time: %s min"
|
||||||
page_pv: Post View
|
page_pv: Post View
|
||||||
comments: comments
|
comments: Comments
|
||||||
copyright:
|
copyright:
|
||||||
author: Author
|
author: Author
|
||||||
link: Link
|
link: Link
|
||||||
copyright_notice: Copyright Notice
|
copyright_notice: Copyright Notice
|
||||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||||
|
recommend: Recommend
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
@@ -61,13 +61,15 @@ aside:
|
|||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
card_bookmark: Add to bookmark
|
card_bookmark: Bookmark
|
||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: Info
|
headline: Info
|
||||||
article_name: Article
|
article_name: Article
|
||||||
runtime_name: Run time
|
runtime_name: Run time
|
||||||
|
site_wordcount: Total Count
|
||||||
site_uv_name: UV
|
site_uv_name: UV
|
||||||
site_pv_name: PV
|
site_pv_name: PV
|
||||||
|
more_button: More
|
||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
@@ -99,5 +101,8 @@ Snackbar:
|
|||||||
message_next: to bookmark this page
|
message_next: to bookmark this page
|
||||||
chs_to_cht: Traditional Chinese Activated Manually
|
chs_to_cht: Traditional Chinese Activated Manually
|
||||||
cht_to_chs: Simplified Chinese Activated Manually
|
cht_to_chs: Simplified Chinese Activated Manually
|
||||||
day_to_night: Light Mode Activated Manually
|
day_to_night: Dark Mode Activated Manually
|
||||||
night_to_day: Dark Mode Activated Manually
|
night_to_day: Light Mode Activated Manually
|
||||||
|
|
||||||
|
error_title: Page not found
|
||||||
|
loading: Loading...
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ page:
|
|||||||
|
|
||||||
sticky: 置顶
|
sticky: 置顶
|
||||||
no_title: 无题
|
no_title: 无题
|
||||||
archives: 时间轴
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: 发表于
|
created: 发表于
|
||||||
@@ -32,7 +31,9 @@ post:
|
|||||||
author: 文章作者
|
author: 文章作者
|
||||||
link: 文章链接
|
link: 文章链接
|
||||||
copyright_notice: 版权声明
|
copyright_notice: 版权声明
|
||||||
copyright_content: '本博客所有文章除特别声明外,均采用 <a href="%s">%s</a> 许可协议。转载请注明来自 <a href="%s">%s</a>!'
|
copyright_content: '本博客所有文章除特别声明外,均采用
|
||||||
|
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来自 <a href="%s" target="_blank">%s</a>!'
|
||||||
|
recommend: 相关推荐
|
||||||
|
|
||||||
search: 搜索
|
search: 搜索
|
||||||
algolia_search:
|
algolia_search:
|
||||||
@@ -67,15 +68,16 @@ aside:
|
|||||||
headline: 网站资讯
|
headline: 网站资讯
|
||||||
article_name: 文章数目
|
article_name: 文章数目
|
||||||
runtime_name: 已运行时间
|
runtime_name: 已运行时间
|
||||||
|
site_wordcount: 本站总字数
|
||||||
site_uv_name: 本站访客数
|
site_uv_name: 本站访客数
|
||||||
site_pv_name: 本站总访问量
|
site_pv_name: 本站总访问量
|
||||||
|
more_button: 查看更多
|
||||||
|
|
||||||
donate: 打赏
|
donate: 打赏
|
||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加书签
|
title: 添加书签
|
||||||
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 阅读模式
|
readmode_title: 阅读模式
|
||||||
font_plus_title: 放大字体
|
font_plus_title: 放大字体
|
||||||
@@ -103,3 +105,6 @@ Snackbar:
|
|||||||
cht_to_chs: 你已切换为简体
|
cht_to_chs: 你已切换为简体
|
||||||
day_to_night: 你已切换为深色模式
|
day_to_night: 你已切换为深色模式
|
||||||
night_to_day: 你已切换为浅色模式
|
night_to_day: 你已切换为浅色模式
|
||||||
|
|
||||||
|
error_title: 页面没有找到
|
||||||
|
loading: 加载中...
|
||||||
@@ -9,43 +9,43 @@ footer:
|
|||||||
copy:
|
copy:
|
||||||
success: 複製成功
|
success: 複製成功
|
||||||
error: 複製錯誤
|
error: 複製錯誤
|
||||||
noSupport: 瀏覽器不支持
|
noSupport: 瀏覽器不支援
|
||||||
|
|
||||||
page:
|
page:
|
||||||
articles: 文章總覽
|
articles: 文章總覽
|
||||||
tag: 標籤
|
tag: 標籤
|
||||||
category: 分類
|
category: 分類
|
||||||
archives: 時間軸
|
archives: 歸檔
|
||||||
|
|
||||||
sticky: 置頂
|
sticky: 置頂
|
||||||
no_title: 無題
|
no_title: 無題
|
||||||
archives: 時間軸
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: 發表於
|
created: 發表於
|
||||||
updated: 更新於
|
updated: 更新於
|
||||||
wordcount: 字數總計
|
wordcount: 字數總計
|
||||||
min2read: "閲讀時長: %s 分鐘"
|
min2read: "閱讀時長: %s 分鐘"
|
||||||
page_pv: 閲讀量
|
page_pv: 閱讀量
|
||||||
comments: 評論數
|
comments: 評論數
|
||||||
copyright:
|
copyright:
|
||||||
author: 文章作者
|
author: 文章作者
|
||||||
link: 文章鏈接
|
link: 文章連結
|
||||||
copyright_notice: 版權聲明
|
copyright_notice: 版權聲明
|
||||||
copyright_content: '本博客所有文章除特別聲明外,均採用
|
copyright_content: '本部落格所有文章除特別聲明外,均採用
|
||||||
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
||||||
|
recommend: 相關推薦
|
||||||
|
|
||||||
search: 搜索
|
search: 搜尋
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜尋文章
|
||||||
hits_empty: "找不到您查詢的內容:${query}"
|
hits_empty: "找不到您查詢的內容:${query}"
|
||||||
hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
|
hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
|
||||||
|
|
||||||
local_search:
|
local_search:
|
||||||
label: 本地搜索
|
label: 本地搜尋
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜尋文章
|
||||||
hits_empty: "找不到您查詢的內容:${query}"
|
hits_empty: "找不到您查詢的內容:${query}"
|
||||||
powered: "提供支持"
|
powered: "提供支援"
|
||||||
by: 由
|
by: 由
|
||||||
|
|
||||||
pagination:
|
pagination:
|
||||||
@@ -67,34 +67,35 @@ aside:
|
|||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: 網站資訊
|
headline: 網站資訊
|
||||||
article_name: 文章數目
|
article_name: 文章數目
|
||||||
runtime_name: 已運行時間
|
runtime_name: 已執行時間
|
||||||
|
site_wordcount: 本站總字數
|
||||||
site_uv_name: 本站訪客數
|
site_uv_name: 本站訪客數
|
||||||
site_pv_name: 本站總訪問量
|
site_pv_name: 本站總訪問量
|
||||||
|
more_button: 檢視更多
|
||||||
|
|
||||||
donate: 打賞
|
donate: 打賞
|
||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加書籤
|
title: 新增書籤
|
||||||
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 閲讀模式
|
readmode_title: 閱讀模式
|
||||||
font_plus_title: 放大字體
|
font_plus_title: 放大字型
|
||||||
font_minus_title: 縮小字體
|
font_minus_title: 縮小字型
|
||||||
translate_title: 簡繁轉換
|
translate_title: 簡繁轉換
|
||||||
night_mode_title: 夜間模式
|
night_mode_title: 夜間模式
|
||||||
back_to_top: 回到頂部
|
back_to_top: 回到頂部
|
||||||
toc: 目錄
|
toc: 目錄
|
||||||
scroll_to_comment: 直達評論
|
scroll_to_comment: 直達評論
|
||||||
setting: 設置
|
setting: 設定
|
||||||
|
|
||||||
runtime_unit: 天
|
runtime_unit: 天
|
||||||
|
|
||||||
copy_copyright:
|
copy_copyright:
|
||||||
author: 作者
|
author: 作者
|
||||||
link: 鏈接
|
link: 連結
|
||||||
source: 來源
|
source: 來源
|
||||||
info: 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。
|
info: 著作權歸作者所有。商業轉載請聯絡作者獲得授權,非商業轉載請註明出處。
|
||||||
|
|
||||||
Snackbar:
|
Snackbar:
|
||||||
bookmark:
|
bookmark:
|
||||||
@@ -105,4 +106,6 @@ Snackbar:
|
|||||||
day_to_night: 你已切換為深色模式
|
day_to_night: 你已切換為深色模式
|
||||||
night_to_day: 你已切換為淺色模式
|
night_to_day: 你已切換為淺色模式
|
||||||
|
|
||||||
|
error_title: 頁面沒有找到
|
||||||
|
loading: 載入中...
|
||||||
|
|
||||||
|
|||||||
24
layout/404.pug
Normal file
24
layout/404.pug
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
- var top_img = theme.error_404.background || theme.default_top_img
|
||||||
|
- var bg_img = `background-image: url(${url_for(top_img)})`
|
||||||
|
|
||||||
|
doctype html
|
||||||
|
html(lang=config.language data-theme=theme.display_mode)
|
||||||
|
head
|
||||||
|
include includes/head.pug
|
||||||
|
body
|
||||||
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
if theme.fireworks && theme.fireworks.enable
|
||||||
|
canvas.fireworks
|
||||||
|
|
||||||
|
include includes/mobile-sidebar/index.pug
|
||||||
|
|
||||||
|
nav#nav.error-no-found(style=bg_img)
|
||||||
|
include includes/header/header.pug
|
||||||
|
#error_info.is-center
|
||||||
|
h1#error_title= '404'
|
||||||
|
#error_subtitle= theme.error_404.subtitle
|
||||||
|
include includes/rightside.pug
|
||||||
|
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||||
|
include includes/additional-js.pug
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
@@ -7,5 +6,3 @@ block content
|
|||||||
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
||||||
+articleSort(page.posts)
|
+articleSort(page.posts)
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
|
|||||||
@@ -2,18 +2,13 @@ extends includes/layout.pug
|
|||||||
|
|
||||||
block content
|
block content
|
||||||
if theme.category_ui == 'index'
|
if theme.category_ui == 'index'
|
||||||
include ./includes/mixins/UI.pug
|
include ./includes/mixins/post-ui.pug
|
||||||
#recent-posts.recent-posts.category_ui
|
#recent-posts.recent-posts.category_ui
|
||||||
+UI_NEW(page.posts)
|
+postUI
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
else
|
else
|
||||||
include ./includes/mixins/article-sort.pug
|
include ./includes/mixins/article-sort.pug
|
||||||
#category
|
#category
|
||||||
.article-sort-title= _p('page.category') + ' - ' + page.category
|
.article-sort-title= _p('page.category') + ' - ' + page.category
|
||||||
+articleSort(page.posts)
|
+articleSort(page.posts)
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
|
|
||||||
@@ -1,30 +1,21 @@
|
|||||||
.flink
|
#page
|
||||||
|
.flink#article-container
|
||||||
|
if site.data.link
|
||||||
each i in site.data.link
|
each i in site.data.link
|
||||||
h1= i.class_name
|
h2= i.class_name
|
||||||
.post-cards
|
.post-cards
|
||||||
ul.md-links
|
.md-links
|
||||||
each item in i.link_list
|
each item in i.link_list
|
||||||
li.md-links-item
|
.md-links-item
|
||||||
a(href=item.link title=item.name target="_blank")
|
a(href=url_for(item.link) title=item.name target="_blank")
|
||||||
if theme.lazyload.enable
|
if theme.lazyload
|
||||||
img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
img(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
||||||
else
|
else
|
||||||
img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
||||||
.md-links-title= item.name
|
.md-links-title= item.name
|
||||||
.md-links-des= item.descr
|
.md-links-des= item.descr
|
||||||
|
!= page.content
|
||||||
hr
|
if page.comments !== false
|
||||||
div
|
include includes/comments/index.pug
|
||||||
h2= theme.Flink.info_headline
|
|
||||||
ul
|
|
||||||
li= theme.Flink.name
|
|
||||||
li= theme.Flink.address
|
|
||||||
li= theme.Flink.avatar
|
|
||||||
li= theme.Flink.info
|
|
||||||
|
|
||||||
hr
|
|
||||||
.comment_int
|
|
||||||
p.comment-word= theme.Flink.comment
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
script(src=url_for(theme.CDN.jquery))
|
||||||
|
script(src=url_for(theme.CDN.utils))
|
||||||
|
script(src=url_for(theme.CDN.main))
|
||||||
|
|
||||||
|
if theme.translate && theme.translate.enable
|
||||||
|
script(src=url_for(theme.CDN.translate))
|
||||||
|
|
||||||
if (theme.medium_zoom && theme.medium_zoom.enable)
|
if (theme.medium_zoom && theme.medium_zoom.enable)
|
||||||
script(src=url_for(theme.CDN.medium_zoom))
|
script(src=url_for(theme.CDN.medium_zoom))
|
||||||
|
|
||||||
@@ -23,28 +30,20 @@ if (theme.canvas_nest && theme.canvas_nest.enable)
|
|||||||
include ./third-party/canvas-nest.pug
|
include ./third-party/canvas-nest.pug
|
||||||
|
|
||||||
if theme.activate_power_mode.enable
|
if theme.activate_power_mode.enable
|
||||||
- var colorful = theme.activate_power_mode.colorful == false ? false : true
|
|
||||||
- var shake = theme.activate_power_mode.shake == false ? false : true
|
|
||||||
script(src=url_for(theme.CDN.activate_power_mode))
|
script(src=url_for(theme.CDN.activate_power_mode))
|
||||||
script.
|
script.
|
||||||
POWERMODE.colorful = !{colorful};
|
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||||
POWERMODE.shake = !{shake};
|
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||||
document.body.addEventListener('input', POWERMODE);
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
|
||||||
if theme.translate && theme.translate.enable
|
|
||||||
script(src=url_for(theme.CDN.translate))
|
|
||||||
|
|
||||||
if is_home()
|
|
||||||
include index-js.pug
|
|
||||||
|
|
||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async src=url_for(theme.CDN.busuanzi))
|
script(async src=url_for(theme.CDN.busuanzi))
|
||||||
|
|
||||||
if theme.instantpage.enable
|
if theme.instantpage.enable
|
||||||
script(src=url_for(theme.CDN.instantpage) type="module")
|
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||||
|
|
||||||
if theme.lazyload.enable
|
if theme.lazyload
|
||||||
script(src=url_for(theme.CDN.lazyload) async="")
|
script(src=url_for(theme.CDN.lazyload))
|
||||||
|
|
||||||
//- 鼠標特效
|
//- 鼠標特效
|
||||||
if theme.click_heart && theme.click_heart.enable
|
if theme.click_heart && theme.click_heart.enable
|
||||||
@@ -52,3 +51,24 @@ if theme.click_heart && theme.click_heart.enable
|
|||||||
|
|
||||||
if theme.ClickShowText && theme.ClickShowText.enable
|
if theme.ClickShowText && theme.ClickShowText.enable
|
||||||
script(src=url_for(theme.CDN.ClickShowText))
|
script(src=url_for(theme.CDN.ClickShowText))
|
||||||
|
|
||||||
|
if theme.pangu && theme.pangu.enable
|
||||||
|
include ./third-party/pangu.pug
|
||||||
|
|
||||||
|
//- search
|
||||||
|
if theme.algolia_search && theme.algolia_search.enable
|
||||||
|
script(src=url_for(theme.CDN.algolia_js))
|
||||||
|
else if theme.local_search && theme.local_search.enable
|
||||||
|
script(src=url_for(theme.CDN.local_search))
|
||||||
|
|
||||||
|
//- mermaid
|
||||||
|
if theme.mermaid.enable
|
||||||
|
include ./math/mermaid.pug
|
||||||
|
|
||||||
|
if is_home()
|
||||||
|
include ./head/subtitle.pug
|
||||||
|
|
||||||
|
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||||
|
|
||||||
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||||
@@ -1,13 +1,24 @@
|
|||||||
if theme.disqus && theme.disqus.enable
|
|
||||||
#disqus_thread
|
#disqus_thread
|
||||||
script.
|
script.
|
||||||
var unused = null;
|
|
||||||
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 = '!{ page.title }';
|
||||||
}
|
};
|
||||||
|
(function() {
|
||||||
var d = document, s = d.createElement('script');
|
var d = document, s = d.createElement('script');
|
||||||
s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js";
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
|
||||||
s.setAttribute('data-timestamp', '' + +new Date());
|
s.setAttribute('data-timestamp', +new Date());
|
||||||
(d.head || d.body).appendChild(s);
|
(d.head || d.body).appendChild(s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
if is_post() && theme.disqus.count
|
||||||
|
script.
|
||||||
|
function getDisqusCount() {
|
||||||
|
var d = document, s = d.createElement('script');
|
||||||
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
||||||
|
s.id = 'dsq-count-scr';
|
||||||
|
(d.head || d.body).appendChild(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', getDisqusCount, false);
|
||||||
24
layout/includes/comments/disqusjs.pug
Normal file
24
layout/includes/comments/disqusjs.pug
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#disqus_thread
|
||||||
|
script(src=url_for(theme.CDN.disqusjs))
|
||||||
|
script.
|
||||||
|
var dsqjs = new DisqusJS({
|
||||||
|
shortname: '!{theme.disqusjs.shortname}',
|
||||||
|
siteName: "!{theme.disqusjs.siteName}",
|
||||||
|
identifier: '!{ page.path }',
|
||||||
|
url: '!{ page.permalink }',
|
||||||
|
title: '!{ page.title }',
|
||||||
|
api: '!{theme.disqusjs.api}',
|
||||||
|
apikey: '!{theme.disqusjs.apikey}',
|
||||||
|
admin: '!{theme.disqusjs.admin}',
|
||||||
|
adminLabel: '!{theme.disqusjs.adminLabel}'
|
||||||
|
});
|
||||||
|
|
||||||
|
if is_post() && theme.disqusjs.count
|
||||||
|
script.
|
||||||
|
function getDisqusCount() {
|
||||||
|
var d = document, s = d.createElement('script');
|
||||||
|
s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
|
||||||
|
s.id = 'dsq-count-scr';
|
||||||
|
(d.head || d.body).appendChild(s);
|
||||||
|
}
|
||||||
|
window.addEventListener('load', getDisqusCount, false);
|
||||||
12
layout/includes/comments/facebook_comments.pug
Normal file
12
layout/includes/comments/facebook_comments.pug
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#fb-root
|
||||||
|
script(async defer crossorigin="anonymous" src=`https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v6.0`)
|
||||||
|
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
|
||||||
|
data-href=urlNoIndex()
|
||||||
|
data-numposts= theme.facebook_comments.pageSize || 10
|
||||||
|
data-order-by= theme.facebook_comments.order_by || 'social'
|
||||||
|
data-width="100%")
|
||||||
|
|
||||||
|
if theme.darkmode.enable
|
||||||
|
script.
|
||||||
|
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||||
|
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
if theme.gitalk && theme.gitalk.enable
|
|
||||||
#gitalk-container
|
#gitalk-container
|
||||||
script.
|
script.
|
||||||
var gitalk = new Gitalk({
|
var gitalk = new Gitalk({
|
||||||
@@ -6,15 +5,23 @@ if theme.gitalk && theme.gitalk.enable
|
|||||||
clientSecret: '!{theme.gitalk.client_secret}',
|
clientSecret: '!{theme.gitalk.client_secret}',
|
||||||
repo: '!{theme.gitalk.repo}',
|
repo: '!{theme.gitalk.repo}',
|
||||||
owner: '!{theme.gitalk.owner}',
|
owner: '!{theme.gitalk.owner}',
|
||||||
admin: '!{theme.gitalk.admin}',
|
admin: ['!{theme.gitalk.admin}'],
|
||||||
id: md5(decodeURI(location.pathname)),
|
id: md5(decodeURI(location.pathname)),
|
||||||
language: '!{theme.gitalk.language}',
|
language: '!{theme.gitalk.language}',
|
||||||
|
perPage: !{theme.gitalk.perPage},
|
||||||
|
distractionFreeMode: !{theme.gitalk.distractionFreeMode},
|
||||||
|
pagerDirection: '!{theme.gitalk.pagerDirection}',
|
||||||
|
createIssueManually: !{theme.gitalk.createIssueManually},
|
||||||
updateCountCallback: commentCount
|
updateCountCallback: commentCount
|
||||||
})
|
})
|
||||||
gitalk.render('gitalk-container')
|
gitalk.render('gitalk-container')
|
||||||
|
|
||||||
function commentCount(n){
|
function commentCount(n){
|
||||||
|
try {
|
||||||
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
- var d = theme.disqus && theme.disqus.enable
|
- var d = theme.disqus && theme.disqus.enable
|
||||||
|
- var dj = theme.disqusjs && theme.disqusjs.enable
|
||||||
- var l = theme.laibili && theme.laibili.enable
|
- var l = theme.laibili && theme.laibili.enable
|
||||||
- var gt = theme.gitalk && theme.gitalk.enable
|
- var gt = theme.gitalk && theme.gitalk.enable
|
||||||
- var v = theme.valine && theme.valine.enable
|
- var v = theme.valine && theme.valine.enable
|
||||||
|
- var u = theme.utterances && theme.utterances.enable
|
||||||
|
- var fb = theme.facebook_comments && theme.facebook_comments.enable
|
||||||
|
- var isComment = d || dj || l || gt || v || u || fb
|
||||||
|
|
||||||
if d || l || gt || v
|
if isComment
|
||||||
hr
|
hr
|
||||||
#post-comment
|
#post-comment
|
||||||
.comment_headling
|
.comment_headling
|
||||||
@@ -11,9 +15,15 @@ if d || l || gt || v
|
|||||||
span= ' ' + _p('comment')
|
span= ' ' + _p('comment')
|
||||||
if d
|
if d
|
||||||
include ./disqus.pug
|
include ./disqus.pug
|
||||||
|
else if dj
|
||||||
|
include ./disqusjs.pug
|
||||||
else if l
|
else if l
|
||||||
include ./laibili.pug
|
include ./laibili.pug
|
||||||
else if gt
|
else if gt
|
||||||
include ./gitalk.pug
|
include ./gitalk.pug
|
||||||
else if v
|
else if v
|
||||||
include ./valine.pug
|
include ./valine.pug
|
||||||
|
else if u
|
||||||
|
include ./utterances.pug
|
||||||
|
else if fb
|
||||||
|
include ./facebook_comments.pug
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
if theme.laibili && theme.laibili.enable
|
|
||||||
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
||||||
script.
|
script.
|
||||||
(function(d, s) {
|
(function(d, s) {
|
||||||
|
|||||||
21
layout/includes/comments/utterances.pug
Normal file
21
layout/includes/comments/utterances.pug
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
script#utterances_comment(src=theme.CDN.utterances
|
||||||
|
repo=theme.utterances.repo
|
||||||
|
issue-term=theme.utterances.issue_term
|
||||||
|
theme= theme.display_mode === 'dark' ? theme.utterances.dark_theme : theme.utterances.light_theme
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async)
|
||||||
|
|
||||||
|
if theme.darkmode.enable
|
||||||
|
script.
|
||||||
|
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||||
|
document.getElementById('utterances_comment').setAttribute('theme',themeNow)
|
||||||
|
|
||||||
|
function utterancesTheme () {
|
||||||
|
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||||
|
const message = {
|
||||||
|
type: 'set-theme',
|
||||||
|
theme: theme
|
||||||
|
};
|
||||||
|
const iframe = document.querySelector('.utterances-frame');
|
||||||
|
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||||
|
}
|
||||||
@@ -1,25 +1,37 @@
|
|||||||
if theme.valine && theme.valine.enable
|
- let emojiMaps = '""'
|
||||||
|
if site.data.valine
|
||||||
|
- emojiMaps = JSON.stringify(site.data.valine)
|
||||||
|
|
||||||
#vcomment.vcomment
|
#vcomment.vcomment
|
||||||
script(src=url_for(theme.CDN.valine))
|
script(src=url_for(theme.CDN.valine))
|
||||||
script.
|
script.
|
||||||
var notify = #{ theme.valine.notify } == true ? true : false;
|
var requestSetting = function (from,set) {
|
||||||
var verify = #{ theme.valine.verify } == true ? true : false;
|
var from = from
|
||||||
var GUEST_INFO = ['nick','mail','link'];
|
var setting = set.split(',').filter(function(item){
|
||||||
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
|
return from.indexOf(item) > -1
|
||||||
return GUEST_INFO.indexOf(item) > -1
|
|
||||||
});
|
});
|
||||||
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
|
setting = setting.length == 0 ? from :setting;
|
||||||
|
return setting
|
||||||
|
}
|
||||||
|
|
||||||
|
var guestInfo = requestSetting(['nick','mail','link'],'#{ theme.valine.guest_info }')
|
||||||
|
var requiredFields = requestSetting(['nick','mail','link'],'#{ theme.valine.requiredFields }')
|
||||||
|
|
||||||
window.valine = new Valine({
|
window.valine = new Valine({
|
||||||
el:'#vcomment',
|
el:'#vcomment',
|
||||||
notify:notify,
|
|
||||||
verify:verify,
|
|
||||||
appId: '#{theme.valine.appId}',
|
appId: '#{theme.valine.appId}',
|
||||||
appKey: '#{theme.valine.appKey}',
|
appKey: '#{theme.valine.appKey}',
|
||||||
|
notify: #{theme.valine.notify},
|
||||||
|
verify: #{theme.valine.verify},
|
||||||
placeholder: '#{theme.valine.placeholder}',
|
placeholder: '#{theme.valine.placeholder}',
|
||||||
avatar: '#{theme.valine.avatar}',
|
avatar: '#{theme.valine.avatar}',
|
||||||
guest_info:guest_info,
|
meta: guestInfo,
|
||||||
pageSize: '#{theme.valine.pageSize}',
|
pageSize: '#{theme.valine.pageSize}',
|
||||||
lang: '#{theme.valine.lang}',
|
lang: '#{theme.valine.lang}',
|
||||||
recordIP: true
|
recordIP: #{theme.valine.recordIP},
|
||||||
|
serverURLs: '#{theme.valine.serverURLs}',
|
||||||
|
emojiCDN: '#{theme.valine.emojiCDN}',
|
||||||
|
emojiMaps: !{emojiMaps},
|
||||||
|
enableQQ: #{theme.valine.enableQQ},
|
||||||
|
requiredFields: requiredFields
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
if theme.footer_copyright.enable
|
if theme.footer_copyright.enable
|
||||||
.framework-info
|
.framework-info
|
||||||
span= _p('footer.driven') + ' '
|
span= _p('footer.driven') + ' '
|
||||||
a(href='http://hexo.io')
|
a(href='https://hexo.io')
|
||||||
span Hexo
|
span Hexo
|
||||||
span.footer-separator |
|
span.footer-separator |
|
||||||
span= _p('footer.theme') + ' '
|
span= _p('footer.theme') + ' '
|
||||||
|
|||||||
@@ -1,46 +1,68 @@
|
|||||||
if is_home()
|
- var pageTitle
|
||||||
- var top_img = theme.index_img || theme.default_top_img
|
- if (is_archive()) pageTitle = _p('page.archives')
|
||||||
else if is_archive()
|
- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||||
- var top_img = theme.archive_img || theme.default_top_img
|
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||||
else if is_tag()
|
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||||
- var top_img = theme.tag_img || theme.default_top_img
|
- else if (is_year()) pageTitle += ': ' + page.year
|
||||||
else if is_category()
|
- else if (is_current('/404.html', [strict])) pageTitle = _p('error_title')
|
||||||
- var top_img = theme.category_img || theme.default_top_img
|
- else pageTitle = page.title || config.title || ''
|
||||||
else if is_current('/movies/', [strict])
|
|
||||||
- var top_img = theme.movies_img || theme.default_top_img
|
|
||||||
else if !is_post()
|
|
||||||
- var top_img = page.top_img || theme.default_top_img
|
|
||||||
|
|
||||||
- var without_index = url.replace('index.html', '')
|
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||||
- var without_html = without_index.replace('.html', '')
|
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||||
|
|
||||||
//- 預解析
|
- var pageDescription = page_description()
|
||||||
include ./head/dns_prefetch.pug
|
- var pageKeywords
|
||||||
|
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||||||
|
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||||
|
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||||
|
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||||
|
- var pageCopyright = config.copyright || config.author
|
||||||
|
|
||||||
//- PWA
|
meta(charset='UTF-8')
|
||||||
if (theme.pwa && theme.pwa.enable)
|
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||||
include ./head/pwa.pug
|
meta(name="viewport" content="width=device-width,initial-scale=1")
|
||||||
|
title= tabTitle
|
||||||
//- 網站驗證
|
meta(name="description" content!=pageDescription)
|
||||||
include ./head/site_verification.pug
|
if pageKeywords
|
||||||
|
meta(name="keywords" content=pageKeywords)
|
||||||
//- Open_Graph
|
meta(name="author" content=pageAuthor)
|
||||||
include ./head/Open_Graph.pug
|
meta(name="copyright" content=pageCopyright)
|
||||||
|
meta(name ="format-detection" content="telephone=no")
|
||||||
|
!=favicon_tag(theme.favicon || config.favicon)
|
||||||
|
|
||||||
if theme.disable_baidu_transformation
|
if theme.disable_baidu_transformation
|
||||||
meta(http-equiv="Cache-Control" content="no-transform")
|
meta(http-equiv="Cache-Control" content="no-transform")
|
||||||
meta(http-equiv="Cache-Control" content="no-siteapp")
|
meta(http-equiv="Cache-Control" content="no-siteapp")
|
||||||
|
|
||||||
if page.hide == true
|
if theme.douban
|
||||||
meta(name="robots" content="noindex")
|
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
|
||||||
|
meta(name="referrer" content="no-referrer")
|
||||||
|
|
||||||
|
//- 預解析
|
||||||
|
!=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
//- 網站驗證
|
||||||
|
!=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
//- Open_Graph
|
||||||
|
include ./head/Open_Graph.pug
|
||||||
|
|
||||||
|
//- PWA
|
||||||
|
if (theme.pwa && theme.pwa.enable)
|
||||||
|
!=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
script(src=url_for(theme.CDN.js_cookies))
|
script(src=url_for(theme.CDN.js_cookies))
|
||||||
|
|
||||||
if (theme.darkmode && theme.darkmode.enable) || theme.autoChangeMode !== false
|
if theme.darkmode.enable
|
||||||
include ./head/darkmode.pug
|
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
each item in theme.CDN_USE.css
|
//- main css
|
||||||
link(rel='stylesheet', href=url_for(item))
|
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
|
||||||
|
|
||||||
|
if theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
|
||||||
|
else
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
|
||||||
|
|
||||||
if (theme.fancybox && theme.fancybox.enable)
|
if (theme.fancybox && theme.fancybox.enable)
|
||||||
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
||||||
@@ -49,7 +71,7 @@ if (theme.snackbar && theme.snackbar.enable)
|
|||||||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
||||||
|
|
||||||
if theme.canonical
|
if theme.canonical
|
||||||
link(rel="canonical" href=without_html)
|
link(rel="canonical" href=urlNoIndex())
|
||||||
|
|
||||||
if is_post()
|
if is_post()
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
@@ -61,19 +83,22 @@ if theme.algolia_search.enable
|
|||||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
|
||||||
script(src=url_for(theme.CDN.algolia_search) defer)
|
script(src=url_for(theme.CDN.algolia_search) defer)
|
||||||
|
|
||||||
if (theme.gitalk && theme.gitalk.enable)
|
//- comment css
|
||||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
|
include ./head/comment.pug
|
||||||
script(src=url_for(theme.CDN.gitalk) defer)
|
|
||||||
script(src=url_for(theme.CDN.blueimp_md5) defer)
|
|
||||||
|
|
||||||
//- google_adsense
|
//- google_adsense
|
||||||
include ./head/google_adsense.pug
|
!=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
//- analytics
|
//- analytics
|
||||||
include ./head/analytics.pug
|
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if !is_post()
|
|
||||||
link(rel="preload" href=url_for(top_img) as="image" )
|
|
||||||
|
|
||||||
if theme.blog_title_font.font_link
|
if theme.blog_title_font.font_link
|
||||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||||
|
|
||||||
|
//- global config
|
||||||
|
!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
include ./head/config_site.pug
|
||||||
|
include ./head/noscript.pug
|
||||||
|
|
||||||
|
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
- var photo_check = is_post() ? page.cover || theme.avatar : theme.avatar
|
|
||||||
- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
|
||||||
- var contentType = is_post() ? 'article' : 'website'
|
- var contentType = is_post() ? 'article' : 'website'
|
||||||
|
|
||||||
//- twitter meta
|
//- twitter meta
|
||||||
if theme.twitter_meta
|
if theme.twitter_meta
|
||||||
meta(name="twitter:card" content="summary")
|
meta(name="twitter:card" content="summary")
|
||||||
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
meta(name="twitter:title" content=pageTitle)
|
||||||
meta(name="twitter:description" content=pageDescription)
|
meta(name="twitter:description" content!=pageDescription)
|
||||||
meta(name="twitter:image" content=photo_link)
|
meta(name="twitter:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||||
|
|
||||||
//- Open_Graph
|
//- Open_Graph
|
||||||
if theme.Open_Graph_meta
|
if theme.Open_Graph_meta
|
||||||
meta(property="og:type" content=contentType)
|
meta(property="og:type" content=contentType)
|
||||||
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
meta(property="og:title" content=pageTitle)
|
||||||
meta(property="og:url" content=without_html)
|
meta(property="og:url" content=urlNoIndex())
|
||||||
meta(property="og:site_name" content=config.title)
|
meta(property="og:site_name" content=config.title)
|
||||||
meta(property="og:description" content=pageDescription)
|
meta(property="og:description" content!=pageDescription)
|
||||||
meta(property="og:image" content=photo_link)
|
meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||||
|
meta(property="article:published_time" content=date_xml(page.date))
|
||||||
|
meta(property="article:modified_time" content=date_xml(page.updated))
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ if theme.google_analytics
|
|||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
|
||||||
if theme.tencent_analytics
|
if theme.tencent_analytics
|
||||||
script(src=`http://tajs.qq.com/stats?sId=` + theme.tencent_analytics charset="UTF-8")
|
script(src=`https://tajs.qq.com/stats?sId=${theme.tencent_analytics}` charset="UTF-8")
|
||||||
|
|||||||
14
layout/includes/head/comment.pug
Normal file
14
layout/includes/head/comment.pug
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
if (theme.facebook_comments.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
if theme.facebook_comments.app_id
|
||||||
|
meta(property="fb:app_id" content=theme.facebook_comments.app_id )
|
||||||
|
if theme.facebook_comments.user_id
|
||||||
|
meta(property="fb:admins" content=theme.facebook_comments.user_id)
|
||||||
|
|
||||||
|
if (theme.disqusjs && theme.disqusjs.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))
|
||||||
|
|
||||||
|
if (theme.gitalk && theme.gitalk.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
|
||||||
|
script(src=url_for(theme.CDN.gitalk))
|
||||||
|
script(src=url_for(theme.CDN.blueimp_md5))
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
copyright = JSON.stringify({
|
copyright = JSON.stringify({
|
||||||
languages: {
|
languages: {
|
||||||
author: _p("copy_copyright.author") + ': ' + config.author,
|
author: _p("copy_copyright.author") + ': ' + config.author,
|
||||||
link: _p("copy_copyright.link") + ': ' + without_html,
|
link: _p("copy_copyright.link") + ': ',
|
||||||
source: _p("copy_copyright.source") + ': ' + config.title,
|
source: _p("copy_copyright.source") + ': ' + config.title,
|
||||||
info: _p("copy_copyright.info")
|
info: _p("copy_copyright.info")
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,6 @@
|
|||||||
if (theme.snackbar && theme.snackbar.enable) {
|
if (theme.snackbar && theme.snackbar.enable) {
|
||||||
Snackbar = JSON.stringify({
|
Snackbar = JSON.stringify({
|
||||||
bookmark: {
|
bookmark: {
|
||||||
title: _p("Snackbar.bookmark.title"),
|
|
||||||
message_prev: _p("Snackbar.bookmark.message_prev"),
|
message_prev: _p("Snackbar.bookmark.message_prev"),
|
||||||
message_next: _p("Snackbar.bookmark.message_next")
|
message_next: _p("Snackbar.bookmark.message_next")
|
||||||
},
|
},
|
||||||
@@ -76,14 +75,6 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var runtime = theme.runtimeshow.enable
|
|
||||||
var fancybox = theme.fancybox.enable
|
|
||||||
var medium_zoom = theme.medium_zoom.enable
|
|
||||||
var baiduPush = theme.baidu_push && theme.baidu_push.enable
|
|
||||||
var isHome = is_home() ? true : false
|
|
||||||
var isPost = is_post() ? true : false
|
|
||||||
|
|
||||||
|
|
||||||
script.
|
script.
|
||||||
var GLOBAL_CONFIG = {
|
var GLOBAL_CONFIG = {
|
||||||
root: '!{config.root}',
|
root: '!{config.root}',
|
||||||
@@ -96,20 +87,24 @@ script.
|
|||||||
noSupport: '!{_p("copy.noSupport")}'
|
noSupport: '!{_p("copy.noSupport")}'
|
||||||
},
|
},
|
||||||
bookmark: {
|
bookmark: {
|
||||||
title: '!{_p("Snackbar.bookmark.title")}',
|
|
||||||
message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
|
message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
|
||||||
message_next: '!{_p("Snackbar.bookmark.message_next")}'
|
message_next: '!{_p("Snackbar.bookmark.message_next")}'
|
||||||
},
|
},
|
||||||
runtime_unit: '!{_p("runtime_unit")}',
|
runtime_unit: '!{_p("runtime_unit")}',
|
||||||
runtime: !{runtime},
|
runtime: !{theme.runtimeshow.enable},
|
||||||
copyright: !{copyright},
|
copyright: !{copyright},
|
||||||
ClickShowText: !{ClickShowText},
|
ClickShowText: !{ClickShowText},
|
||||||
medium_zoom: !{medium_zoom},
|
medium_zoom: !{theme.medium_zoom.enable},
|
||||||
fancybox: !{fancybox},
|
fancybox: !{theme.fancybox.enable},
|
||||||
Snackbar: !{Snackbar},
|
Snackbar: !{Snackbar},
|
||||||
baiduPush: !{baiduPush},
|
baiduPush: !{theme.baidu_push && theme.baidu_push.enable},
|
||||||
isHome: !{isHome},
|
highlightCopy: !{theme.highlight_copy},
|
||||||
isPost: !{isPost}
|
highlightLang: !{theme.highlight_lang},
|
||||||
|
highlightShrink: '!{theme.highlight_shrink}',
|
||||||
|
isFontAwesomeV5: !{theme.fontawesome_v5 && theme.fontawesome_v5.enable},
|
||||||
|
isPhotoFigcaption: !{theme.photofigcaption},
|
||||||
|
islazyload: !{theme.lazyload},
|
||||||
|
isanchor: !{theme.anchor}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
7
layout/includes/head/config_site.pug
Normal file
7
layout/includes/head/config_site.pug
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
script.
|
||||||
|
var GLOBAL_CONFIG_SITE = {
|
||||||
|
isPost: !{is_post()},
|
||||||
|
isHome: !{is_home()},
|
||||||
|
isSidebar: !{is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,26 +1,25 @@
|
|||||||
script.
|
script.
|
||||||
const autoChangeMode = '#{theme.autoChangeMode}'
|
var autoChangeMode = '#{theme.darkmode.autoChangeMode}'
|
||||||
var t = Cookies.get("theme");
|
var t = Cookies.get("theme")
|
||||||
if (autoChangeMode == '1'){
|
if (autoChangeMode == '1'){
|
||||||
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
var isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||||
const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
|
var isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
|
||||||
const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
|
var isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
|
||||||
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
var hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||||
|
|
||||||
if (t === undefined){
|
if (t === undefined){
|
||||||
if (isLightMode) activateLightMode()
|
if (isLightMode) activateLightMode()
|
||||||
else if (isDarkMode) activateDarkMode()
|
else if (isDarkMode) activateDarkMode()
|
||||||
else if (isNotSpecified || hasNoSupport){
|
else if (isNotSpecified || hasNoSupport){
|
||||||
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
|
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
|
||||||
now = new Date();
|
var now = new Date()
|
||||||
hour = now.getHours();
|
var hour = now.getHours()
|
||||||
isNight = hour < 6 || hour >= 18
|
var isNight = hour < 6 || hour >= 18
|
||||||
isNight ? activateDarkMode() : activateLightMode()
|
isNight ? activateDarkMode() : activateLightMode()
|
||||||
}
|
}
|
||||||
} else if (t == 'light') activateLightMode()
|
} else if (t == 'light') activateLightMode()
|
||||||
else activateDarkMode()
|
else activateDarkMode()
|
||||||
|
|
||||||
|
|
||||||
} else if (autoChangeMode == '2'){
|
} else if (autoChangeMode == '2'){
|
||||||
now = new Date();
|
now = new Date();
|
||||||
hour = now.getHours();
|
hour = now.getHours();
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||||
|
link(rel="dns-prefetch" href="//cdn.jsdelivr.net")
|
||||||
|
|
||||||
if theme.google_analytics
|
if theme.google_analytics
|
||||||
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
|
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
|
||||||
|
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
||||||
|
|
||||||
if theme.baidu_analytics
|
if theme.baidu_analytics
|
||||||
link(rel="preconnect" href="https://hm.baidu.com")
|
link(rel="preconnect" href="https://hm.baidu.com")
|
||||||
|
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
||||||
|
|
||||||
if theme.tencent_analytics
|
if theme.tencent_analytics
|
||||||
link(rel="preconnect" href="http://ta.qq.com")
|
link(rel="preconnect" href="http://ta.qq.com")
|
||||||
|
link(rel="dns-prefetch" href="http://ta.qq.com")
|
||||||
|
|
||||||
if theme.blog_title_font.font_link
|
if theme.blog_title_font.font_link
|
||||||
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
|
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
|
||||||
|
link(rel="dns-prefetch" href="https://fonts.googleapis.com")
|
||||||
|
|
||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||||
|
link(rel="dns-prefetch" href="//busuanzi.ibruce.info")
|
||||||
|
|||||||
9
layout/includes/head/noscript.pug
Normal file
9
layout/includes/head/noscript.pug
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
noscript.
|
||||||
|
<style>
|
||||||
|
#page-header {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
.justified-gallery img{
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
</style>
|
||||||
130
layout/includes/head/subtitle.pug
Normal file
130
layout/includes/head/subtitle.pug
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
if theme.subtitle.enable
|
||||||
|
- var source = theme.subtitle.source
|
||||||
|
- var subtitleEffect = theme.subtitle.effect
|
||||||
|
|
||||||
|
if subtitleEffect
|
||||||
|
script(src=url_for(theme.CDN.typed))
|
||||||
|
|
||||||
|
if source == '1'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',)
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json()
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||||
|
var both = sub.unshift(data.text)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = data.text
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '2'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
fetch('https://v1.hitokoto.cn')
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json()
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var from = '出自 ' + data.from
|
||||||
|
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||||
|
var both = sub.unshift(data.hitokoto, from)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '3'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
loadScript('http://yijuzhan.com/api/word.php?m=js', function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
var con = str[0]
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var from = '出自 ' + str[1]
|
||||||
|
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||||
|
var both = sub.unshift(con, from)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = con
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '4'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
loadScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
jinrishici.load(function (result) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||||
|
var content = result.data.content
|
||||||
|
var both = sub.unshift(content)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = result.data.content
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else
|
||||||
|
script.
|
||||||
|
var subtitleEffect = !{subtitleEffect}
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var typed = new Typed("#subtitle", {
|
||||||
|
strings: '!{theme.subtitle.sub}'.split(","),
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
header
|
|
||||||
#page-header
|
|
||||||
span#blog_name.pull_left
|
|
||||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
|
||||||
span.toggle-menu.pull_right.close
|
|
||||||
a.site-page
|
|
||||||
i.fa.fa-bars.fa-fw(aria-hidden="true")
|
|
||||||
span.pull_right.menus
|
|
||||||
.menus_items
|
|
||||||
include menu_item.pug
|
|
||||||
|
|
||||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
|
||||||
span#search_button.pull_right
|
|
||||||
a.site-page.social-icon.search
|
|
||||||
i.fa.fa-search.fa-fw
|
|
||||||
span=' '+_p('search')
|
|
||||||
17
layout/includes/header/header.pug
Normal file
17
layout/includes/header/header.pug
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#page-header
|
||||||
|
span#blog_name.pull_left
|
||||||
|
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||||
|
|
||||||
|
span.pull_right.menus
|
||||||
|
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||||
|
#search_button
|
||||||
|
a.site-page.social-icon.search
|
||||||
|
i.fa.fa-search.fa-fw
|
||||||
|
span=' '+_p('search')
|
||||||
|
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||||
|
|
||||||
|
span.toggle-menu.close
|
||||||
|
a.site-page
|
||||||
|
i.fa.fa-bars.fa-fw(aria-hidden="true")
|
||||||
|
|
||||||
|
|
||||||
43
layout/includes/header/index.pug
Normal file
43
layout/includes/header/index.pug
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
if is_home()
|
||||||
|
- var top_img = theme.index_img || theme.default_top_img
|
||||||
|
else if is_post()
|
||||||
|
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
||||||
|
else if is_archive()
|
||||||
|
- var top_img = theme.archive_img || theme.default_top_img
|
||||||
|
else if is_tag()
|
||||||
|
- var top_img = theme.tag_img || theme.default_top_img
|
||||||
|
else if is_category()
|
||||||
|
- var top_img = theme.category_img || theme.default_top_img
|
||||||
|
else
|
||||||
|
- var top_img = page.top_img || theme.default_top_img
|
||||||
|
|
||||||
|
if theme.douban
|
||||||
|
if is_current('/movies/', [strict])
|
||||||
|
- var top_img = theme.douban.movies_img || theme.default_top_img
|
||||||
|
else if is_current('/books/', [strict])
|
||||||
|
- var top_img = theme.douban.books_img || theme.default_top_img
|
||||||
|
else if is_current('/games/', [strict])
|
||||||
|
- var top_img = theme.douban.games_img || theme.default_top_img
|
||||||
|
|
||||||
|
- var bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : ''
|
||||||
|
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||||
|
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||||
|
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||||
|
|
||||||
|
#nav(class=isHomeClass style=bg_img)
|
||||||
|
!=partial('includes/header/header', {}, {cache:theme.fragment_cache})
|
||||||
|
if is_home()
|
||||||
|
#site-info
|
||||||
|
h1#site_title=site_title
|
||||||
|
#site_subtitle
|
||||||
|
span#subtitle
|
||||||
|
if(theme.social)
|
||||||
|
#site_social_icons
|
||||||
|
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||||
|
#scroll_down
|
||||||
|
i.fa.fa-angle-down.scroll-down-effects
|
||||||
|
else if is_post()
|
||||||
|
include ./post-info.pug
|
||||||
|
else
|
||||||
|
#page_site-info
|
||||||
|
h1#site_title=site_title
|
||||||
22
layout/includes/header/menu_item.pug
Normal file
22
layout/includes/header/menu_item.pug
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
.menus_items
|
||||||
|
each value, label in theme.menu
|
||||||
|
if !Array.isArray(value)
|
||||||
|
.menus_item
|
||||||
|
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||||
|
if value.split('||')[1]
|
||||||
|
i.fa-fw(class=trim(value.split('||')[1]))
|
||||||
|
span=' '+label
|
||||||
|
else
|
||||||
|
.menus_item
|
||||||
|
a.site-page
|
||||||
|
if label.split('||')[1]
|
||||||
|
i.fa-fw(class=trim(label.split('||')[1]) aria-hidden="true")
|
||||||
|
span=' '+ trim(label.split('||')[0])
|
||||||
|
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
||||||
|
ul.menus_item_child
|
||||||
|
each i in value
|
||||||
|
li
|
||||||
|
a.site-page(href=url_for(trim(i.split('||')[1])))
|
||||||
|
if i.split('||')[2]
|
||||||
|
i.fa-fw(class=trim(i.split('||')[2]))
|
||||||
|
span=' '+trim(i.split('||')[0])
|
||||||
91
layout/includes/header/post-info.pug
Normal file
91
layout/includes/header/post-info.pug
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#post-info
|
||||||
|
#post-title
|
||||||
|
.posttitle= page.title || _p('no_title')
|
||||||
|
|
||||||
|
#post-meta
|
||||||
|
.meta-firstline
|
||||||
|
if (theme.post_meta.post.date_type)
|
||||||
|
if (theme.post_meta.post.date_type === 'both')
|
||||||
|
time.post-meta__date
|
||||||
|
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date))
|
||||||
|
i.fa.fa-calendar(aria-hidden="true")
|
||||||
|
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||||
|
span.post-meta__separator |
|
||||||
|
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated))
|
||||||
|
i.fa.fa-history(aria-hidden="true")
|
||||||
|
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||||
|
else
|
||||||
|
- var data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||||
|
- var date_type = data_type_update ? 'updated' : 'date'
|
||||||
|
- var date_icon = data_type_update ? 'fa-history' :'fa-calendar'
|
||||||
|
- var data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||||
|
time.post-meta__date(title=data_info + ' ' + full_date(page[date_type]))
|
||||||
|
i.fa(class=date_icon aria-hidden="true")
|
||||||
|
=' ' + data_info + ' ' + date(page[date_type], config.date_format)
|
||||||
|
|
||||||
|
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||||
|
span.post-meta__categories
|
||||||
|
if (theme.post_meta.post.date_type)
|
||||||
|
span.post-meta__separator |
|
||||||
|
|
||||||
|
each item, index in page.categories.data
|
||||||
|
i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
|
||||||
|
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||||
|
if (index < page.categories.data.length - 1)
|
||||||
|
i.fa.fa-angle-right.post-meta__separator(aria-hidden="true")
|
||||||
|
|
||||||
|
.meta-secondline
|
||||||
|
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||||
|
if (postWordcount)
|
||||||
|
span.post-meta-wordcount
|
||||||
|
if theme.wordcount.post_wordcount
|
||||||
|
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
|
||||||
|
i.post-meta__icon(class=wordCountIcon aria-hidden="true")
|
||||||
|
span= _p('post.wordcount') + ':'
|
||||||
|
span.word-count= wordcount(page.content)
|
||||||
|
if theme.wordcount.min2read
|
||||||
|
span.post-meta__separator |
|
||||||
|
if theme.wordcount.min2read
|
||||||
|
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
|
||||||
|
i.post-meta__icon(class=readCountIcon aria-hidden="true")
|
||||||
|
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||||
|
|
||||||
|
.meta-thirdline
|
||||||
|
span.post-meta-pv-cv
|
||||||
|
if (postWordcount && theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
if theme.busuanzi.page_pv
|
||||||
|
i.fa.fa-eye.post-meta__icon(aria-hidden="true")
|
||||||
|
span=_p('post.page_pv') + ':'
|
||||||
|
span#busuanzi_value_page_pv
|
||||||
|
|
||||||
|
span.post-meta-commentcount
|
||||||
|
- var commentCount = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-comments' : 'fa fa-comment-o'
|
||||||
|
if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
span.disqus-comment-count.comment-count
|
||||||
|
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||||
|
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||||
|
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||||
|
else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a(href=url_for(page.path) + '#post-comment')
|
||||||
|
span.gitalk-comment-count.comment-count
|
||||||
|
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a.comment-count(href=url_for(page.path) + '#post-comment')
|
||||||
|
span.fb-comments-count(data-href=urlNoIndex())
|
||||||
4
layout/includes/header/social.pug
Normal file
4
layout/includes/header/social.pug
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
each url, icon in theme.social
|
||||||
|
a.social-icon(href=trim(url.split('||')[0]) target="_blank"
|
||||||
|
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
|
||||||
|
i(class=icon aria-hidden="true")
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
if theme.subtitle.enable
|
|
||||||
script(src=url_for(theme.CDN.typed))
|
|
||||||
- var source = theme.subtitle.source
|
|
||||||
|
|
||||||
if source == '1' || source == '2'
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/bluebird@3/js/browser/bluebird.min.js")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/whatwg-fetch@2.0.3/fetch.min.js")
|
|
||||||
|
|
||||||
if source == '1'
|
|
||||||
script.
|
|
||||||
fetch('https://api.ooopn.com/ciba/api.php',)
|
|
||||||
.then(function (res){
|
|
||||||
return res.json();
|
|
||||||
})
|
|
||||||
.then(function (data) {
|
|
||||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
|
||||||
var both = sub.unshift(data['ciba-en'],data.ciba)
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: sub,
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(function (err) {
|
|
||||||
console.error(err);
|
|
||||||
})
|
|
||||||
else if source == '2'
|
|
||||||
script.
|
|
||||||
fetch('https://v1.hitokoto.cn')
|
|
||||||
.then(function (res){
|
|
||||||
return res.json();
|
|
||||||
})
|
|
||||||
.then(function (data) {
|
|
||||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
|
||||||
var both = sub.unshift(data.hitokoto)
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: sub,
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(function (err) {
|
|
||||||
console.error(err);
|
|
||||||
})
|
|
||||||
else if source == "3"
|
|
||||||
script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
|
|
||||||
script.
|
|
||||||
var con = str[0];
|
|
||||||
var author = "出自 " + str[1];
|
|
||||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
|
||||||
var both = sub.unshift(con,author)
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: sub,
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
else if source == '4'
|
|
||||||
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8")
|
|
||||||
script.
|
|
||||||
jinrishici.load(function(result) {
|
|
||||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
|
||||||
var content = result.data.content;
|
|
||||||
var both = sub.unshift(content)
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: sub,
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
else
|
|
||||||
script.
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: '!{theme.subtitle.sub}'.split(","),
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,71 +1,35 @@
|
|||||||
|
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||||
- var pageTitle = page.title || config.subtitle || ''
|
|
||||||
- if (is_archive()) pageTitle = _p('page.archives')
|
|
||||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
|
||||||
- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
|
||||||
- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
|
||||||
- if (is_year()) pageTitle += ': ' + page.year
|
|
||||||
- var pageTitle_saved //- 暫時存儲pageTitle
|
|
||||||
- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
|
|
||||||
- var home_subtitle_true //有subtitle
|
|
||||||
//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
|
|
||||||
- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
|
|
||||||
//- 暫時存儲pageTitle
|
|
||||||
- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
|
|
||||||
//- 是否有 config.subtitle 是各自显示
|
|
||||||
- config.subtitle ? home_subtitle_true = ' - ' + config.subtitle : home_subtitle_true = ''
|
|
||||||
//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
|
|
||||||
- is_home() ? pageTitle = config.title + home_subtitle_true : pageTitle = pageTitle_saved
|
|
||||||
//- 判断keywords
|
|
||||||
|
|
||||||
- var pageDescription = page.description || page.title || config.description
|
|
||||||
- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
|
||||||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
|
||||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
|
||||||
- var pageCopyright = config.copyright || config.author
|
|
||||||
|
|
||||||
doctype html
|
doctype html
|
||||||
html(lang=config.language data-theme=theme.display_mode)
|
html(lang=config.language data-theme=theme.display_mode)
|
||||||
head
|
head
|
||||||
meta(charset='UTF-8')
|
|
||||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
|
||||||
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5")
|
|
||||||
title= pageTitle
|
|
||||||
meta(name="description" content=pageDescription)
|
|
||||||
if pageKeywords
|
|
||||||
meta(name="keywords" content=pageKeywords)
|
|
||||||
meta(name="author" content=pageAuthor)
|
|
||||||
meta(name="copyright" content=pageCopyright)
|
|
||||||
meta(name ="format-detection" content="telephone=no")
|
|
||||||
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
|
||||||
include ./head.pug
|
include ./head.pug
|
||||||
include ./config.pug
|
|
||||||
body
|
body
|
||||||
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
canvas.fireworks
|
canvas.fireworks
|
||||||
//- !=partial('includes/header.pug', {}, {cache: true})
|
|
||||||
include ./header.pug
|
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
|
||||||
include ./mobile-sidebar.pug
|
|
||||||
|
include ./sidebar.pug
|
||||||
|
|
||||||
#body-wrap
|
#body-wrap
|
||||||
if theme.background
|
if theme.background
|
||||||
- var source = theme.background
|
- var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
|
||||||
- var is_photo = source.substring(3,0) === 'url' ? 'photo':'color'
|
|
||||||
#web_bg(data-type=is_photo)
|
#web_bg(data-type=is_photo)
|
||||||
if (is_post() && page.toc != false && theme.toc.enable)
|
include ./header/index.pug
|
||||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
|
||||||
include ./sidebar.pug
|
|
||||||
if (!is_post())
|
if (!is_post())
|
||||||
include ./nav.pug
|
main#content-inner.layout_page(class=hideAside)
|
||||||
main#content-outer
|
|
||||||
block top_img
|
|
||||||
if (!is_post())
|
|
||||||
#content-inner.layout_page
|
|
||||||
if body
|
if body
|
||||||
div!= body
|
div!= body
|
||||||
else
|
else
|
||||||
block content
|
block content
|
||||||
|
include widget/index.pug
|
||||||
else
|
else
|
||||||
#content-inner.layout.layout_post
|
main#content-inner.layout_post
|
||||||
if body
|
if body
|
||||||
div!= body
|
div!= body
|
||||||
else
|
else
|
||||||
@@ -74,12 +38,8 @@ html(lang=config.language data-theme=theme.display_mode)
|
|||||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||||
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
|
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
|
||||||
footer#footer(style=footer_bg data-type=is_bg)
|
footer#footer(style=footer_bg data-type=is_bg)
|
||||||
include ./footer.pug
|
!=partial('includes/footer', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
include ./rightside.pug
|
include ./rightside.pug
|
||||||
each item in theme.CDN_USE.js
|
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||||
script(src=url_for(item))
|
|
||||||
include ./additional-js.pug
|
include ./additional-js.pug
|
||||||
include ./search/index.pug
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
6
layout/includes/loading/loading-js.pug
Normal file
6
layout/includes/loading/loading-js.pug
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
script.
|
||||||
|
var endLoading = function () {
|
||||||
|
document.body.style.overflow = 'auto';
|
||||||
|
document.getElementById('loading-box').classList.add("loaded")
|
||||||
|
}
|
||||||
|
window.addEventListener('load',endLoading)
|
||||||
9
layout/includes/loading/loading.pug
Normal file
9
layout/includes/loading/loading.pug
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#loading-box
|
||||||
|
.loading-left-bg
|
||||||
|
.loading-right-bg
|
||||||
|
.spinner-box
|
||||||
|
.configure-border-1
|
||||||
|
.configure-core
|
||||||
|
.configure-border-2
|
||||||
|
.configure-core
|
||||||
|
.loading-word= _p('loading')
|
||||||
8
layout/includes/math/mermaid.pug
Normal file
8
layout/includes/math/mermaid.pug
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
script.
|
||||||
|
if (document.getElementsByClassName('mermaid').length) {
|
||||||
|
loadScript('!{theme.CDN.mermaid}',function () {
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: '!{theme.mermaid.theme}',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
each value, label in theme.menu
|
|
||||||
if !Array.isArray(value)
|
|
||||||
.menus_item
|
|
||||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
|
||||||
i.fa-fw(class=trim(value.split('||')[1]))
|
|
||||||
span=' '+label
|
|
||||||
else
|
|
||||||
.menus_item
|
|
||||||
a.site-page
|
|
||||||
i.fa-fw(class=trim(label.split('||')[1]) aria-hidden="true")
|
|
||||||
span=' '+ trim(label.split('||')[0])
|
|
||||||
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
|
||||||
ul.menus_item_child
|
|
||||||
each i in value
|
|
||||||
li
|
|
||||||
a.site-page(href=url_for(trim(i.split('||')[1])))
|
|
||||||
i.fa-fw(class=trim(i.split('||')[2]))
|
|
||||||
span=' '+trim(i.split('||')[0])
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
mixin UI_NEW(posts)
|
|
||||||
- posts.each(function(article,index){
|
|
||||||
.recent-post-item.article-container
|
|
||||||
- var link = article.link || article.path
|
|
||||||
if index%2 == 0
|
|
||||||
.post_cover.left_radius
|
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
|
||||||
- var post_cover = article.cover
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
.post_cover.right_radius
|
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
|
||||||
- var post_cover = article.cover
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
.recent-post-info
|
|
||||||
a.article-title(href=url_for(link) title= article.title || _p('no_title'))= article.title || _p('no_title')
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
|
|
||||||
if (theme.post_meta.categories && article.categories.data.length > 0)
|
|
||||||
span.article-meta
|
|
||||||
span.article-meta__separator |
|
|
||||||
each item, index in article.categories.data
|
|
||||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
|
||||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
|
||||||
if (index < article.categories.data.length - 1)
|
|
||||||
i.fa.fa-angle-right(aria-hidden="true")
|
|
||||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
|
||||||
- const content = strip_html(article.content)
|
|
||||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
|
||||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
|
||||||
.content!= expert
|
|
||||||
else
|
|
||||||
.content!= article.description
|
|
||||||
- })
|
|
||||||
@@ -3,16 +3,18 @@ mixin articleSort(posts)
|
|||||||
- var year
|
- var year
|
||||||
- posts.each(function (article) {
|
- posts.each(function (article) {
|
||||||
- var tempYear = date(article.date, 'YYYY')
|
- var tempYear = date(article.date, 'YYYY')
|
||||||
|
- var no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
|
||||||
if tempYear !== year
|
if tempYear !== year
|
||||||
- year = tempYear
|
- year = tempYear
|
||||||
.article-sort-item.year= year
|
.article-sort-item.year= year
|
||||||
.article-sort-item
|
.article-sort-item(class=no_cover)
|
||||||
|
if article.cover && theme.cover.archives_enable
|
||||||
.article-sort-img
|
.article-sort-img
|
||||||
a.article-sort-item__img(href=url_for(article.path))
|
a.article-sort-item__img(href=url_for(article.path))
|
||||||
img(src=article.cover alt=article.title || 'No Title')
|
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||||
.article-sort-post
|
.article-sort-post
|
||||||
a.article-sort-item__post(href=url_for(article.path))
|
a.article-sort-item__post(href=url_for(article.path))
|
||||||
i.fa.fa-clock-o(aria-hidden="true")
|
i.fa.fa-clock-o(aria-hidden="true")
|
||||||
time.article-sort-item__time= date(article.date)
|
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
||||||
.article-sort-item__title= article.title || 'No Title'
|
.article-sort-item__title= article.title || 'No Title'
|
||||||
- })
|
- })
|
||||||
68
layout/includes/mixins/post-ui.pug
Normal file
68
layout/includes/mixins/post-ui.pug
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
mixin postUI(posts)
|
||||||
|
each article , index in page.posts.data
|
||||||
|
.recent-post-item
|
||||||
|
- var link = article.link || article.path
|
||||||
|
- var title = article.title || _p('no_title')
|
||||||
|
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||||
|
- var post_cover = article.cover
|
||||||
|
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||||
|
if post_cover && theme.cover.index_enable
|
||||||
|
.post_cover(class=leftOrRight)
|
||||||
|
a(href=url_for(link) title=title)
|
||||||
|
if theme.lazyload
|
||||||
|
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||||
|
else
|
||||||
|
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||||
|
.recent-post-info(class=no_cover)
|
||||||
|
a.article-title(href=url_for(link) title=title)= title
|
||||||
|
.article-meta-wrap
|
||||||
|
if (is_home() && (article.top || article.sticky > 0))
|
||||||
|
span.article-meta
|
||||||
|
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
||||||
|
span.sticky= _p('sticky')
|
||||||
|
span.article-meta__separator |
|
||||||
|
if (theme.post_meta.page.date_type)
|
||||||
|
if (theme.post_meta.page.date_type === 'both')
|
||||||
|
time.post-meta__date
|
||||||
|
span.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date))
|
||||||
|
i.fa.fa-calendar(aria-hidden="true")
|
||||||
|
=date(article.date, config.date_format)
|
||||||
|
span.article-meta__separator |
|
||||||
|
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
|
||||||
|
i.fa.fa-history(aria-hidden="true")
|
||||||
|
=date(article.updated, config.date_format)
|
||||||
|
else
|
||||||
|
- var data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||||
|
- var date_type = data_type_updated ? 'updated' : 'date'
|
||||||
|
- var date_icon = data_type_updated ? 'fa-history' :'fa-calendar'
|
||||||
|
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created')
|
||||||
|
time.post-meta__date(title=date_title + ' ' + full_date(article[date_type]))
|
||||||
|
i.fa(class=date_icon aria-hidden="true")
|
||||||
|
=date(article[date_type], config.date_format)
|
||||||
|
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||||
|
span.article-meta
|
||||||
|
span.article-meta__separator |
|
||||||
|
each item, index in article.categories.data
|
||||||
|
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
||||||
|
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||||
|
if (index < article.categories.data.length - 1)
|
||||||
|
i.fa.fa-angle-right(aria-hidden="true")
|
||||||
|
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||||
|
span.article-meta.tags
|
||||||
|
span.article-meta__separator |
|
||||||
|
each item, index in article.tags.data
|
||||||
|
i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
||||||
|
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||||
|
if (index < article.tags.data.length - 1)
|
||||||
|
span.article-meta__link -
|
||||||
|
if theme.auto_excerpt && theme.auto_excerpt.enable
|
||||||
|
- const content = strip_html(article.content)
|
||||||
|
- let expert = content.substring(0, theme.auto_excerpt.length)
|
||||||
|
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
||||||
|
.content!= expert
|
||||||
|
else
|
||||||
|
.content!= article.description
|
||||||
|
|
||||||
|
if theme.ad && theme.ad.index
|
||||||
|
if (index + 1) % 3 == 0
|
||||||
|
.recent-post-item.ad_height!=theme.ad.index
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#mobile-sidebar
|
|
||||||
#menu_mask
|
|
||||||
#mobile-sidebar-menus
|
|
||||||
.mobile_author_icon
|
|
||||||
img.avatar-img(src=url_for(theme.avatar) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
|
|
||||||
.mobile_post_data
|
|
||||||
if site.posts.length
|
|
||||||
.mobile_data_item.is-center
|
|
||||||
.mobile_data_link
|
|
||||||
a(href=url_for(config.archive_dir) + '/')
|
|
||||||
.headline= _p('aside.articles')
|
|
||||||
.length_num= site.posts.length
|
|
||||||
|
|
||||||
if site.tags.length
|
|
||||||
.mobile_data_item.is-center
|
|
||||||
.mobile_data_link
|
|
||||||
a(href=url_for(config.tag_dir) + '/' )
|
|
||||||
.headline= _p('aside.tags')
|
|
||||||
.length_num= site.tags.length
|
|
||||||
|
|
||||||
if site.categories.length
|
|
||||||
.mobile_data_item.is-center
|
|
||||||
.mobile_data_link
|
|
||||||
a(href=url_for(config.category_dir) + '/')
|
|
||||||
.headline= _p('aside.categories')
|
|
||||||
.length_num= site.categories.length
|
|
||||||
hr
|
|
||||||
.menus_items
|
|
||||||
include menu_item.pug
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
|
||||||
-
|
|
||||||
let tocNumber
|
|
||||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
|
||||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
|
||||||
else tocNumber = true
|
|
||||||
-
|
|
||||||
if (showToc)
|
|
||||||
#mobile-sidebar-toc
|
|
||||||
.toc_mobile_headline= _p('sidebar.catalog')
|
|
||||||
if (page.encrypt == true)
|
|
||||||
.sidebar-toc__content.toc-div-class(style="display:none")!=toc(page.origin,{"class":"toc_mobile_items",list_number:tocNumber})
|
|
||||||
else
|
|
||||||
.sidebar-toc__content!=toc(page.content,{"class":"toc_mobile_items",list_number:tocNumber})
|
|
||||||
3
layout/includes/mobile-sidebar/index.pug
Normal file
3
layout/includes/mobile-sidebar/index.pug
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#mobile-sidebar
|
||||||
|
#menu_mask
|
||||||
|
include ../mobile-sidebar/mobile-menus.pug
|
||||||
26
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
26
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#mobile-sidebar-menus
|
||||||
|
.mobile_author_icon
|
||||||
|
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
|
||||||
|
.mobile_post_data
|
||||||
|
if site.posts.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.archive_dir) + '/')
|
||||||
|
.headline= _p('aside.articles')
|
||||||
|
.length_num= site.posts.length
|
||||||
|
|
||||||
|
if site.tags.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.tag_dir) + '/' )
|
||||||
|
.headline= _p('aside.tags')
|
||||||
|
.length_num= site.tags.length
|
||||||
|
|
||||||
|
if site.categories.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.category_dir) + '/')
|
||||||
|
.headline= _p('aside.categories')
|
||||||
|
.length_num= site.categories.length
|
||||||
|
hr
|
||||||
|
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
|
||||||
|
|
||||||
|
|
||||||
if is_home()
|
|
||||||
nav#nav.full_page(style=bg_img)
|
|
||||||
#site-info
|
|
||||||
#site-title
|
|
||||||
span.blogtitle= page.title || page.tag || page.category || config.title
|
|
||||||
#site-sub-title
|
|
||||||
span.subtitle
|
|
||||||
|
|
||||||
if(theme.social)
|
|
||||||
#site-social-icons
|
|
||||||
each url, icon in theme.social
|
|
||||||
a.social-icon(href=url target="_blank")
|
|
||||||
i(class=icon aria-hidden="true")
|
|
||||||
|
|
||||||
.scroll-down
|
|
||||||
i.fa.fa-angle-down.scroll-down-effects
|
|
||||||
|
|
||||||
else
|
|
||||||
nav#nav.not_index_bg(style=bg_img)
|
|
||||||
#page_site-info
|
|
||||||
#site-title
|
|
||||||
if (is_archive())
|
|
||||||
span.blogtitle= _p('archives')
|
|
||||||
else
|
|
||||||
span.blogtitle= page.title || page.tag || page.category || config.title
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
- site.tags.sort('path').each(function (tags){
|
|
||||||
- var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
|
|
||||||
- var color = "rgb(" + Math.floor(Math.random() * 201) + ", " + Math.floor(Math.random() * 201) +", " + Math.floor(Math.random() * 201) +")"; // 0,0,0 -> 200,200,200
|
|
||||||
|
|
||||||
a(href=url_for(tags.path) style='font-size:' + fontSize + ';color:' + color)=tags.name
|
|
||||||
-})
|
|
||||||
@@ -13,51 +13,27 @@ if(!is_post())
|
|||||||
else
|
else
|
||||||
nav#pagination.pagination_post
|
nav#pagination.pagination_post
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
if(page.next)
|
- var hasPageNext = page.prev ? 'pull_left' : 'pull-full'
|
||||||
.prev-post.pull_left
|
.prev-post(class=hasPageNext)
|
||||||
- var pagination_cover = page.prev.cover
|
- var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
|
||||||
a(href=url_for(page.prev.path))
|
a(href=url_for(page.prev.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload
|
||||||
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||||
else
|
else
|
||||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||||
|
.pagination-info
|
||||||
.label=_p('pagination.prev')
|
.label=_p('pagination.prev')
|
||||||
.prev_info
|
.prev_info=page.prev.title
|
||||||
span=page.prev.title
|
|
||||||
else
|
|
||||||
.prev-post.pull-full
|
|
||||||
- var pagination_cover = page.prev.cover
|
|
||||||
a(href=url_for(page.prev.path))
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
.label=_p('pagination.prev')
|
|
||||||
.prev_info
|
|
||||||
span=page.prev.title
|
|
||||||
|
|
||||||
if(page.next)
|
if(page.next)
|
||||||
if(page.prev)
|
- var hasPagePrev = page.prev ? 'pull_right' : 'pull-full'
|
||||||
.next-post.pull_right
|
- var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover
|
||||||
- var pagination_cover = page.next.cover
|
.next-post(class=hasPagePrev)
|
||||||
a(href=url_for(page.next.path))
|
a(href=url_for(page.next.path))
|
||||||
if theme.lazyload.enable
|
if theme.lazyload
|
||||||
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||||
else
|
else
|
||||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||||
|
.pagination-info
|
||||||
.label=_p('pagination.next')
|
.label=_p('pagination.next')
|
||||||
.next_info
|
.next_info=page.next.title
|
||||||
span=page.next.title
|
|
||||||
else
|
|
||||||
.next-post.pull-full
|
|
||||||
- var pagination_cover = page.next.cover
|
|
||||||
a(href=url_for(page.next.path))
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
.label=_p('pagination.next')
|
|
||||||
.next_info
|
|
||||||
span=page.next.title
|
|
||||||
|
|
||||||
13
layout/includes/post/post-copyright.pug
Normal file
13
layout/includes/post/post-copyright.pug
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
|
||||||
|
.post-copyright
|
||||||
|
.post-copyright__author
|
||||||
|
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
||||||
|
span.post-copyright-info
|
||||||
|
a(href=`mailto:${config.email}`) #[=config.author]
|
||||||
|
.post-copyright__type
|
||||||
|
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
||||||
|
span.post-copyright-info
|
||||||
|
a(href=url_for(page.permalink))= theme.post_copyright.decode ? decodeURI(page.permalink) : page.permalink
|
||||||
|
.post-copyright__notice
|
||||||
|
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
||||||
|
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
||||||
@@ -6,6 +6,6 @@
|
|||||||
ul.reward-all
|
ul.reward-all
|
||||||
each item in theme.reward.QR_code
|
each item in theme.reward.QR_code
|
||||||
li.reward-item
|
li.reward-item
|
||||||
img.lazyload.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||||
.post-qr-code__desc=(item.itemlist||item).text
|
.post-qr-code__desc=(item.itemlist||item).text
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
each article , index in page.posts.data
|
|
||||||
.recent-post-item.article-container
|
|
||||||
- var link = article.link || article.path
|
|
||||||
- var title = article.title || _p('no_title')
|
|
||||||
if index%2 == 0
|
|
||||||
.post_cover.left_radius
|
|
||||||
a(href=url_for(link) title=title)
|
|
||||||
- var post_cover = article.cover
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
|
||||||
else
|
|
||||||
.post_cover.right_radius
|
|
||||||
a(href=url_for(link) title=title)
|
|
||||||
- var post_cover = article.cover
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
|
||||||
.recent-post-info
|
|
||||||
a.article-title(href=url_for(link) title=title)= title
|
|
||||||
if (article.top)
|
|
||||||
span.article-meta
|
|
||||||
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
|
||||||
span.sticky= _p('sticky')
|
|
||||||
span.article-meta__separator(style="margin-right: 0.3rem") |
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
|
|
||||||
if (theme.post_meta.categories && article.categories.data.length > 0)
|
|
||||||
span.article-meta
|
|
||||||
span.article-meta__separator |
|
|
||||||
each item, index in article.categories.data
|
|
||||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
|
||||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
|
||||||
if (index < article.categories.data.length - 1)
|
|
||||||
i.fa.fa-angle-right(aria-hidden="true")
|
|
||||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
|
||||||
- const content = strip_html(article.content)
|
|
||||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
|
||||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
|
||||||
.content!= expert
|
|
||||||
else
|
|
||||||
.content!= article.description
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,15 +7,17 @@ section#rightside.rightside
|
|||||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||||
if theme.translate && theme.translate.enable
|
if theme.translate && theme.translate.enable
|
||||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
|
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
|
||||||
if theme.darkmode && theme.darkmode.enable
|
if theme.darkmode.enable && theme.darkmode.button
|
||||||
- var display_mode = theme.display_mode == 'dark' ? 'fa fa-sun-o' : 'fa fa-moon-o'
|
- var lightModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-sun' : 'fa fa-sun-o'
|
||||||
|
- var darkModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-moon' : 'fa fa-moon-o'
|
||||||
|
- var display_mode = theme.display_mode == 'dark' ? lightModeIcon : darkModeIcon
|
||||||
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
|
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
|
||||||
#rightside-config-show
|
#rightside-config-show
|
||||||
#rightside_config(title=_p("rightside.setting"))
|
#rightside_config(title=_p("rightside.setting"))
|
||||||
i.fa.fa-cog(aria-hidden="true")
|
i.fa.fa-cog(aria-hidden="true")
|
||||||
if is_post() && page.comments !== false && (d || l || gt || v)
|
if is_post() && page.comments !== false && isComment
|
||||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||||
i.scroll_to_comment.fa.fa-comments
|
i.scroll_to_comment.fa.fa-comments
|
||||||
if is_post() && page.toc != false && theme.toc.enable
|
if is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||||
i#mobile-toc-button.fa.fa-list-ul.close(title=_p("rightside.toc") aria-hidden="true")
|
i#mobile-toc-button.fa.fa-list-ul.close(title=_p("rightside.toc") aria-hidden="true")
|
||||||
i.fa.fa-arrow-up#go-up(title=_p("rightside.back_to_top") aria-hidden="true")
|
i.fa.fa-arrow-up#go-up(title=_p("rightside.back_to_top") aria-hidden="true")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#local-input-panel
|
#local-input-panel
|
||||||
#local-search-input
|
#local-search-input
|
||||||
.local-search-box
|
.local-search-box
|
||||||
input(placeholder=_p("local_search.input_placeholder")).local-search-box--input
|
input(placeholder=_p("local_search.input_placeholder") type="text").local-search-box--input
|
||||||
hr
|
hr
|
||||||
#local-search-results
|
#local-search-results
|
||||||
#local-hits
|
#local-hits
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (theme.sharejs && theme.sharejs.enable)
|
if (theme.sharejs && theme.sharejs.enable)
|
||||||
.social-share(data-image= page.cover|| theme.avatar data-sites= theme.sharejs.sites)
|
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||||
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||||
script(src=url_for(theme.CDN.sharejs))
|
script(src=url_for(theme.CDN.sharejs))
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
|
- let showToc = is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||||
|
- let autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
|
||||||
|
|
||||||
- var sidebar_class = theme.auto_open_sidebar.enable === true ? 'auto_open' : ''
|
|
||||||
|
|
||||||
#sidebar(class=sidebar_class)
|
|
||||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
|
||||||
-
|
-
|
||||||
let tocNumber
|
let tocNumber
|
||||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
||||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
||||||
else tocNumber = true
|
else tocNumber = true
|
||||||
-
|
-
|
||||||
|
|
||||||
if(showToc)
|
if(showToc)
|
||||||
|
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
|
||||||
|
#sidebar
|
||||||
.sidebar-toc
|
.sidebar-toc
|
||||||
div.sidebar-toc__title= _p('sidebar.catalog')
|
div.sidebar-toc__title= _p('sidebar.catalog')
|
||||||
div.sidebar-toc__progress
|
div.sidebar-toc__progress
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
script(id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
||||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||||
|
|
||||||
|
|||||||
13
layout/includes/third-party/pangu.pug
vendored
Normal file
13
layout/includes/third-party/pangu.pug
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
script(src=url_for(theme.CDN.pangu))
|
||||||
|
if theme.pangu.field === 'post'
|
||||||
|
if is_post()
|
||||||
|
script.
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
pangu.spacingElementById('content-inner')
|
||||||
|
})
|
||||||
|
else if theme.pangu.field === 'page'
|
||||||
|
script.
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
pangu.spacingElementById('content-inner')
|
||||||
|
})
|
||||||
|
|
||||||
2
layout/includes/widget/card_ad.pug
Normal file
2
layout/includes/widget/card_ad.pug
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.card-widget.card-ad
|
||||||
|
!= theme.ad.aside
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
.item-headline
|
.item-headline
|
||||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||||
span= _p('aside.card_announcement')
|
span= _p('aside.card_announcement')
|
||||||
.announcement_content= theme.announcement.content
|
.announcement_content!= theme.aside.card_announcement.content
|
||||||
@@ -3,4 +3,9 @@
|
|||||||
.item-headline
|
.item-headline
|
||||||
i.fa.fa-archive(aria-hidden="true")
|
i.fa.fa-archive(aria-hidden="true")
|
||||||
span= _p('aside.card_archives')
|
span= _p('aside.card_archives')
|
||||||
!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
|
||||||
|
- let type = theme.aside.card_archives.type || 'monthly'
|
||||||
|
- let format = theme.aside.card_archives.format || 'MMMM YYYY'
|
||||||
|
- let order = theme.aside.card_archives.order || -1
|
||||||
|
- let limit = theme.aside.card_archives.limit === 0 ? 0 : theme.aside.card_archives.limit || 8
|
||||||
|
!= aside_archives({ type:type, format: format, order: order, limit: limit })
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
.card-widget.card-info
|
.card-widget.card-info
|
||||||
.card-content
|
.card-content
|
||||||
.card-info-avatar.is-center
|
.card-info-avatar.is-center
|
||||||
img.avatar-img(src=url_for(theme.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
|
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
|
||||||
.author-info__name= config.author
|
.author-info__name= config.author
|
||||||
.author-info__description= config.description
|
.author-info__description= theme.aside.card_author.description || config.description
|
||||||
|
|
||||||
.card-info-data
|
.card-info-data
|
||||||
if site.posts.length
|
if site.posts.length
|
||||||
.card-info-data-item.is-center
|
.card-info-data-item.is-center
|
||||||
a(href=url_for(config.archive_dir) + '/')
|
a(href=url_for(config.archive_dir))
|
||||||
.headline= _p('aside.articles')
|
.headline= _p('aside.articles')
|
||||||
.length_num= site.posts.length
|
.length_num= site.posts.length
|
||||||
|
|
||||||
if site.tags.length
|
if site.tags.length
|
||||||
.card-info-data-item.is-center
|
.card-info-data-item.is-center
|
||||||
a(href=url_for(config.tag_dir) + '/' )
|
a(href=url_for(config.tag_dir))
|
||||||
.headline= _p('aside.tags')
|
.headline= _p('aside.tags')
|
||||||
.length_num= site.tags.length
|
.length_num= site.tags.length
|
||||||
|
|
||||||
if site.categories.length
|
if site.categories.length
|
||||||
.card-info-data-item.is-center
|
.card-info-data-item.is-center
|
||||||
a(href=url_for(config.category_dir) + '/')
|
a(href=url_for(config.category_dir))
|
||||||
.headline= _p('aside.categories')
|
.headline= _p('aside.categories')
|
||||||
.length_num= site.categories.length
|
.length_num= site.categories.length
|
||||||
|
|
||||||
@@ -31,6 +31,4 @@
|
|||||||
|
|
||||||
if(theme.social)
|
if(theme.social)
|
||||||
.card-info-social-icons.is-center
|
.card-info-social-icons.is-center
|
||||||
each url, icon in theme.social
|
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||||
a.social-icon(href=url target="_blank")
|
|
||||||
i(class=icon aria-hidden="true")
|
|
||||||
|
|||||||
@@ -4,20 +4,6 @@ if site.categories.length
|
|||||||
.item-headline
|
.item-headline
|
||||||
i.fa.fa-folder-open(aria-hidden="true")
|
i.fa.fa-folder-open(aria-hidden="true")
|
||||||
span= _p('aside.card_categories')
|
span= _p('aside.card_categories')
|
||||||
ul.aside-category-item
|
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 })
|
||||||
mixin displayCategories(parent = undefined)
|
|
||||||
- site.categories.find({ parent }).sort("name").each(function(category) {
|
|
||||||
- var childCount = site.categories.find({ parent: category._id }).count();
|
|
||||||
li.aside-category-list
|
|
||||||
a.aside-category-list_link(href=url_for(category.path))
|
|
||||||
span.aside-category-list_name= category.name
|
|
||||||
span.aside-category-list_length= category.length
|
|
||||||
|
|
||||||
if childCount > 0
|
|
||||||
ul.aside-category-item.child
|
|
||||||
+displayCategories(category._id)
|
|
||||||
- })
|
|
||||||
|
|
||||||
+displayCategories()
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,21 +4,23 @@
|
|||||||
i.fa.fa-history(aria-hidden="true")
|
i.fa.fa-history(aria-hidden="true")
|
||||||
span= _p('aside.card_recent_post')
|
span= _p('aside.card_recent_post')
|
||||||
.aside-recent-item
|
.aside-recent-item
|
||||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||||
|
- site.posts.sort('date', -1).limit(postLimit).each(function(article){
|
||||||
.aside-recent-post
|
.aside-recent-post
|
||||||
- var link = article.link || article.path
|
- var link = article.link || article.path
|
||||||
- var title = article.title || _p('no_title')
|
- var title = article.title || _p('no_title')
|
||||||
a(href=url_for(link))
|
- var no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : ''
|
||||||
- var post_cover = article.cover
|
- var post_cover = article.cover
|
||||||
|
|
||||||
|
a(href=url_for(link))
|
||||||
|
if post_cover && theme.cover.aside_enable
|
||||||
.aside-post-cover
|
.aside-post-cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload
|
||||||
img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
img.aside-post-bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||||
else
|
else
|
||||||
img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||||
.aside-post-title
|
.aside-post-title(class=no_cover)
|
||||||
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||||
if (theme.post_meta.date_type)
|
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.aside-post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
|
||||||
|
|
||||||
- })
|
- })
|
||||||
|
|||||||
@@ -4,4 +4,9 @@ if site.tags.length
|
|||||||
.item-headline
|
.item-headline
|
||||||
i.fa.fa-tags(aria-hidden="true")
|
i.fa.fa-tags(aria-hidden="true")
|
||||||
span= _p('aside.card_tags')
|
span= _p('aside.card_tags')
|
||||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#99a9bf'})
|
|
||||||
|
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
|
||||||
|
if theme.aside.card_tags.color
|
||||||
|
.card-tag-cloud!=cloudTags({source: site.tags, minfontsize: 16, maxfontsize: 22, limit: tagLimit})
|
||||||
|
else
|
||||||
|
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 22, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
- var webinfoIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'fas fa-chart-line' : 'fa fa-line-chart'
|
||||||
.card-widget.card-webinfo
|
.card-widget.card-webinfo
|
||||||
.card-content
|
.card-content
|
||||||
.item-headline
|
.item-headline
|
||||||
i.fa.fa-line-chart(aria-hidden="true")
|
i(class=webinfoIcon aria-hidden="true")
|
||||||
span= _p('aside.card_webinfo.headline')
|
span= _p('aside.card_webinfo.headline')
|
||||||
.webinfo
|
.webinfo
|
||||||
.webinfo-item
|
.webinfo-item
|
||||||
@@ -11,6 +12,10 @@
|
|||||||
.webinfo-item
|
.webinfo-item
|
||||||
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
|
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||||
#webinfo-runtime-count.webinfo-runtime-count(start_date=theme.runtimeshow.start_date)
|
#webinfo-runtime-count.webinfo-runtime-count(start_date=theme.runtimeshow.start_date)
|
||||||
|
if theme.wordcount.enable && theme.wordcount.total_wordcount
|
||||||
|
.webinfo-item
|
||||||
|
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :"
|
||||||
|
.webinfo-site-wordcount=totalcount(site)
|
||||||
if theme.busuanzi.site_uv
|
if theme.busuanzi.site_uv
|
||||||
.webinfo-item
|
.webinfo-item
|
||||||
.webinfo-site-uv-name= _p('aside.card_webinfo.site_uv_name') + " :"
|
.webinfo-site-uv-name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
if theme.aside.card_author
|
if theme.aside.enable
|
||||||
include ./card_author.pug
|
if page.aside !== false
|
||||||
|
#aside_content.aside_content
|
||||||
if theme.aside.card_announcement
|
if theme.aside.card_author.enable
|
||||||
include ./card_announcement.pug
|
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_announcement.enable
|
||||||
if theme.aside.card_recent_post
|
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
|
||||||
include ./card_recent_post.pug
|
if theme.aside.card_recent_post.enable
|
||||||
|
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
|
||||||
if theme.aside.card_categories
|
if theme.ad && theme.ad.aside
|
||||||
include ./card_categories.pug
|
!=partial('includes/widget/card_ad', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_categories.enable
|
||||||
if theme.aside.card_tags
|
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
|
||||||
include ./card_tags.pug
|
if theme.aside.card_tags.enable
|
||||||
|
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
|
||||||
if theme.aside.card_archives
|
if theme.aside.card_archives.enable
|
||||||
include ./card_archives.pug
|
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.aside.card_webinfo
|
if theme.aside.card_webinfo
|
||||||
include ./card_webinfo.pug
|
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
include ./includes/mixins/post-ui.pug
|
||||||
#recent-posts.recent-posts
|
#recent-posts.recent-posts
|
||||||
include includes/recent-posts.pug
|
+postUI
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
@@ -7,20 +7,13 @@ block content
|
|||||||
| -
|
| -
|
||||||
span.tag-cloud__amount= site.tags.length
|
span.tag-cloud__amount= site.tags.length
|
||||||
.tag-cloud-tags
|
.tag-cloud-tags
|
||||||
include includes/page_tag.pug
|
!=cloudTags({source: site.tags, minfontsize: 15, maxfontsize: 30, limit: 0})
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
include includes/comments/index.pug
|
include includes/comments/index.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
|
|
||||||
else if page.type === 'link'
|
else if page.type === 'link'
|
||||||
include flink.pug
|
include flink.pug
|
||||||
if page.comments !== false
|
|
||||||
include includes/comments/index.pug
|
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
else if page.type === 'categories'
|
else if page.type === 'categories'
|
||||||
#post-content.category-content
|
.category-content
|
||||||
.category-lists
|
.category-lists
|
||||||
.category__title= _p('page.category')
|
.category__title= _p('page.category')
|
||||||
| -
|
| -
|
||||||
@@ -28,14 +21,8 @@ block content
|
|||||||
div!= list_categories()
|
div!= list_categories()
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
include includes/comments/index.pug
|
include includes/comments/index.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
else
|
else
|
||||||
article#page
|
#page
|
||||||
h1= page.title
|
#article-container!= page.content
|
||||||
.article-container!= page.content
|
|
||||||
include includes/pagination.pug
|
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
include includes/comments/index.pug
|
include includes/comments/index.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
|
|||||||
@@ -1,101 +1,24 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block top_img
|
|
||||||
- var top_img = page.top_img || page.cover || theme.post_meta.top_img || theme.default_top_img
|
|
||||||
- var bg_img = top_img !== true ? `background-image: url(${top_img})` : ''
|
|
||||||
div#top-container(style=bg_img)
|
|
||||||
#post-info
|
|
||||||
#post-title
|
|
||||||
.posttitle= page.title || _p('no_title')
|
|
||||||
#post-meta
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
if (theme.post_meta.date_type === 'both')
|
|
||||||
time.post-meta__date
|
|
||||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
|
||||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
|
||||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
|
||||||
else
|
|
||||||
- var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
|
|
||||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
|
|
||||||
|
|
||||||
if (theme.post_meta.categories && page.categories.data.length > 0)
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
span.post-meta__separator |
|
|
||||||
span
|
|
||||||
each item, index in page.categories.data
|
|
||||||
i.fa.fa-inbox.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
|
||||||
if (index < page.categories.data.length - 1)
|
|
||||||
i.fa.fa-angle-right.fa-fw(aria-hidden="true")
|
|
||||||
.post-meta-wordcount
|
|
||||||
if (theme.wordcount && theme.wordcount.enable)
|
|
||||||
i.fa.fa-file-word-o.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
span= _p('post.wordcount') + ':'
|
|
||||||
span.word-count= wordcount(page.content)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-clock-o.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
|
||||||
.post-meta-pv-cv
|
|
||||||
if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
|
|
||||||
span.post-meta__separator |
|
|
||||||
if theme.busuanzi.page_pv
|
|
||||||
span
|
|
||||||
i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
=_p('post.page_pv') + ':'
|
|
||||||
span#busuanzi_value_page_pv
|
|
||||||
if (theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false)
|
|
||||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-comment-o.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
span= _p('post.comments') + ':'
|
|
||||||
a(href=url_for(page.path) + '#post-comment')
|
|
||||||
span.disqus-comment-count(data-disqus-url=page.permalink)
|
|
||||||
if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
|
||||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-comments-o.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
span= _p('post.comments') + ':'
|
|
||||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
|
||||||
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
|
||||||
if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
|
||||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-comments-o.post-meta__icon.fa-fw(aria-hidden="true")
|
|
||||||
span= _p('post.comments') + ':'
|
|
||||||
a(href=url_for(page.path) + '#post-comment')
|
|
||||||
span.gitalk-comment-count.comment-count
|
|
||||||
|
|
||||||
|
|
||||||
block content
|
block content
|
||||||
article#post(class="")
|
article#post(class="")
|
||||||
#post-content.article-container!= page.content
|
#article-container.post-content!=page.content
|
||||||
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
|
include includes/post/post-copyright.pug
|
||||||
.post-copyright
|
|
||||||
.post-copyright__author
|
|
||||||
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
|
||||||
span.post-copyright-info
|
|
||||||
a(href=`mailto:${config.email}`) #[=config.author]
|
|
||||||
.post-copyright__type
|
|
||||||
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
|
||||||
span.post-copyright-info
|
|
||||||
a(href=url_for(page.permalink)) #[=page.permalink]
|
|
||||||
.post-copyright__notice
|
|
||||||
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
|
||||||
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
|
||||||
|
|
||||||
.tag_share
|
.tag_share
|
||||||
if (theme.post_meta.tags)
|
if (theme.post_meta.post.tags)
|
||||||
.post-meta__tag-list
|
.post-meta__tag-list
|
||||||
each item, index in page.tags.data
|
each item, index in page.tags.data
|
||||||
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
||||||
include includes/share/index.pug
|
!=partial('includes/share/index', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.reward.enable
|
if theme.reward.enable
|
||||||
include includes/reward.pug
|
!=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
|
||||||
include includes/pagination.pug
|
|
||||||
|
|
||||||
|
//- ad
|
||||||
|
if theme.ad && theme.ad.post
|
||||||
|
.post-ad!=theme.ad.post
|
||||||
|
|
||||||
|
include includes/pagination.pug
|
||||||
if theme.related_post && theme.related_post.enable
|
if theme.related_post && theme.related_post.enable
|
||||||
!= related_posts(page,site.posts)
|
!= related_posts(page,site.posts)
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
|
|||||||
@@ -2,17 +2,13 @@ extends includes/layout.pug
|
|||||||
|
|
||||||
block content
|
block content
|
||||||
if theme.tag_ui == 'index'
|
if theme.tag_ui == 'index'
|
||||||
include ./includes/mixins/UI.pug
|
include ./includes/mixins/post-ui.pug
|
||||||
#recent-posts.recent-posts
|
#recent-posts.recent-posts
|
||||||
+UI_NEW(page.posts)
|
+postUI
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
else
|
else
|
||||||
include ./includes/mixins/article-sort.pug
|
include ./includes/mixins/article-sort.pug
|
||||||
#tag
|
#tag
|
||||||
.article-sort-title= _p('page.tag') + ' - ' + page.tag
|
.article-sort-title= _p('page.tag') + ' - ' + page.tag
|
||||||
+articleSort(page.posts)
|
+articleSort(page.posts)
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/widget/index.pug
|
|
||||||
|
|||||||
17
package.json
17
package.json
@@ -1,5 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "2.1.0",
|
"version": "2.3.5",
|
||||||
"description": "A Hexo Theme: Butterfly"
|
"private": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
},
|
||||||
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
|
"keywords": [
|
||||||
|
"hexo",
|
||||||
|
"theme",
|
||||||
|
"butterfly",
|
||||||
|
"Card UI Design"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/jerryc127/hexo-theme-butterfly.git",
|
||||||
|
"author": "Jerry <wong@jerryc.me>",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
15
scripts/events/404.js
Normal file
15
scripts/events/404.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* 404 error page
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.generator.register('404', function (locals) {
|
||||||
|
if (!hexo.theme.config.error_404.enable) return
|
||||||
|
return {
|
||||||
|
path: '404.html',
|
||||||
|
data: locals.posts,
|
||||||
|
layout: ['404']
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
|
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
hexo.on('generateBefore', function () {
|
hexo.on('generateBefore', function () {
|
||||||
const rootConfig = hexo.config
|
const rootConfig = hexo.config
|
||||||
if (hexo.locals.get) {
|
if (hexo.locals.get) {
|
||||||
22
scripts/filters/post_lazyload.js
Normal file
22
scripts/filters/post_lazyload.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* lazyload
|
||||||
|
* replace src to data-src
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||||
|
|
||||||
|
function lazyProcess (htmlContent) {
|
||||||
|
var bg = hexo.theme.config.lodding_bg.post ? urlFor(hexo.theme.config.lodding_bg.post) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
||||||
|
return htmlContent.replace(/(<img .*?src=)/ig, `$1 ${bg} data-src=`)
|
||||||
|
}
|
||||||
|
|
||||||
|
var processPost = function (data) {
|
||||||
|
if (!hexo.theme.config.lazyload) return
|
||||||
|
data.content = lazyProcess.call(this, data.content)
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
hexo.extend.filter.register('after_post_render', processPost)
|
||||||
34
scripts/filters/random_cover.js
Normal file
34
scripts/filters/random_cover.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* ramdom cover
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.filter.register('before_post_render', function (data) {
|
||||||
|
if (data.cover === false) {
|
||||||
|
data.randomcover = randomCover()
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
data.cover = data.cover || randomCover()
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
|
||||||
|
var randomCover = function () {
|
||||||
|
var theme = hexo.theme.config
|
||||||
|
var cover
|
||||||
|
var num
|
||||||
|
|
||||||
|
if (theme.cover.default_cover) {
|
||||||
|
if (!Array.isArray(theme.cover.default_cover)) {
|
||||||
|
cover = theme.cover.default_cover
|
||||||
|
return cover
|
||||||
|
} else {
|
||||||
|
num = Math.floor(Math.random() * theme.cover.default_cover.length)
|
||||||
|
cover = theme.cover.default_cover[num]
|
||||||
|
return cover
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return theme.default_top_img
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
function gallery(args, content) {
|
|
||||||
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'})}
|
|
||||||
</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
hexo.extend.tag.register('gallery', gallery, {ends: true});
|
|
||||||
112
scripts/helpers/aside_archives.js
Normal file
112
scripts/helpers/aside_archives.js
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* for aside archives
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.helper.register('aside_archives', function (options = {}) {
|
||||||
|
const { config } = this
|
||||||
|
const archiveDir = config.archive_dir
|
||||||
|
const { timezone } = config
|
||||||
|
const lang = toMomentLocale(this.page.lang || this.page.language || config.language)
|
||||||
|
let { format } = options
|
||||||
|
const type = options.type || 'monthly'
|
||||||
|
const { transform } = options
|
||||||
|
const showCount = Object.prototype.hasOwnProperty.call(options, 'show_count') ? options.show_count : true
|
||||||
|
const order = options.order || -1
|
||||||
|
const compareFunc = type === 'monthly'
|
||||||
|
? (yearA, monthA, yearB, monthB) => yearA === yearB && monthA === monthB
|
||||||
|
: (yearA, monthA, yearB, monthB) => yearA === yearB
|
||||||
|
const limit = options.limit
|
||||||
|
const moreButton = this._p('aside.more_button')
|
||||||
|
let result = ''
|
||||||
|
|
||||||
|
if (!format) {
|
||||||
|
format = type === 'monthly' ? 'MMMM YYYY' : 'YYYY'
|
||||||
|
}
|
||||||
|
|
||||||
|
const posts = this.site.posts.sort('date', order)
|
||||||
|
if (!posts.length) return result
|
||||||
|
|
||||||
|
const data = []
|
||||||
|
let length = 0
|
||||||
|
|
||||||
|
posts.forEach(post => {
|
||||||
|
// Clone the date object to avoid pollution
|
||||||
|
let date = post.date.clone()
|
||||||
|
|
||||||
|
if (timezone) date = date.tz(timezone)
|
||||||
|
|
||||||
|
const year = date.year()
|
||||||
|
const month = date.month() + 1
|
||||||
|
const lastData = data[length - 1]
|
||||||
|
|
||||||
|
if (!lastData || !compareFunc(lastData.year, lastData.month, year, month)) {
|
||||||
|
if (lang) date = date.locale(lang)
|
||||||
|
const name = date.format(format)
|
||||||
|
length = data.push({
|
||||||
|
name,
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
count: 1
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
lastData.count++
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const link = item => {
|
||||||
|
let url = `${archiveDir}/${item.year}/`
|
||||||
|
|
||||||
|
if (type === 'monthly') {
|
||||||
|
if (item.month < 10) url += '0'
|
||||||
|
url += `${item.month}/`
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.url_for(url)
|
||||||
|
}
|
||||||
|
|
||||||
|
result += '<ul class="card-archive-list">'
|
||||||
|
|
||||||
|
const len = data.length
|
||||||
|
const Judge = limit === 0 ? len : Math.min(len, limit)
|
||||||
|
|
||||||
|
for (let i = 0; i < Judge; i++) {
|
||||||
|
const item = data[i]
|
||||||
|
|
||||||
|
result += '<li class="card-archive-list-item">'
|
||||||
|
|
||||||
|
result += `<a class="card-archive-list-link" href="${link(item)}">`
|
||||||
|
result += '<span class="card-archive-list-date">'
|
||||||
|
result += transform ? transform(item.name) : item.name
|
||||||
|
result += '</span>'
|
||||||
|
|
||||||
|
if (showCount) {
|
||||||
|
result += `<span class="card-archive-list-count">${item.count}</span>`
|
||||||
|
}
|
||||||
|
result += '</a>'
|
||||||
|
result += '</li>'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len > Judge) {
|
||||||
|
result += '<li class="card-archive-list-item more is-center">'
|
||||||
|
result += `<a class="card-archive-list-link-more" href="${this.url_for(archiveDir)}">
|
||||||
|
<span>${moreButton}</span><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>`
|
||||||
|
}
|
||||||
|
result += '</ul>'
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
var toMomentLocale = function (lang) {
|
||||||
|
if (lang === undefined) {
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
// moment.locale('') equals moment.locale('en')
|
||||||
|
// moment.locale(null) equals moment.locale('en')
|
||||||
|
if (!lang || lang === 'en' || lang === 'default') {
|
||||||
|
return 'en'
|
||||||
|
}
|
||||||
|
return lang.toLowerCase().replace('_', '-')
|
||||||
|
}
|
||||||
97
scripts/helpers/aside_categories.js
Normal file
97
scripts/helpers/aside_categories.js
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* for aside categories
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.helper.register('aside_categories', function (categories, options) {
|
||||||
|
if (
|
||||||
|
!options &&
|
||||||
|
(!categories || !Object.prototype.hasOwnProperty.call(categories, 'length'))
|
||||||
|
) {
|
||||||
|
options = categories
|
||||||
|
categories = this.site.categories
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!categories || !categories.length) return ''
|
||||||
|
options = options || {}
|
||||||
|
const { config } = this
|
||||||
|
const showCount = Object.prototype.hasOwnProperty.call(options, 'show_count')
|
||||||
|
? options.show_count
|
||||||
|
: true
|
||||||
|
const depth = options.depth ? parseInt(options.depth, 10) : 0
|
||||||
|
const orderby = options.orderby || 'name'
|
||||||
|
const order = options.order || 1
|
||||||
|
const categoryDir = this.url_for(config.category_dir)
|
||||||
|
const limit = options.limit === 0 ? categories.length : options.limit
|
||||||
|
const buttonLabel = this._p('aside.more_button')
|
||||||
|
const prepareQuery = (parent) => {
|
||||||
|
const query = {}
|
||||||
|
if (parent) {
|
||||||
|
query.parent = parent
|
||||||
|
} else {
|
||||||
|
query.parent = {
|
||||||
|
$exists: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return categories
|
||||||
|
.find(query)
|
||||||
|
.sort(orderby, order)
|
||||||
|
.filter((cat) => cat.length)
|
||||||
|
}
|
||||||
|
|
||||||
|
const hierarchicalList = (t, level, parent) => {
|
||||||
|
let result = ''
|
||||||
|
if (t > 0) {
|
||||||
|
prepareQuery(parent).forEach((cat, i) => {
|
||||||
|
if (t > 0) {
|
||||||
|
t = t - 1
|
||||||
|
let child
|
||||||
|
if (!depth || level + 1 < depth) {
|
||||||
|
var childList = hierarchicalList(t, level + 1, cat._id)
|
||||||
|
child = childList[0]
|
||||||
|
t = childList[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
result += '<li class="card-category-list-item">'
|
||||||
|
|
||||||
|
result += `<a class="card-category-list-link" href="${this.url_for(
|
||||||
|
cat.path
|
||||||
|
)}">`
|
||||||
|
result += `<span class="card-category-list-name">${cat.name}</span>`
|
||||||
|
|
||||||
|
if (showCount) {
|
||||||
|
result += `<span class="card-category-list-count">${cat.length}</span>`
|
||||||
|
}
|
||||||
|
|
||||||
|
result += '</a>'
|
||||||
|
result += '</li>'
|
||||||
|
|
||||||
|
if (child) {
|
||||||
|
result += `<ul class="card-category-list child">${child}</ul>`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return [result, t]
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = hierarchicalList(limit, 0)
|
||||||
|
|
||||||
|
var moreButton = function () {
|
||||||
|
var moreHtml = ''
|
||||||
|
if (categories.length <= limit) return ''
|
||||||
|
moreHtml += '<li class="card-category-list-item more is-center">'
|
||||||
|
moreHtml += `<a class="card-category-list-link-more" href="${categoryDir}">
|
||||||
|
<span>${buttonLabel}</span><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>`
|
||||||
|
|
||||||
|
return moreHtml
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<ul class="card-category-list">
|
||||||
|
${list[0]}
|
||||||
|
${moreButton()}
|
||||||
|
</ul>`
|
||||||
|
})
|
||||||
58
scripts/helpers/page.js
Normal file
58
scripts/helpers/page.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* @example
|
||||||
|
* page_description()
|
||||||
|
* injectHtml(data)
|
||||||
|
* cloudTags(source, minfontsize, maxfontsize, limit)
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const { stripHTML, escapeHTML } = require('hexo-util')
|
||||||
|
|
||||||
|
hexo.extend.helper.register('page_description', function () {
|
||||||
|
const { config, page } = this
|
||||||
|
let description = page.description || page.content || page.title || config.description
|
||||||
|
|
||||||
|
if (description) {
|
||||||
|
description = escapeHTML(stripHTML(description).substring(0, 200)
|
||||||
|
.trim()
|
||||||
|
).replace(/\n/g, ' ')
|
||||||
|
return description
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
hexo.extend.helper.register('injectHtml', function (data) {
|
||||||
|
let result = ''
|
||||||
|
if (!data) return ''
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
result += data[i]
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
hexo.extend.helper.register('cloudTags', function (options = {}) {
|
||||||
|
const env = this
|
||||||
|
const source = options.source
|
||||||
|
const minfontsize = options.minfontsize
|
||||||
|
const maxfontsize = options.maxfontsize
|
||||||
|
const limit = options.limit
|
||||||
|
|
||||||
|
let result = ''
|
||||||
|
const tagLimit = limit === 0 ? source.length : limit
|
||||||
|
source.sort('name').limit(tagLimit).forEach(function (tags) {
|
||||||
|
var fontSize = Math.floor(Math.random() * (maxfontsize - minfontsize) + minfontsize) + 'px'
|
||||||
|
var color = 'rgb(' + Math.floor(Math.random() * 201) + ', ' + Math.floor(Math.random() * 201) + ', ' + Math.floor(Math.random() * 201) + ')' // 0,0,0 -> 200,200,200
|
||||||
|
result += `<a href='${env.url_for(tags.path)}' style='font-size:${fontSize}; color:${color}'>${tags.name}</a>`
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
hexo.extend.helper.register('urlNoIndex', function () {
|
||||||
|
const { permalink } = hexo.config
|
||||||
|
let url = this.url.replace(/index\.html$/, '')
|
||||||
|
if (!permalink.endsWith('.html')) {
|
||||||
|
url = url.replace(/\.html$/, '')
|
||||||
|
}
|
||||||
|
return url
|
||||||
|
})
|
||||||
123
scripts/helpers/related_post.js
Normal file
123
scripts/helpers/related_post.js
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* Related Posts
|
||||||
|
* According the tag
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||||
|
var relatedPosts = []
|
||||||
|
currentPost.tags.forEach(function (tag) {
|
||||||
|
allPosts.forEach(function (post) {
|
||||||
|
if (isTagRelated(tag.name, post.tags)) {
|
||||||
|
var relatedPost = {
|
||||||
|
title: post.title,
|
||||||
|
path: post.path,
|
||||||
|
cover: post.cover,
|
||||||
|
randomcover: post.randomcover,
|
||||||
|
weight: 1,
|
||||||
|
updated: post.updated,
|
||||||
|
created: post.date
|
||||||
|
}
|
||||||
|
var index = findItem(relatedPosts, 'path', post.path)
|
||||||
|
if (index !== -1) {
|
||||||
|
relatedPosts[index].weight += 1
|
||||||
|
} else {
|
||||||
|
if (currentPost.path !== post.path) {
|
||||||
|
relatedPosts.push(relatedPost)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (relatedPosts.length === 0) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
var result = ''
|
||||||
|
const hexoConfig = hexo.theme.config.rootConfig
|
||||||
|
const config = hexo.theme.config
|
||||||
|
|
||||||
|
var limitNum = config.related_post.limit || 6
|
||||||
|
var dateType = config.related_post.date_type || 'created'
|
||||||
|
var headlineLang = this._p('post.recommend')
|
||||||
|
var lazySrc = config.lazyload ? 'data-src' : 'src'
|
||||||
|
|
||||||
|
relatedPosts = relatedPosts.sort(compare('weight'))
|
||||||
|
|
||||||
|
if (relatedPosts.length > 0) {
|
||||||
|
result += '<div class="relatedPosts">'
|
||||||
|
result +=
|
||||||
|
'<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' +
|
||||||
|
' ' +
|
||||||
|
headlineLang +
|
||||||
|
'</span></div>'
|
||||||
|
result += '<div class="relatedPosts_list">'
|
||||||
|
|
||||||
|
for (var i = 0; i < Math.min(relatedPosts.length, limitNum); i++) {
|
||||||
|
var cover =
|
||||||
|
relatedPosts[i].cover === false
|
||||||
|
? relatedPosts[i].randomcover
|
||||||
|
: relatedPosts[i].cover
|
||||||
|
result +=
|
||||||
|
'<div class="relatedPosts_item"><a href="' +
|
||||||
|
hexoConfig.root +
|
||||||
|
relatedPosts[i].path +
|
||||||
|
'" title="' +
|
||||||
|
relatedPosts[i].title +
|
||||||
|
'">'
|
||||||
|
result +=
|
||||||
|
'<img class="relatedPosts_cover" ' +
|
||||||
|
lazySrc +
|
||||||
|
'="' +
|
||||||
|
cover +
|
||||||
|
'">'
|
||||||
|
if (dateType === 'created') {
|
||||||
|
result +=
|
||||||
|
'<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i>' +
|
||||||
|
' ' +
|
||||||
|
this.date(relatedPosts[i].created, hexoConfig.date_format) +
|
||||||
|
'</div>'
|
||||||
|
} else {
|
||||||
|
result +=
|
||||||
|
'<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-history fa-fw" aria-hidden="true"></i>' +
|
||||||
|
' ' +
|
||||||
|
this.date(relatedPosts[i].updated, hexoConfig.date_format) +
|
||||||
|
'</div>'
|
||||||
|
}
|
||||||
|
result +=
|
||||||
|
'<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>'
|
||||||
|
result += '</div></a></div>'
|
||||||
|
}
|
||||||
|
|
||||||
|
result += '</div><div class="clear_both"></div></div>'
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function isTagRelated (tagName, TBDtags) {
|
||||||
|
var result = false
|
||||||
|
TBDtags.forEach(function (tag) {
|
||||||
|
if (tagName === tag.name) {
|
||||||
|
result = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
function findItem (arrayToSearch, attr, val) {
|
||||||
|
for (var i = 0; i < arrayToSearch.length; i++) {
|
||||||
|
if (arrayToSearch[i][attr] === val) {
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
function compare (attr) {
|
||||||
|
return function (a, b) {
|
||||||
|
var val1 = a[attr]
|
||||||
|
var val2 = b[attr]
|
||||||
|
return val2 - val1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
/**
|
|
||||||
* global hexo
|
|
||||||
* from printempw/hexo-hide-posts
|
|
||||||
* modify by Jerry
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var public_generators = [];
|
|
||||||
|
|
||||||
hexo.extend.filter.register('before_generate', function () {
|
|
||||||
this._bindLocals();
|
|
||||||
|
|
||||||
const all_posts = this.locals.get('posts');
|
|
||||||
const hidden_posts = all_posts.find({
|
|
||||||
'hide': true
|
|
||||||
});
|
|
||||||
const normal_posts = all_posts.filter(post => !post['hide']);
|
|
||||||
|
|
||||||
this.locals.set('all_posts', all_posts);
|
|
||||||
this.locals.set('hidden_posts', hidden_posts);
|
|
||||||
this.locals.set('posts', normal_posts);
|
|
||||||
});
|
|
||||||
|
|
||||||
hexo.extend.filter.register('after_init', function () {
|
|
||||||
|
|
||||||
const original = {};
|
|
||||||
for (const name in hexo.extend.generator.list()) {
|
|
||||||
original[name] = hexo.extend.generator.get(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
hexo.extend.generator.register('post', async function (locals) {
|
|
||||||
const fg = original.post.bind(this);
|
|
||||||
|
|
||||||
const generated_public = await fg(locals);
|
|
||||||
const generated_hidden = await fg(Object.assign({}, locals, {
|
|
||||||
posts: locals.hidden_posts
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Remove post.prev and post.next for hidden posts
|
|
||||||
generated_hidden.forEach(ele => {
|
|
||||||
ele.data.prev = ele.data.next = null;
|
|
||||||
});
|
|
||||||
|
|
||||||
return generated_public.concat(generated_hidden);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Then we hack into other generators if necessary
|
|
||||||
public_generators.filter(
|
|
||||||
name => Object.keys(original).includes(name)
|
|
||||||
).forEach(name => {
|
|
||||||
// Overwrite original generator
|
|
||||||
hexo.extend.generator.register(name, function (locals) {
|
|
||||||
const fg = original[name].bind(this);
|
|
||||||
|
|
||||||
return fg(Object.assign({}, locals, {
|
|
||||||
posts: new locals.posts.constructor(
|
|
||||||
locals.posts.data.concat(locals.hidden_posts.data)
|
|
||||||
)
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
hexo.extend.filter.register('after_post_render', data => {
|
|
||||||
|
|
||||||
const cheerio = require('cheerio');
|
|
||||||
|
|
||||||
const $ = cheerio.load(data.content, {
|
|
||||||
decodeEntities: false
|
|
||||||
});
|
|
||||||
var theme = hexo.theme.config;
|
|
||||||
|
|
||||||
if (theme.highlight_shrink === 'none' && !theme.highlight_lang && !theme.highlight_copy) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('figure.highlight').wrap('<div class="code-area-wrap"></div>')
|
|
||||||
var $highlight_layout = $('<div class="highlight-tools"></div>')
|
|
||||||
|
|
||||||
$('figure').before($highlight_layout)
|
|
||||||
|
|
||||||
if (theme.highlight_shrink == true) {
|
|
||||||
var $code_expand = $('<i class="fa fa-angle-down code-expand code-closed" aria-hidden="true"></i>')
|
|
||||||
$('.highlight-tools').append($code_expand)
|
|
||||||
} else if (theme.highlight_shrink === false) {
|
|
||||||
var $code_expand = $('<i class="fa fa-angle-down code-expand" aria-hidden="true"></i>')
|
|
||||||
$('.highlight-tools').append($code_expand)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theme.highlight_lang) {
|
|
||||||
var $highlight_lang = $('<div class="code_lang"></div>')
|
|
||||||
$('.highlight-tools').append($highlight_lang)
|
|
||||||
var lang_name_index;
|
|
||||||
var lang_name;
|
|
||||||
$('figure').each(function () {
|
|
||||||
lang_name_index = lang_name = $(this).attr('class').split(' ')[1];
|
|
||||||
if (lang_name_index == 'js')
|
|
||||||
lang_name = 'Javascript'
|
|
||||||
if (lang_name_index == 'md')
|
|
||||||
lang_name = 'Markdown'
|
|
||||||
if (lang_name_index == 'plain')
|
|
||||||
lang_name = 'Code'
|
|
||||||
if (lang_name_index == 'py')
|
|
||||||
lang_name = 'Python'
|
|
||||||
|
|
||||||
$(this).prev().find(".code_lang").text(lang_name)
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (theme.highlight_copy) {
|
|
||||||
var $copyIcon = $('<i class="fa fa-clipboard" aria-hidden="true"></i>')
|
|
||||||
var $notice = $('<div class="copy-notice"></div>')
|
|
||||||
$('.highlight-tools').append($notice)
|
|
||||||
$('.highlight-tools').append($copyIcon)
|
|
||||||
}
|
|
||||||
|
|
||||||
data.content = $.html();
|
|
||||||
}, 100);
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
|
|
||||||
hexo.extend.helper.register("list_archives", function(options = {}) {
|
|
||||||
const { config } = this;
|
|
||||||
const archiveDir = config.archive_dir;
|
|
||||||
const { timezone } = config;
|
|
||||||
const lang = this.page.lang || this.page.language || config.language;
|
|
||||||
let { format } = options;
|
|
||||||
const type = options.type || "monthly";
|
|
||||||
const { style = "list", transform, separator = ", " } = options;
|
|
||||||
const showCount = Object.prototype.hasOwnProperty.call(options, "show_count")
|
|
||||||
? options.show_count
|
|
||||||
: true;
|
|
||||||
const order = options.order || -1;
|
|
||||||
const limit = 8;
|
|
||||||
let result = "";
|
|
||||||
|
|
||||||
var more_button;
|
|
||||||
if (lang === "zh-CN") {
|
|
||||||
more_button = "查看更多";
|
|
||||||
} else if (lang === "zh-TW") {
|
|
||||||
more_button = "查看更多";
|
|
||||||
} else {
|
|
||||||
more_button = "More";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!format) {
|
|
||||||
format = type === "monthly" ? "MMMM YYYY" : "YYYY";
|
|
||||||
}
|
|
||||||
|
|
||||||
const posts = this.site.posts.sort("date", order);
|
|
||||||
if (!posts.length) return result;
|
|
||||||
|
|
||||||
const data = [];
|
|
||||||
let length = 0;
|
|
||||||
|
|
||||||
posts.forEach(post => {
|
|
||||||
// Clone the date object to avoid pollution
|
|
||||||
let date = post.date.clone();
|
|
||||||
|
|
||||||
if (timezone) date = date.tz(timezone);
|
|
||||||
if (lang) date = date.locale(lang);
|
|
||||||
|
|
||||||
const year = date.year();
|
|
||||||
const month = date.month() + 1;
|
|
||||||
const name = date.format(format);
|
|
||||||
const lastData = data[length - 1];
|
|
||||||
|
|
||||||
if (!lastData || lastData.name !== name) {
|
|
||||||
length = data.push({
|
|
||||||
name,
|
|
||||||
year,
|
|
||||||
month,
|
|
||||||
count: 1
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
lastData.count++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const link = item => {
|
|
||||||
let url = `${archiveDir}/${item.year}/`;
|
|
||||||
|
|
||||||
if (type === "monthly") {
|
|
||||||
if (item.month < 10) url += "0";
|
|
||||||
url += `${item.month}/`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.url_for(url);
|
|
||||||
};
|
|
||||||
|
|
||||||
result += `<ul class="archive-list">`;
|
|
||||||
|
|
||||||
for (let i = 0, len = data.length; i < Math.min(len, limit); i++) {
|
|
||||||
const item = data[i];
|
|
||||||
|
|
||||||
result += `<li class="archive-list-item">`;
|
|
||||||
|
|
||||||
result += `<a class="archive-list-link" href="${link(item)}">`;
|
|
||||||
result += `<span class="archive-list-date">`;
|
|
||||||
result += transform ? transform(item.name) : item.name;
|
|
||||||
result += `</span>`;
|
|
||||||
|
|
||||||
if (showCount) {
|
|
||||||
result += `<span class="archive-list-count">${item.count}</span>`;
|
|
||||||
}
|
|
||||||
result += "</a>";
|
|
||||||
result += "</li>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.length > limit) {
|
|
||||||
result += `<li class="archive-list-item">`;
|
|
||||||
result +=
|
|
||||||
`<a class="archive-list-link-more" href="` +
|
|
||||||
"/" +
|
|
||||||
`${archiveDir}" >`;
|
|
||||||
result += more_button;
|
|
||||||
result += "</a>";
|
|
||||||
result += "</li>";
|
|
||||||
}
|
|
||||||
result += "</ul>";
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
/**
|
|
||||||
* note.js
|
|
||||||
* transplant from hexo-theme-next
|
|
||||||
*/
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
function postNote(args, content) {
|
|
||||||
return `<div class="note ${args.join(' ')}">
|
|
||||||
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
|
||||||
</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
hexo.extend.tag.register('note', postNote, {ends: true});
|
|
||||||
hexo.extend.tag.register('subnote', postNote, {ends: true});
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
'use strict'
|
|
||||||
hexo.extend.filter.register('after_post_render', data => {
|
|
||||||
const theme = hexo.theme.config;
|
|
||||||
|
|
||||||
const cheerio = require('cheerio');
|
|
||||||
|
|
||||||
const $ = cheerio.load(data.content, { decodeEntities: false });
|
|
||||||
|
|
||||||
const images = $('img').not($('a>img'));
|
|
||||||
|
|
||||||
if (theme.fancybox.enable) {
|
|
||||||
images.each((i, o) => {
|
|
||||||
var lazyload_src = $(o).attr('src') ? $(o).attr('src') : $(o).attr("data-src")
|
|
||||||
var alt = $(o).attr('alt')
|
|
||||||
if (alt !== undefined) {
|
|
||||||
$(o).attr('title', alt)
|
|
||||||
}
|
|
||||||
var $a = $(
|
|
||||||
'<a href="' +
|
|
||||||
lazyload_src +
|
|
||||||
'" data-fancybox="group" data-caption="' +
|
|
||||||
$(o).attr('alt') +
|
|
||||||
'" class="fancybox"></a>'
|
|
||||||
)
|
|
||||||
$(o).wrap($a)
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
if (theme.medium_zoom.enable) {
|
|
||||||
images.each((i, o) => {
|
|
||||||
$(o).addClass('mediumZoom')
|
|
||||||
})
|
|
||||||
|
|
||||||
var imgList = $(".justified-gallery img")
|
|
||||||
if (imgList.length) {
|
|
||||||
imgList.each((i, o) => {
|
|
||||||
var $a = $('<div></div>')
|
|
||||||
$(o).wrap($a)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!theme.medium_zoom.enable && !theme.fancybox.enable) {
|
|
||||||
var imgList = $(".justified-gallery > p >img")
|
|
||||||
if (imgList.length) {
|
|
||||||
imgList.each((i, o) => {
|
|
||||||
$(o).wrap('<div></div>')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data.content = $.html();
|
|
||||||
}, 100);
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
const url_for = require('hexo-util').url_for.bind(hexo);
|
|
||||||
|
|
||||||
hexo.extend.filter.register('after_post_render', data => {
|
|
||||||
var theme = hexo.theme.config;
|
|
||||||
var bg = theme.lodding_bg.post;
|
|
||||||
if (!theme.lazyload.enable) return;
|
|
||||||
|
|
||||||
const cheerio = require('cheerio');
|
|
||||||
|
|
||||||
const $ = cheerio.load(data.content, {decodeEntities: false});
|
|
||||||
const images = $('img').not($('.justified-gallery img'));
|
|
||||||
if (!images.length) return;
|
|
||||||
|
|
||||||
images.each((i, o) => {
|
|
||||||
let src = $(o).attr('src');
|
|
||||||
$(o).attr('data-src', src).removeAttr('src');
|
|
||||||
if (bg){
|
|
||||||
$(o).attr('src',url_for(bg))
|
|
||||||
}
|
|
||||||
$(o).addClass('lazyload');
|
|
||||||
});
|
|
||||||
|
|
||||||
data.content = $.html();
|
|
||||||
}, 100);
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
hexo.extend.filter.register('before_post_render', function(data){
|
|
||||||
data.cover = data.cover || random_cover()
|
|
||||||
return data;
|
|
||||||
});
|
|
||||||
|
|
||||||
var random_cover = function () {
|
|
||||||
var cover;
|
|
||||||
var num;
|
|
||||||
if (!Array.isArray(hexo.theme.config.default_cover)) {
|
|
||||||
cover = hexo.theme.config.default_cover
|
|
||||||
return cover
|
|
||||||
} else {
|
|
||||||
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
|
|
||||||
cover = hexo.theme.config.default_cover[num];
|
|
||||||
return cover
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
const moment = require('moment-timezone');
|
|
||||||
const {
|
|
||||||
isMoment
|
|
||||||
} = moment;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
|
||||||
var relatedPosts = [];
|
|
||||||
currentPost.tags.forEach(function (tag) {
|
|
||||||
allPosts.forEach(function (post) {
|
|
||||||
if (isTagRelated(tag.name, post.tags)) {
|
|
||||||
var relatedPost = {
|
|
||||||
title: post.title,
|
|
||||||
path: post.path,
|
|
||||||
cover: post.cover,
|
|
||||||
weight: 1,
|
|
||||||
updated: post.updated,
|
|
||||||
created: post.created
|
|
||||||
};
|
|
||||||
var index = findItem(relatedPosts, 'path', post.path);
|
|
||||||
if (index != -1) {
|
|
||||||
relatedPosts[index].weight += 1;
|
|
||||||
} else {
|
|
||||||
if (currentPost.path != post.path) {
|
|
||||||
relatedPosts.push(relatedPost);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
if (relatedPosts.length == 0) {
|
|
||||||
return ''
|
|
||||||
};
|
|
||||||
var result = "";
|
|
||||||
const hexoConfig = hexo.theme.config.rootConfig;
|
|
||||||
const config = hexo.theme.config;
|
|
||||||
|
|
||||||
var limit_num = config.related_post.limit || 6
|
|
||||||
var lang = hexoConfig.language;
|
|
||||||
var date_type = config.related_post.date_type || 'created'
|
|
||||||
var headline_lang;
|
|
||||||
if (lang === 'zh-CN') {
|
|
||||||
headline_lang = '相关推荐';
|
|
||||||
} else if (lang === 'zh-TW') {
|
|
||||||
headline_lang = '相關推薦';
|
|
||||||
} else {
|
|
||||||
headline_lang = 'Recommend';
|
|
||||||
}
|
|
||||||
|
|
||||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
|
||||||
var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
|
||||||
var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
|
|
||||||
|
|
||||||
if (relatedPosts.length > 0) {
|
|
||||||
result += '<div class="relatedPosts">'
|
|
||||||
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + ' ' + headline_lang + '</span></div>'
|
|
||||||
result += '<div class="relatedPosts_list">'
|
|
||||||
|
|
||||||
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
|
|
||||||
|
|
||||||
var cover = relatedPosts[i].cover
|
|
||||||
|
|
||||||
result += '<div class="relatedPosts_item"><a href="' + hexoConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
|
|
||||||
result += '<img class="relatedPosts_cover ' + lazy_class + '"' + lazy_src + '="' + cover + '">';
|
|
||||||
if (date_type == 'created') {
|
|
||||||
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i>' + ' ' + dateHelper(relatedPosts[i].created) + '</div>'
|
|
||||||
} else {
|
|
||||||
result += '<div class="relatedPosts_main"><div class="relatedPosts_date"><i class="fa fa-history fa-fw" aria-hidden="true"></i>' + ' ' + dateHelper(relatedPosts[i].updated) + '</div>'
|
|
||||||
}
|
|
||||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
|
||||||
result += '</div></a></div>'
|
|
||||||
};
|
|
||||||
|
|
||||||
result += '</div><div class="clear_both"></div></div>'
|
|
||||||
return result;
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
hexo.extend.helper.register('echo', function (path) {
|
|
||||||
return path;
|
|
||||||
});
|
|
||||||
|
|
||||||
function isTagRelated(tagName, TBDtags) {
|
|
||||||
var result = false;
|
|
||||||
TBDtags.forEach(function (tag) {
|
|
||||||
if (tagName == tag.name) {
|
|
||||||
result = true;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function findItem(arrayToSearch, attr, val) {
|
|
||||||
for (var i = 0; i < arrayToSearch.length; i++) {
|
|
||||||
if (arrayToSearch[i][attr] == val) {
|
|
||||||
return i
|
|
||||||
};
|
|
||||||
};
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function compare(attr) {
|
|
||||||
return function (a, b) {
|
|
||||||
var val1 = a[attr];
|
|
||||||
var val2 = b[attr];
|
|
||||||
return val2 - val1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function dateHelper(date) {
|
|
||||||
const moment = getMoment(date, hexo.theme.config.rootConfig.language);
|
|
||||||
return moment.format(hexo.theme.config.rootConfig.date_format);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMoment(date, lang) {
|
|
||||||
if (date == null) date = moment();
|
|
||||||
if (!isMoment(date)) date = moment(isDate(date) ? date : new Date(date));
|
|
||||||
if (lang) date = date.locale(lang);
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
34
scripts/tags/gallery.js
Normal file
34
scripts/tags/gallery.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* galleryGroup and allery
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
const url_for = require('hexo-util').url_for.bind(hexo)
|
||||||
|
|
||||||
|
function gallery (args, content) {
|
||||||
|
return `<div class="justified-gallery">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
||||||
|
</div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
function galleryGroup (args) {
|
||||||
|
const name = args[0]
|
||||||
|
const desrc = args[1]
|
||||||
|
const url = url_for(args[2])
|
||||||
|
const img = url_for(args[3])
|
||||||
|
|
||||||
|
return `
|
||||||
|
<figure class="gallery-group">
|
||||||
|
<img class="gallery-group-img" src='${img}'>
|
||||||
|
<figcaption>
|
||||||
|
<div class="gallery-group-name">${name}</div>
|
||||||
|
<p>${desrc}</p>
|
||||||
|
<a href='${url}'></a>
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
hexo.extend.tag.register('gallery', gallery, { ends: true })
|
||||||
|
hexo.extend.tag.register('galleryGroup', galleryGroup)
|
||||||
71
scripts/tags/hide.js
Normal file
71
scripts/tags/hide.js
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* @example
|
||||||
|
* hideInline
|
||||||
|
* {% hideInline content,display,bg,color %}
|
||||||
|
* content不能包含當引號,可用 '
|
||||||
|
* hideBlock
|
||||||
|
* {% hideBlock display,bg,color %}
|
||||||
|
* content
|
||||||
|
* {% endhideBlock %}
|
||||||
|
* hideToggle
|
||||||
|
* {% hideToggle display,bg,color %}
|
||||||
|
* content
|
||||||
|
* {% endhideToggle %}
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
function hideInline (args) {
|
||||||
|
args = args.join(' ').split(',')
|
||||||
|
var content = args[0]
|
||||||
|
var display = args[1] || 'Click'
|
||||||
|
var bg = args[2] || false
|
||||||
|
var color = args[3] || false
|
||||||
|
var group = 'style="'
|
||||||
|
|
||||||
|
if (bg) group += `background-color: ${bg};`
|
||||||
|
if (color) group += `color: ${color}`
|
||||||
|
group += '"'
|
||||||
|
|
||||||
|
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" ${group}>${display}
|
||||||
|
</a><span class="hide-content">${content}</span></span>`
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideBlock (args, content) {
|
||||||
|
args = args.join(' ').split(',')
|
||||||
|
var display = args[0] || 'Click'
|
||||||
|
var bg = args[1] || false
|
||||||
|
var color = args[2] || false
|
||||||
|
var group = 'style="'
|
||||||
|
|
||||||
|
if (bg) group += `background-color: ${bg};`
|
||||||
|
if (color) group += `color: ${color}`
|
||||||
|
group += '"'
|
||||||
|
|
||||||
|
return `<div class="hide-block"><a class="hide-button button--primary button--animated" ${group}>${display}
|
||||||
|
</a><span class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</span></div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideToggle (args, content) {
|
||||||
|
args = args.join(' ').split(',')
|
||||||
|
var display = args[0]
|
||||||
|
var bg = args[1] || false
|
||||||
|
var color = args[2] || false
|
||||||
|
var group = 'style="'
|
||||||
|
var border = ''
|
||||||
|
|
||||||
|
if (bg) {
|
||||||
|
border = `style="border: 1px solid ${bg}"`
|
||||||
|
group += `background-color: ${bg};`
|
||||||
|
}
|
||||||
|
if (color) group += `color: ${color}`
|
||||||
|
group += '"'
|
||||||
|
|
||||||
|
return `<div class="hide-toggle" ${border}><div class="hide-button toggle-title" ${group}><i class="fa fa-caret-right fa-fw"></i><span>${display}</span></div>
|
||||||
|
<div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</div></div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
hexo.extend.tag.register('hideInline', hideInline)
|
||||||
|
hexo.extend.tag.register('hideBlock', hideBlock, { ends: true })
|
||||||
|
hexo.extend.tag.register('hideToggle', hideToggle, { ends: true })
|
||||||
15
scripts/tags/mermaid.js
Normal file
15
scripts/tags/mermaid.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* mermaid
|
||||||
|
* https://github.com/mermaid-js/mermaid
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
function mermaid (args, content) {
|
||||||
|
return `<div class="mermaid">
|
||||||
|
${content}
|
||||||
|
</div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
||||||
15
scripts/tags/note.js
Normal file
15
scripts/tags/note.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* note.js
|
||||||
|
* transplant from hexo-theme-next
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
function postNote (args, content) {
|
||||||
|
return `<div class="note ${args.join(' ')}">
|
||||||
|
${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
||||||
|
</div>`
|
||||||
|
}
|
||||||
|
|
||||||
|
hexo.extend.tag.register('note', postNote, { ends: true })
|
||||||
|
hexo.extend.tag.register('subnote', postNote, { ends: true })
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
hexo.extend.helper.register('url_check', function (p) {
|
|
||||||
|
|
||||||
let src = p ;
|
|
||||||
let reg = /^https?/ig;
|
|
||||||
return reg.test(src)
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
@@ -5,11 +5,12 @@ html
|
|||||||
body
|
body
|
||||||
position: relative
|
position: relative
|
||||||
min-height: 100%
|
min-height: 100%
|
||||||
background: $white
|
background: $body-bg
|
||||||
color: $font-black
|
color: $font-black
|
||||||
font-size: $font-size
|
font-size: $font-size
|
||||||
font-family: $font-family
|
font-family: $font-family
|
||||||
line-height: $text-line-height
|
line-height: $text-line-height
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0)
|
||||||
|
|
||||||
if !hexo-config('copy.enable')
|
if !hexo-config('copy.enable')
|
||||||
user-select: none
|
user-select: none
|
||||||
@@ -17,13 +18,6 @@ body
|
|||||||
-webkit-user-select: none
|
-webkit-user-select: none
|
||||||
-ms-user-select: none
|
-ms-user-select: none
|
||||||
|
|
||||||
#body-wrap
|
|
||||||
position: relative
|
|
||||||
display: flex
|
|
||||||
flex: 1 auto
|
|
||||||
flex-direction: column
|
|
||||||
transition: all .5s
|
|
||||||
|
|
||||||
*::-webkit-scrollbar
|
*::-webkit-scrollbar
|
||||||
width: 8px
|
width: 8px
|
||||||
height: 8px
|
height: 8px
|
||||||
@@ -59,9 +53,6 @@ h6
|
|||||||
code
|
code
|
||||||
font-size: inherit !important
|
font-size: inherit !important
|
||||||
|
|
||||||
#content-outer
|
|
||||||
flex: 1 auto
|
|
||||||
|
|
||||||
*
|
*
|
||||||
box-sizing: border-box
|
box-sizing: border-box
|
||||||
|
|
||||||
@@ -71,7 +62,7 @@ h6
|
|||||||
left: $sidebar-icon-left
|
left: $sidebar-icon-left
|
||||||
z-index: 100
|
z-index: 100
|
||||||
font-size: $sidebar-icon-size
|
font-size: $sidebar-icon-size
|
||||||
opacity: 0
|
// opacity: 0
|
||||||
cursor: pointer
|
cursor: pointer
|
||||||
transition: all .2s
|
transition: all .2s
|
||||||
|
|
||||||
@@ -79,8 +70,7 @@ hr
|
|||||||
position: relative
|
position: relative
|
||||||
margin: 2rem auto
|
margin: 2rem auto
|
||||||
width: calc(100% - 4px)
|
width: calc(100% - 4px)
|
||||||
border: 2px dashed $pale-blue
|
border: 2px dashed lighten($theme-hr-color, 50%)
|
||||||
background: $white
|
|
||||||
|
|
||||||
&:hover
|
&:hover
|
||||||
&:before
|
&:before
|
||||||
@@ -91,54 +81,51 @@ hr
|
|||||||
top: $hr-icon-top
|
top: $hr-icon-top
|
||||||
left: 5%
|
left: 5%
|
||||||
z-index: 1
|
z-index: 1
|
||||||
color: $light-blue
|
color: $theme-hr-color
|
||||||
content: $hr-icon
|
content: $hr-icon
|
||||||
font: normal normal normal 14px / 1 FontAwesome
|
font-style: normal
|
||||||
|
font-variant: normal
|
||||||
font-size: 20px
|
font-size: 20px
|
||||||
|
line-height: 1
|
||||||
transition: all 1s ease-in-out
|
transition: all 1s ease-in-out
|
||||||
|
text-rendering: auto
|
||||||
|
-webkit-font-smoothing: antialiased
|
||||||
|
|
||||||
|
if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
|
||||||
|
font-weight: 600
|
||||||
|
font-family: 'Font Awesome 5 Free'
|
||||||
|
else
|
||||||
|
font-weight: normal
|
||||||
|
font-family: FontAwesome
|
||||||
|
|
||||||
iframe
|
iframe
|
||||||
margin: 0 0 1rem
|
margin: 0 0 1rem
|
||||||
|
|
||||||
// collapse/expand beautify
|
|
||||||
details
|
|
||||||
padding: .3rem
|
|
||||||
border: 2px solid darken($light-grey, 10%)
|
|
||||||
|
|
||||||
summary
|
|
||||||
color: $theme-color
|
|
||||||
|
|
||||||
// set <caption> of <figure> to center-align
|
|
||||||
// use class="not-code" to avoid conflicts because code also use <figure> tag
|
|
||||||
.not-code
|
|
||||||
margin: .5em
|
|
||||||
padding: .5em
|
|
||||||
border: thin silver solid
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
table
|
table
|
||||||
|
display: block
|
||||||
overflow: auto
|
overflow: auto
|
||||||
margin: 0 0 1rem
|
margin: 0 0 1rem
|
||||||
width: 100%
|
width: 100%
|
||||||
border-spacing: 0
|
border-spacing: 0
|
||||||
border-collapse: collapse
|
border-collapse: collapse
|
||||||
|
empty-cells: show
|
||||||
|
|
||||||
thead
|
thead
|
||||||
background: alpha($a-link-color, 10%)
|
background: alpha($table-thead-bg, 10%)
|
||||||
|
|
||||||
th,
|
th,
|
||||||
td
|
td
|
||||||
padding: .3rem .6rem
|
padding: .3rem .6rem
|
||||||
border: 1px solid darken($light-grey, 10%)
|
border: 1px solid darken($light-grey, 10%)
|
||||||
vertical-align: top
|
vertical-align: middle
|
||||||
|
|
||||||
*::selection
|
*::selection
|
||||||
background: $selection
|
background: $theme-text-selection-color
|
||||||
color: $pale-grey
|
color: #F7F7F7
|
||||||
|
|
||||||
// 字體
|
// font
|
||||||
.full_page #site-title,
|
#nav #site_title,
|
||||||
.full_page #site-sub-title,
|
#nav #site_subtitle,
|
||||||
#site-name,
|
#site-name,
|
||||||
#aside_content .author-info__name,
|
#aside_content .author-info__name,
|
||||||
#aside_content .author-info__description
|
#aside_content .author-info__description
|
||||||
@@ -156,6 +143,9 @@ table
|
|||||||
.is_visible
|
.is_visible
|
||||||
display: block !important
|
display: block !important
|
||||||
|
|
||||||
|
.is-visible-inline
|
||||||
|
display: inline-block !important
|
||||||
|
|
||||||
.is_invisible
|
.is_invisible
|
||||||
display: none !important
|
display: none !important
|
||||||
|
|
||||||
@@ -170,7 +160,7 @@ table
|
|||||||
|
|
||||||
// button hover
|
// button hover
|
||||||
.button--primary
|
.button--primary
|
||||||
color: $ruby
|
color: $theme-button-hover-color
|
||||||
|
|
||||||
.button--animated
|
.button--animated
|
||||||
transition-duration: 1s
|
transition-duration: 1s
|
||||||
@@ -183,7 +173,7 @@ table
|
|||||||
bottom: 0
|
bottom: 0
|
||||||
left: 0
|
left: 0
|
||||||
z-index: -1
|
z-index: -1
|
||||||
background: $ruby
|
background: $theme-button-hover-color
|
||||||
content: ''
|
content: ''
|
||||||
transition-timing-function: ease-out
|
transition-timing-function: ease-out
|
||||||
transition-duration: .5s
|
transition-duration: .5s
|
||||||
@@ -196,36 +186,16 @@ table
|
|||||||
transition-timing-function: cubic-bezier(.45, 1.64, .47, .66)
|
transition-timing-function: cubic-bezier(.45, 1.64, .47, .66)
|
||||||
transform: scaleX(1)
|
transform: scaleX(1)
|
||||||
|
|
||||||
// third-party
|
|
||||||
.fireworks
|
|
||||||
position: fixed
|
|
||||||
z-index: -1
|
|
||||||
z-index: 99999
|
|
||||||
pointer-events: none
|
|
||||||
|
|
||||||
img[src=''],
|
img[src=''],
|
||||||
img:not([src])
|
img:not([src])
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
.justified-gallery
|
|
||||||
margin: 1rem 0
|
|
||||||
|
|
||||||
img
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
.fancybox
|
|
||||||
width: auto
|
|
||||||
text-align: inherit
|
|
||||||
|
|
||||||
.img-alt
|
.img-alt
|
||||||
display: none
|
margin: -.5rem 0 .5rem
|
||||||
|
color: $font-black
|
||||||
|
|
||||||
.medium-zoom-image--opened
|
&:hover
|
||||||
z-index: 99999 !important
|
text-decoration: none !important
|
||||||
margin: 0 !important
|
|
||||||
|
|
||||||
.medium-zoom-overlay
|
|
||||||
z-index: 99999 !important
|
|
||||||
|
|
||||||
// hexo tag video
|
// hexo tag video
|
||||||
.video-container
|
.video-container
|
||||||
@@ -243,22 +213,36 @@ img:not([src])
|
|||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
.layout_page,
|
.comment_headling
|
||||||
.layout_post,
|
margin-bottom: 10px
|
||||||
|
font-weight: 700
|
||||||
|
font-size: 20px
|
||||||
|
|
||||||
|
.post-ad
|
||||||
|
margin: 2rem 0
|
||||||
|
|
||||||
|
.ad_height
|
||||||
|
display: block !important
|
||||||
|
height: auto !important
|
||||||
|
|
||||||
|
#content-inner,
|
||||||
#footer
|
#footer
|
||||||
animation: main 1s
|
animation: main 1s
|
||||||
|
|
||||||
#nav,
|
#nav
|
||||||
#top-container
|
animation: nav-effect 1s
|
||||||
animation: header 1s
|
|
||||||
|
|
||||||
#site-title
|
#site_title,
|
||||||
|
#site_subtitle
|
||||||
animation: titlescale 1s
|
animation: titlescale 1s
|
||||||
|
|
||||||
canvas,
|
canvas:not(#ribbon-canvas),
|
||||||
#web_bg
|
#web_bg
|
||||||
animation: to_show 4s
|
animation: to_show 4s
|
||||||
|
|
||||||
|
#ribbon-canvas
|
||||||
|
animation: ribbon_to_show 4s
|
||||||
|
|
||||||
.card-announcement-animation
|
.card-announcement-animation
|
||||||
color: #FF0000
|
color: #FF0000
|
||||||
animation: announ_animation .8s linear infinite
|
animation: announ_animation .8s linear infinite
|
||||||
@@ -266,13 +250,33 @@ canvas,
|
|||||||
.scroll-down-effects
|
.scroll-down-effects
|
||||||
animation: scroll-down-effect 1.5s infinite
|
animation: scroll-down-effect 1.5s infinite
|
||||||
|
|
||||||
if hexo-config('avatar_effect') == true
|
if hexo-config('avatar.effect') == true
|
||||||
.avatar-img
|
.avatar-img
|
||||||
animation: avatar_turn_around 2s linear infinite
|
animation: avatar_turn_around 2s linear infinite
|
||||||
|
|
||||||
.reward-main
|
.reward-main
|
||||||
animation: donate_effcet .3s .1s ease both
|
animation: donate_effcet .3s .1s ease both
|
||||||
|
|
||||||
|
.tocOpenPc
|
||||||
|
.sidebar-toc__title
|
||||||
|
animation: tocsidebarLtoR .5s
|
||||||
|
|
||||||
|
.sidebar-toc__progress
|
||||||
|
animation: tocsidebarLtoR .7s
|
||||||
|
|
||||||
|
.sidebar-toc__content
|
||||||
|
animation: tocsidebarLtoR .9s
|
||||||
|
|
||||||
|
.tocOpenMobile
|
||||||
|
.sidebar-toc__title
|
||||||
|
animation: tocsidebarRtoL .4s
|
||||||
|
|
||||||
|
.sidebar-toc__progress
|
||||||
|
animation: tocsidebarRtoL .6s
|
||||||
|
|
||||||
|
.sidebar-toc__content
|
||||||
|
animation: tocsidebarRtoL .7s
|
||||||
|
|
||||||
@keyframes scroll-down-effect
|
@keyframes scroll-down-effect
|
||||||
0%
|
0%
|
||||||
top: 0
|
top: 0
|
||||||
@@ -286,7 +290,7 @@ if hexo-config('avatar_effect') == true
|
|||||||
top: 0
|
top: 0
|
||||||
opacity: .4
|
opacity: .4
|
||||||
|
|
||||||
@keyframes header
|
@keyframes nav-effect
|
||||||
0%
|
0%
|
||||||
opacity: 0
|
opacity: 0
|
||||||
transform: translateY(-50px)
|
transform: translateY(-50px)
|
||||||
@@ -336,6 +340,13 @@ if hexo-config('avatar_effect') == true
|
|||||||
100%
|
100%
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
|
||||||
|
@keyframes ribbon_to_show
|
||||||
|
0%
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
100%
|
||||||
|
opacity: hexo-config('canvas_ribbon.alpha')
|
||||||
|
|
||||||
@keyframes avatar_turn_around
|
@keyframes avatar_turn_around
|
||||||
from
|
from
|
||||||
transform: rotate(0)
|
transform: rotate(0)
|
||||||
@@ -369,10 +380,23 @@ if hexo-config('avatar_effect') == true
|
|||||||
50%
|
50%
|
||||||
transform: scale(1.2)
|
transform: scale(1.2)
|
||||||
|
|
||||||
@media screen and (max-width: $bg)
|
@keyframes sidebarItem
|
||||||
i#toggle-sidebar,
|
0%
|
||||||
#sidebar
|
transform: translateX(200px)
|
||||||
display: none
|
|
||||||
|
|
||||||
body
|
100%
|
||||||
padding-left: 0 !important
|
transform: translateX(0)
|
||||||
|
|
||||||
|
@keyframes tocsidebarRtoL
|
||||||
|
0%
|
||||||
|
transform: translateX(200px)
|
||||||
|
|
||||||
|
100%
|
||||||
|
transform: translateX(0)
|
||||||
|
|
||||||
|
@keyframes tocsidebarLtoR
|
||||||
|
0%
|
||||||
|
transform: translateX(-200px)
|
||||||
|
|
||||||
|
100%
|
||||||
|
transform: translateX(0)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user