Breaking Change

1. 不再支持hexo 4.0.0以下版本
2. 添加hexo fragment_cache,加快生成速度
3. 完善V5圖標顯示,不再需要同時加載V4和v5圖標
4. 去除cheerio依賴
5. 整合豆瓣配置,增加配置遊戲,圖書頁面top_img,可設置是否設置meta,解決部分瀏覽器無法顯示圖片問題
6. 友情鏈接除列表外可自定義內容
7. 可設置主頁標題距離頂部距離
8. 側邊欄可隱藏,可設置手機頁面是否隱藏
9. 增加disqusjs和utterances 兩個評論
10. 主頁文章增加tags和更新日期顯示,可以配置post_meta
11. 首頁subtitle可關閉打字效果,可設置打字效果顯示一次或loop
12. 增加valine和gitalk的配置
13. darkmode配置整理
14. 增加404頁面
15. post_beautify改為beautify,頁面美化不再只限於post頁,page頁也一樣
16. 可設置是否顯示cover,可設置各位置的cover顯示
17. 增加mermaid,可畫流程圖、狀態圖、時序圖、甘特圖等等
18. 增加pangu配置,中英文之間添加空格
19. 整合部分配置
20. post-copyright增加decode網址 (可以顯示中文)
21. 增加部分顏色配置
Feature
1. 適配IE
2. 增加一個Tag Plugins: 圖庫集
3. 增加一個Tag Plugins: tag-hide 功能 inline/block
4. 去除page頁開頭顯示與標題一樣的內容
5. aside 公告欄設置,支持html代碼
6. 手機界面sidebar顯示進度條和加深對應的標題
7. 主頁subtitle 的 hitokoto 顯示內容出處
9. footer 的hexo鏈接改為https
10. 修改手機下,menus和toc的打開效果
11. 手機頁面下,搜索界面全屏顯示
12. SEO優化,標題欄改為h1顯示
13. 閲讀模式優化,可根據light mode 和darkmode調整背景
14. 當屏蔽js時,header會出現(之前用js控制,會隱藏)
Fixed
1. 修復Tencent Analytics的script加載為https #105
2. 修復相關文章,日期顯示錯誤bug
3. 修復gitalk報錯問題
4. 修復當valine background 是絕對地址時無法顯示的bug
5. 修復medium-zoom 無法使用的bug
6. 修復在safari下,點擊或移動到首頁文章cover,圓角變成正方形的bug #114
7. 修復在部分瀏覽器下,aside,友情鏈接頭像轉動變形的bug
8. 修復在寬度限制下,表格內容溢出屏幕外而出現滾動條的bug \#138
9. 修復gitalk js 在一些沒有設置評論的page里加載的bug
10. 修復tag plugins 的gist 在不同主題下的背景顏色問題(黑色主題下,文字不易觀看)
11. 修復highlight figcaption 顯示不全的bug
12. 修復disqus評論數無法獲取的bug
13. 修復子目錄在觸摸屏下點擊,偶爾不出現的bug
14. 修復a標籤太長(連續英文字母)不會換行的bug
15. 修復toc滾動時,閲讀進度條也跟著滾動的bug
16. 修復aside的圖片,可點擊顯示大圖bug
17. 修復activate-power-mode設置參數無效bug
18. 修復語言上的錯誤 \#156
19. 修復主頁在safari桌面端,首頁滾動卡頓的bug
This commit is contained in:
Jerry
2020-03-17 21:28:27 +08:00
parent 9c996d0a73
commit 321091befb
125 changed files with 3824 additions and 2684 deletions

7
.github/stale.yml vendored
View File

@@ -4,9 +4,12 @@ daysUntilStale: 30
daysUntilClose: 7 daysUntilClose: 7
# Issues with these labels will never be considered stale # Issues with these labels will never be considered stale
exemptLabels: exemptLabels:
- pinned
- security
- bug - bug
- documentation
- enhancement - enhancement
- Solved
- documentation
# Label to use when marking an issue as stale # Label to use when marking an issue as stale
staleLabel: wontfix staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable # Comment to post when marking an issue as stale. Set to `false` to disable
@@ -15,4 +18,4 @@ markComment: >
recent activity. It will be closed if no further activity occurs. Thank you recent activity. It will be closed if no further activity occurs. Thank you
for your contributions. for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable # Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false closeComment: false

View File

@@ -1,30 +1,15 @@
# 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.2.0-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/
Demo: https://demo.jerryc.me/
JerryC: https://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.
> If you update to hexo 4.2.0it will be something's wrong
>
> ```
> Error: Cannot find module 'cheerio'
> ```
>
> please install cheerio
>
> ```
> npm install cheerio@0.22.0 --save
> ```
## Installation ## Installation
Stable branch: Stable branch:
@@ -51,7 +36,7 @@ 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`
## Screenshots ## Screenshots

View File

@@ -1,31 +1,19 @@
# 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.2.0-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/ Demo: https://demo.jerryc.me/
JerryC: https://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)修改的主題
> 如果升級到hexo 4.2.0 ,會出現報錯
>
> ```
> Error: Cannot find module 'cheerio'
> ```
>
> 請在博客根目錄安裝cheerio
>
> ```
> npm install cheerio@0.22.0 --save
> ```
## 安裝 ## 安裝
在你的博客根目錄 在你的博客根目錄
``` ```
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
@@ -48,7 +36,7 @@ theme: Butterfly
## 文檔 ## 文檔
可查看[這裏](https://jerryc.me/posts/21cfbf15) 可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15)
## 截圖 ## 截圖
![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png) ![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png)

View File

@@ -42,9 +42,9 @@ 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
@@ -96,43 +96,79 @@ 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
# 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: /img/index.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:
- /img/post.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://jerryc.me/posts/21cfbf15/#字數統計
wordcount: wordcount:
enable: false enable: false
@@ -146,6 +182,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/
@@ -178,22 +215,23 @@ addtoany:
#### Comments System #### #### Comments System ####
# ------------------------------------ # ------------------------------------
# Disqus 官方版評論系統
disqus: disqus:
enable: false enable: false
shortname: shortname:
count: false # top_img顯示評論數 count: false # top_img顯示評論數
# Disqus.js 版評論系統應對大陸長城的折中方案兼容原版https://github.com/SukkaW/DisqusJS # Disqus.js版評論系統應對大陸長城的折中方案兼容原版https://github.com/SukkaW/DisqusJS
# API 申請地址https://disqus.com/api/applications/ # API 申請地址https://disqus.com/api/applications/
# 與 disqus 共用樣式 # 與 disqus 共用樣式
disqusjs: disqusjs:
enable: false #開啓改爲 true enable: false
shortname: shortname:
siteName: siteName:
apikey: apikey:
api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址 api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址
count: false # top_img顯示評論數 admin:
adminLabel:
count: true # top_img顯示評論數
laibili: laibili:
enable: false enable: false
@@ -206,8 +244,12 @@ 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: true # top_img顯示評論數
# valine comment system. https://valine.js.org # valine comment system. https://valine.js.org
valine: valine:
@@ -221,12 +263,25 @@ valine:
lang: en # i18n: zh-cn/en lang: en # i18n: zh-cn/en
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
recordIP: false # Record reviewer IP
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
bg: /img/comment_bg.png # valine background bg: /img/comment_bg.png # valine background
count: false # top_img顯示評論數 count: true # 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
##### Footer Settings #### ##### Footer Settings ####
# ------------------------------------ # ------------------------------------
since: 2019 since: 2020
footer_custom_text: footer_custom_text:
@@ -275,16 +330,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
@@ -300,7 +345,7 @@ 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 文章日期顯示建日或者更新日
#### 美化/效果 #### #### 美化/效果 ####
#-------------------------------- #--------------------------------
@@ -315,20 +360,19 @@ 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_top_img_height: #主頁top_img高度 例如 300px/300em/300rem 不能使用百分比 index_site_info_top: # 主頁標題距離頂部距離 例如 300px/300em/300rem/10%
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一樣
@@ -347,7 +391,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:
@@ -380,8 +424,8 @@ activate_power_mode:
shake: true # 抖動特效 shake: true # 抖動特效
# 鼠標點擊效果 # 鼠標點擊效果
# 避免卡頓,建議只開一個 # 避免卡頓,建議只開一個
# 點擊火特效 # 點擊火特效
fireworks: fireworks:
enable: false enable: false
@@ -393,30 +437,17 @@ click_heart:
ClickShowText: ClickShowText:
enable: false enable: false
text: text:
- 富强 - 本人
- 民主 - 超帥
- 文明
- 和谐
- 自由
- 平等
- 公正
- 法治
- 爱国
- 敬业
- 诚信
- 友善
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
title-prefix-icon: '\f0c1' title-prefix-icon: '\f0c1'
title-prefix-icon-color: "#F47466" title-prefix-icon-color: "#F47466"
@@ -440,29 +471,37 @@ 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 調用金山詞霸的每日一句(簡體)
# 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
# (如果有英文逗號' , ',請使用轉義字符 &#44;) # (如果有英文逗號' , ',請使用轉義字符 &#44;)
# 如果關閉打字效果subtitle只會顯示sub的第一行文字
sub: sub:
- 今日事&#44;今日畢 - 今日事&#44;今日畢
- 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
#### 側邊欄 #### #### 側邊欄 ####
#------------------------------------- #-------------------------------------
# 手機頁面( 顯示寬度 < 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: true
card_announcement: true card_announcement: true
@@ -497,30 +536,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切換按鈕
# 自動切換 dark mode和 light mode button: true
# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換 dark mode # 自動切換 dark mode和 light mode
# autoChangeMode: 2 按照時間晚上6點到早上6點之間切換為 dark mode # autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
# autoChangeMode: false 取消自動切換 # autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
autoChangeMode: false # autoChangeMode: false 取消自動切換
autoChangeMode: 1
#### other #### #### other ####
#------------------------------------------------ #------------------------------------------------
@@ -556,6 +596,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:
@@ -590,14 +636,15 @@ 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
# 開啟hexo自帶的緩存加快生成速度
fragment_cache: true
# CDN # CDN
# 網站必須 # 網站必須
# 可根據需要自行添加js/css # 可根據需要自行添加js/css
CDN_USE: CDN_USE:
css: css:
- /css/index.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: js:
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js - https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js
@@ -607,52 +654,65 @@ CDN_USE:
# CDN # CDN
# 非必要不要修改 # 非必要不要修改
CDN: CDN:
#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
sharejs: https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js sharejs: https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js
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/lazysizes@latest/lazysizes.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

View File

@@ -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:
@@ -71,11 +71,9 @@ aside:
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 +99,7 @@ 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

View File

@@ -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:
@@ -101,3 +101,5 @@ Snackbar:
cht_to_chs: Simplified Chinese Activated Manually cht_to_chs: Simplified Chinese Activated Manually
day_to_night: Dark Mode Activated Manually day_to_night: Dark Mode Activated Manually
night_to_day: Light Mode Activated Manually night_to_day: Light Mode Activated Manually
error_title: Page not found

View File

@@ -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:
@@ -75,7 +76,6 @@ share: 分享
bookmark: bookmark:
title: 添加书签 title: 添加书签
rightside: rightside:
readmode_title: 阅读模式 readmode_title: 阅读模式
font_plus_title: 放大字体 font_plus_title: 放大字体
@@ -103,3 +103,5 @@ Snackbar:
cht_to_chs: 你已切换为简体 cht_to_chs: 你已切换为简体
day_to_night: 你已切换为深色模式 day_to_night: 你已切换为深色模式
night_to_day: 你已切换为浅色模式 night_to_day: 你已切换为浅色模式
error_title: 页面没有找到

View File

@@ -15,11 +15,10 @@ page:
articles: 文章總覽 articles: 文章總覽
tag: 標籤 tag: 標籤
category: 分類 category: 分類
archives: 時間軸 archives: 歸檔
sticky: 置頂 sticky: 置頂
no_title: 無題 no_title: 無題
archives: 時間軸
post: post:
created: 發表於 created: 發表於
@@ -34,6 +33,7 @@ post:
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:
@@ -76,7 +76,6 @@ share: 分享
bookmark: bookmark:
title: 添加書籤 title: 添加書籤
rightside: rightside:
readmode_title: 閲讀模式 readmode_title: 閲讀模式
font_plus_title: 放大字體 font_plus_title: 放大字體
@@ -105,4 +104,6 @@ Snackbar:
day_to_night: 你已切換為深色模式 day_to_night: 你已切換為深色模式
night_to_day: 你已切換為淺色模式 night_to_day: 你已切換為淺色模式
error_title: 頁面沒有找到

87
layout/404.pug Normal file
View File

@@ -0,0 +1,87 @@
doctype html
html(lang=config.language data-theme=theme.display_mode)
head
- var pageTitle = _p('error_title')
- var tabTitle = pageTitle + ' | ' + config.title
- var pageDescription = page.description || page.title || config.description
- var 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
- var without_html = url.replace('index.html', '')
- var top_img = theme.error_404.background || theme.default_top_img
- var bg_img = `background-image: url(${top_img})`
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= tabTitle
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(theme.favicon || config.favicon)
//- 預解析
include includes/head/dns_prefetch.pug
//- 網站驗證
include includes/head/site_verification.pug
//- Open_Graph
include includes/head/Open_Graph.pug
//- PWA
if (theme.pwa && theme.pwa.enable)
include includes/head/pwa
script(src=url_for(theme.CDN.js_cookies))
if theme.darkmode.enable
include includes/head/darkmode.pug
each item in theme.CDN_USE.css
link(rel='stylesheet', href=url_for(item))
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.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
if theme.canonical
link(rel="canonical" href=without_html)
if theme.algolia_search.enable
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
script(src=url_for(theme.CDN.algolia_search) defer)
//- google_adsense
include includes/head/google_adsense.pug
//- analytics
include includes/head/analytics.pug
if theme.blog_title_font.font_link
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
include includes/head/config.pug
include includes/head/config_site.pug
body
if theme.fireworks && theme.fireworks.enable
canvas.fireworks
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/mobile-sidebar/index.pug
include includes/rightside.pug
each item in theme.CDN_USE.js
script(src=url_for(item))
include includes/additional-js.pug
include includes/search/index.pug

View File

@@ -1,4 +1,3 @@
extends includes/layout.pug extends includes/layout.pug
block content block content
@@ -6,6 +5,4 @@ block content
#archive #archive
.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

View File

@@ -5,15 +5,10 @@ block content
include ./includes/mixins/UI.pug include ./includes/mixins/UI.pug
#recent-posts.recent-posts.category_ui #recent-posts.recent-posts.category_ui
+UI_NEW(page.posts) +UI_NEW(page.posts)
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

View File

@@ -1,30 +1,20 @@
.flink #page
each i in site.data.link .flink#article-container
h1= i.class_name each i in site.data.link
.post-cards h2= i.class_name
ul.md-links .post-cards
each item in i.link_list .md-links
li.md-links-item each item in i.link_list
a(href=item.link title=item.name target="_blank") .md-links-item
if theme.lazyload.enable a(href=item.link title=item.name target="_blank")
img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) if theme.lazyload.enable
else img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) else
.md-links-title= item.name img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
.md-links-des= item.descr .md-links-title= item.name
.md-links-des= item.descr
hr != page.content
div if page.comments !== false
h2= theme.Flink.info_headline include includes/comments/index.pug
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

View File

@@ -26,12 +26,10 @@ 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.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
@@ -50,5 +48,18 @@ 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() if is_home()
include index-js.pug include index-js.pug

View File

@@ -1,13 +1,23 @@
if theme.disqus && theme.disqus.enable #disqus_thread
#disqus_thread script.
script. var disqus_config = function () {
var unused = null; this.page.url = '!{ page.permalink }';
var disqus_config = function () { this.page.identifier = '!{ page.path }';
this.page.url = '!{ page.permalink }'; this.page.title = '!{ page.title }';
this.page.identifier = '!{ page.path }'; };
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);
})();
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);

View File

@@ -1,16 +1,23 @@
if theme.disqusjs && theme.disqusjs.enable #disqus_thread
#disqus_thread script(src=url_for(theme.CDN.disqusjs))
link(href=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css') rel='stylesheet') script.
script(src=('https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js')) var dsqjs = new DisqusJS({
script. shortname: '!{theme.disqusjs.shortname}',
var dsqjs = new DisqusJS({ siteName: "!{theme.disqusjs.siteName}",
shortname: '!{theme.disqusjs.shortname}', identifier: '!{ page.path }',
siteName: "!{theme.disqusjs.siteName}", url: '!{ page.permalink }',
identifier: '!{ page.path }', title: '!{ page.title }',
url: '!{ page.permalink }', api: '!{theme.disqusjs.api}',
title: '!{ page.title }', apikey: '!{theme.disqusjs.apikey}',
api: '!{theme.disqusjs.api}', admin: '!{theme.disqusjs.admin}',
apikey: '!{theme.disqusjs.apikey}', adminLabel: '!{theme.disqusjs.adminLabel}'
admin: '', });
adminLabel: ''
}); 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);

View File

@@ -1,20 +1,23 @@
if theme.gitalk && theme.gitalk.enable #gitalk-container
#gitalk-container script.
script. var gitalk = new Gitalk({
var gitalk = new Gitalk({ clientID: '!{theme.gitalk.client_id}',
clientID: '!{theme.gitalk.client_id}', 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}',
updateCountCallback: commentCount distractionFreeMode: !{theme.gitalk.distractionFreeMode},
}) pagerDirection: '!{theme.gitalk.pagerDirection}',
gitalk.render('gitalk-container') createIssueManually: !{theme.gitalk.createIssueManually},
updateCountCallback: commentCount
})
gitalk.render('gitalk-container')
function commentCount(n){ function commentCount(n){
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
} }

View File

@@ -3,8 +3,10 @@
- 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 isComment = d || dj || l || gt || v || u
if d || dj || l || gt || v if isComment
hr hr
#post-comment #post-comment
.comment_headling .comment_headling
@@ -19,4 +21,6 @@ if d || dj || l || gt || v
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

View File

@@ -1,11 +1,10 @@
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) { var j, e = d.getElementsByTagName(s)[0];
var j, e = d.getElementsByTagName(s)[0]; if (typeof LivereTower === 'function') { return; }
if (typeof LivereTower === 'function') { return; } j = d.createElement(s);
j = d.createElement(s); j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; j.async = true;
j.async = true; e.parentNode.insertBefore(j, e);
e.parentNode.insertBefore(j, e); })(document, 'script');
})(document, 'script');

View File

@@ -0,0 +1,19 @@
script#utterances_comment(src=theme.CDN.utterances
repo=theme.utterances.repo
issue-term=theme.utterances.issue_term
theme=theme.utterances.light_theme
crossorigin="anonymous"
async)
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');
}

View File

@@ -1,25 +1,23 @@
if theme.valine && theme.valine.enable #vcomment.vcomment
#vcomment.vcomment script(src=url_for(theme.CDN.valine))
script(src=url_for(theme.CDN.valine)) script.
script. var GUEST_INFO = ['nick','mail','link'];
var notify = #{ theme.valine.notify } == true ? true : false; var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
var verify = #{ theme.valine.verify } == true ? true : false; return GUEST_INFO.indexOf(item) > -1
var GUEST_INFO = ['nick','mail','link']; });
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){ guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
return GUEST_INFO.indexOf(item) > -1
});
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
window.valine = new Valine({ window.valine = new Valine({
el:'#vcomment', el:'#vcomment',
notify:notify, notify: #{theme.valine.notify},
verify:verify, verify: #{theme.valine.verify},
appId:'#{theme.valine.appId}', appId: '#{theme.valine.appId}',
appKey:'#{theme.valine.appKey}', appKey: '#{theme.valine.appKey}',
placeholder:'#{theme.valine.placeholder}', placeholder: '#{theme.valine.placeholder}',
avatar:'#{theme.valine.avatar}', avatar: '#{theme.valine.avatar}',
guest_info:guest_info, meta: guest_info,
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}'
});

View File

@@ -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') + ' '

View File

@@ -1,31 +1,31 @@
if is_home() - var pageTitle = page.title || config.title || ''
- var top_img = theme.index_img || theme.default_top_img - if (is_archive()) pageTitle = _p('page.archives')
else if is_archive() - if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
- var top_img = theme.archive_img || theme.default_top_img - if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
else if is_tag() - if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
- var top_img = theme.tag_img || theme.default_top_img - if (is_year()) pageTitle += ': ' + page.year
else if is_category() - var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
- var top_img = theme.category_img || theme.default_top_img - var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
else if is_current('/movies/', [strict]) - pageTitle ? '' : pageTitle = config.title || ''
- 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 pageDescription = page.description || page.title || config.description
- var without_html = without_index.replace('.html', '') - 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
- var without_html = url.replace('index.html', '')
//- 預解析 meta(charset='UTF-8')
include ./head/dns_prefetch.pug meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width,initial-scale=1")
//- PWA title= tabTitle
if (theme.pwa && theme.pwa.enable) meta(name="description" content=pageDescription)
include ./head/pwa.pug if pageKeywords
meta(name="keywords" content=pageKeywords)
//- 網站驗證 meta(name="author" content=pageAuthor)
include ./head/site_verification.pug meta(name="copyright" content=pageCopyright)
meta(name ="format-detection" content="telephone=no")
//- Open_Graph !=favicon_tag(theme.favicon || config.favicon)
include ./head/Open_Graph.pug
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")
@@ -34,14 +34,35 @@ if theme.disable_baidu_transformation
if page.hide == true if page.hide == true
meta(name="robots" content="noindex") 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 each item in theme.CDN_USE.css
link(rel='stylesheet', href=url_for(item)) link(rel='stylesheet', href=url_for(item))
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))
@@ -61,19 +82,18 @@ 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))
script(src=url_for(theme.CDN.blueimp_md5))
//- 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

View File

@@ -1,19 +1,17 @@
- 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=without_html)
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))

View File

@@ -19,4 +19,4 @@ if theme.google_analytics
ga('send', 'pageview'); ga('send', 'pageview');
if theme.tencent_analytics if theme.tencent_analytics
script(src=`https://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")

View File

@@ -0,0 +1,8 @@
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))

View File

@@ -76,12 +76,14 @@
}) })
} }
var highlightCopy = theme.highlight_copy
var highlightLang = theme.highlight_lang
var highlightShrink = theme.highlight_shrink
var runtime = theme.runtimeshow.enable var runtime = theme.runtimeshow.enable
var fancybox = theme.fancybox.enable var fancybox = theme.fancybox.enable
var medium_zoom = theme.medium_zoom.enable var medium_zoom = theme.medium_zoom.enable
var baiduPush = theme.baidu_push && theme.baidu_push.enable var baiduPush = theme.baidu_push && theme.baidu_push.enable
var isHome = is_home() ? true : false var isFontAwesomeV5 = theme.fontawesome_v5 && theme.fontawesome_v5.enable
var isPost = is_post() ? true : false
script. script.
@@ -108,8 +110,10 @@ script.
fancybox: !{fancybox}, fancybox: !{fancybox},
Snackbar: !{Snackbar}, Snackbar: !{Snackbar},
baiduPush: !{baiduPush}, baiduPush: !{baiduPush},
isHome: !{isHome}, highlightCopy: !{highlightCopy},
isPost: !{isPost} highlightLang: !{highlightLang},
highlightShrink: !{highlightShrink},
isFontAwesomeV5: !{isFontAwesomeV5}
} }

View File

@@ -0,0 +1,6 @@
script.
var GLOBAL_CONFIG_SITE = {
isPost: !{is_post()},
isHome: !{is_home()}
}

View File

@@ -1,25 +1,24 @@
script. script.
const autoChangeMode = '#{theme.autoChangeMode}' const 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 const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
if (t === undefined){
if (isLightMode) activateLightMode()
else if (isDarkMode) activateDarkMode()
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.')
now = new Date();
hour = now.getHours();
isNight = hour < 6 || hour >= 18
isNight ? activateDarkMode() : activateLightMode()
}
} else if (t == 'light') activateLightMode()
else activateDarkMode()
if (t === undefined){
if (isLightMode) activateLightMode()
else if (isDarkMode) activateDarkMode()
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.')
now = new Date();
hour = now.getHours();
isNight = hour < 6 || hour >= 18
isNight ? activateDarkMode() : activateLightMode()
}
} else if (t == 'light') activateLightMode()
else activateDarkMode()
} else if (autoChangeMode == '2'){ } else if (autoChangeMode == '2'){
now = new Date(); now = new Date();

View File

@@ -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')

View File

@@ -0,0 +1,15 @@
#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')

View File

@@ -0,0 +1,45 @@
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(${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
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 if is_post()
include ./post-info.pug
else
#page_site-info
h1#site_title=site_title

View File

@@ -0,0 +1,65 @@
#post-info
#post-title
.posttitle= page.title || _p('no_title')
#post-meta
if (theme.post_meta.post.date_type)
if (theme.post_meta.post.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.post.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.post.categories && page.categories.data.length > 0)
if (theme.post_meta.post.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)
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
i.post-meta__icon.fa-fw(class=wordCountIcon aria-hidden="true")
span= _p('post.wordcount') + ':'
span.word-count= wordcount(page.content)
span.post-meta__separator |
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
i.post-meta__icon.fa-fw(class=readCountIcon 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
i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
span=_p('post.page_pv') + ':'
span#busuanzi_value_page_pv
- 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 (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator |
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
span= _p('post.comments') + ':'
span.disqus-comment-count.comment-count
a(href=full_url_for(page.path) + '#disqus_thread')
if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
if (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator |
i.post-meta__icon.fa-fw(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")
if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
if (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator |
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
span= _p('post.comments') + ':'
a(href=url_for(page.path) + '#post-comment')
span.gitalk-comment-count.comment-count

View File

@@ -1,90 +1,116 @@
if theme.subtitle.enable if theme.subtitle.enable
script(src=url_for(theme.CDN.typed)) - let source = theme.subtitle.source
- var source = theme.subtitle.source - let subtitleEffect = theme.subtitle.effect
if source == '1' || source == '2' if subtitleEffect
script(src="https://cdn.jsdelivr.net/npm/bluebird@3/js/browser/bluebird.min.js") script(src=url_for(theme.CDN.typed))
script(src="https://cdn.jsdelivr.net/npm/whatwg-fetch@2.0.3/fetch.min.js")
if source == '1' if source == '1'
script. script.
let subtitleEffect = !{subtitleEffect}
fetch('https://api.ooopn.com/ciba/api.php',) fetch('https://api.ooopn.com/ciba/api.php',)
.then(function (res){ .then(function (res){
return res.json(); return res.json();
}) })
.then(function (data) { .then(function (data) {
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(","); if (subtitleEffect){
var both = sub.unshift(data['ciba-en'],data.ciba) let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var typed = new Typed(".subtitle", { let both = sub.unshift(data['ciba-en'],data.ciba)
strings: sub, let typed = new Typed("#subtitle", {
startDelay: 300, strings: sub,
typeSpeed: 100, startDelay: 300,
loop: true, typeSpeed: 150,
backSpeed: 50 loop: !{theme.subtitle.loop},
}); backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = data['ciba-en']
}
}) })
.catch(function (err) { .catch(function (err) {
console.error(err); console.error(err);
}) })
else if source == '2' else if source == '2'
script. script.
let subtitleEffect = !{subtitleEffect}
fetch('https://v1.hitokoto.cn') fetch('https://v1.hitokoto.cn')
.then(function (res){ .then(function (res){
return res.json(); return res.json();
}) })
.then(function (data) { .then(function (data) {
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(","); if (subtitleEffect){
var both = sub.unshift(data.hitokoto) let from = '出自 ' + data.from
var typed = new Typed(".subtitle", { let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
strings: sub, let both = sub.unshift(data.hitokoto,from)
startDelay: 300, let typed = new Typed("#subtitle", {
typeSpeed: 100, strings: sub,
loop: true, startDelay: 300,
backSpeed: 50 typeSpeed: 150,
}); loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = data.hitokoto
}
}) })
.catch(function (err) { .catch(function (err) {
console.error(err); console.error(err);
}) })
else if source == "3" else if source == "3"
script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js") script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
script. script.
var con = str[0]; let subtitleEffect = !{subtitleEffect}
var author = "出自 " + str[1]; let con = str[0];
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(","); if (subtitleEffect){
var both = sub.unshift(con,author) let from = "出自 " + str[1];
var typed = new Typed(".subtitle", { let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
strings: sub, let both = sub.unshift(con,from)
startDelay: 300, let typed = new Typed("#subtitle", {
typeSpeed: 100, strings: sub,
loop: true, startDelay: 300,
backSpeed: 50 typeSpeed: 150,
}); loop: !{theme.subtitle.loop},
backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = con
}
else if source == '4' else if source == '4'
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8") script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8")
script. script.
let subtitleEffect = !{subtitleEffect}
jinrishici.load(function(result) { jinrishici.load(function(result) {
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(","); if (subtitleEffect){
var content = result.data.content; let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(content) let content = result.data.content;
var typed = new Typed(".subtitle", { let both = sub.unshift(content)
strings: sub, let typed = new Typed("#subtitle", {
startDelay: 300, strings: sub,
typeSpeed: 100, startDelay: 300,
loop: true, typeSpeed: 150,
backSpeed: 50 loop: !{theme.subtitle.loop},
}); backSpeed: 50
});
}else{
document.getElementById("subtitle").innerHTML = result.data.content
}
}) })
else else
- var subtitle = theme.subtitle.sub[0]
script. script.
var typed = new Typed(".subtitle", { let subtitleEffect = !{subtitleEffect}
strings: '!{theme.subtitle.sub}'.split(","), if (subtitleEffect){
startDelay: 300, let typed = new Typed("#subtitle", {
typeSpeed: 100, strings: '!{theme.subtitle.sub}'.split(","),
loop: true, startDelay: 300,
backSpeed: 50 typeSpeed: 150,
}); loop: !{theme.subtitle.loop},
backSpeed: 50
})
}else{
document.getElementById("subtitle").innerHTML = '!{subtitle}'
}

View File

@@ -1,85 +1,46 @@
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
- var pageTitle = page.title || config.subtitle || '' - var autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
- 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.fireworks && theme.fireworks.enable if theme.fireworks && theme.fireworks.enable
canvas.fireworks canvas.fireworks
//- !=partial('includes/header.pug', {}, {cache: true}) !=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
include ./header.pug if (is_post() && page.toc != false && theme.toc.enable)
include ./mobile-sidebar.pug i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
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 if body
block top_img div!= body
if (!is_post()) else
#content-inner.layout_page block content
if body include widget/index.pug
div!= body else
else main#content-inner.layout_post
block content if body
else div!= body
#content-inner.layout.layout_post else
if body block content
div!= body
else
block content
- 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
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
each item in theme.CDN_USE.js each item in theme.CDN_USE.js
script(src=url_for(item)) script(src=url_for(item))
include ./additional-js.pug include ./additional-js.pug
include ./search/index.pug

View File

@@ -0,0 +1,8 @@
script.
if (document.getElementsByClassName('mermaid').length) {
loadScript('!{theme.CDN.mermaid}',function () {
mermaid.initialize({
theme: '!{theme.mermaid.theme}',
})
})
}

View File

@@ -1,36 +1,48 @@
mixin UI_NEW(posts) mixin UI_NEW(posts)
- posts.each(function(article,index){ - posts.each(function(article,index){
.recent-post-item.article-container .recent-post-item
- var link = article.link || article.path - var link = article.link || article.path
if index%2 == 0 - var post_cover = article.cover
.post_cover.left_radius - var title = article.title || _p('no_title')
a(href=url_for(link) 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 theme.lazyload.enable if post_cover && theme.cover.index_enable
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) .post_cover(class=leftOrRight)
else a(href=url_for(link) title=title)
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) if theme.lazyload.enable
else img.post_bg.lazyload(data-src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
.post_cover.right_radius else
a(href=url_for(link) title=article.title || _p('no_title')) img.post_bg(src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
- var post_cover = article.cover .recent-post-info(class=no_cover)
if theme.lazyload.enable a.article-title(href=url_for(link) title=title)= title
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) .article-meta-wrap
else if (theme.post_meta.page.date_type)
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) if (theme.post_meta.page.date_type === 'both')
.recent-post-info time.post-meta__date
a.article-title(href=url_for(link) title= article.title || _p('no_title'))= article.title || _p('no_title') i.fa.fa-calendar.fa-fw(aria-hidden="true")
if (theme.post_meta.date_type) =date(page.date, config.date_format)
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' span.article-meta__separator |
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)] i.fa.fa-history.fa-fw(aria-hidden="true")
if (theme.post_meta.categories && article.categories.data.length > 0) =date(page.updated, config.date_format)
span.article-meta else
span.article-meta__separator | - var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
each item, index in article.categories.data time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
i.fa.fa-inbox.article-meta__icon(aria-hidden="true") if (theme.post_meta.page.categories && article.categories.data.length > 0)
a(href=url_for(item.path)).article-meta__categories #[=item.name] span.article-meta
if (index < article.categories.data.length - 1) span.article-meta__separator |
i.fa.fa-angle-right(aria-hidden="true") 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 if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(article.content) - const content = strip_html(article.content)
- let expert = content.substring(0, theme.auto_excerpt.length) - let expert = content.substring(0, theme.auto_excerpt.length)

View File

@@ -3,13 +3,15 @@ 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)
.article-sort-img if article.cover && theme.cover.archives_enable
a.article-sort-item__img(href=url_for(article.path)) .article-sort-img
img(src=article.cover alt=article.title || 'No Title') a.article-sort-item__img(href=url_for(article.path))
img(src=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")

View File

@@ -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})

View File

@@ -0,0 +1,3 @@
#mobile-sidebar
#menu_mask
include ../mobile-sidebar/mobile-menus.pug

View File

@@ -0,0 +1,27 @@
#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
.menus_items
include ../header/menu_item.pug

View File

@@ -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

View File

@@ -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
-})

View File

@@ -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.enable
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` ) img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${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=`${pagination_cover}` onerror=`onerror=null;src='${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.enable
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${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=`${pagination_cover}` onerror=`onerror=null;src='${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

View 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)

View File

@@ -1,41 +1,52 @@
each article , index in page.posts.data each article , index in page.posts.data
.recent-post-item.article-container .recent-post-item
- 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')
if index%2 == 0 - var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
.post_cover.left_radius - var post_cover = article.cover
a(href=url_for(link) title=title) - var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
- var post_cover = article.cover if post_cover && theme.cover.index_enable
if theme.lazyload.enable .post_cover(class=leftOrRight)
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) a(href=url_for(link) title=title)
else if theme.lazyload.enable
img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
else else
.post_cover.right_radius img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
a(href=url_for(link) title=title) .recent-post-info(class=no_cover)
- 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 a.article-title(href=url_for(link) title=title)= title
if (article.top) .article-meta-wrap
span.article-meta if (article.top)
i.fa.fa-thumb-tack.article-meta__icon.sticky span.article-meta
span.sticky= _p('sticky') i.fa.fa-thumb-tack.article-meta__icon.sticky
span.article-meta__separator(style="margin-right: 0.3rem") | span.sticky= _p('sticky')
if (theme.post_meta.date_type) span.article-meta__separator |
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' if (theme.post_meta.page.date_type)
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)] if (theme.post_meta.page.date_type === 'both')
if (theme.post_meta.categories && article.categories.data.length > 0) time.post-meta__date
span.article-meta i.fa.fa-calendar.fa-fw(aria-hidden="true")
span.article-meta__separator | =date(page.date, config.date_format)
each item, index in article.categories.data span.article-meta__separator |
i.fa.fa-inbox.article-meta__icon(aria-hidden="true") i.fa.fa-history.fa-fw(aria-hidden="true")
a(href=url_for(item.path)).article-meta__categories #[=item.name] =date(page.updated, config.date_format)
if (index < article.categories.data.length - 1) else
i.fa.fa-angle-right(aria-hidden="true") - var date_type = theme.post_meta.post.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.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 if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(article.content) - const content = strip_html(article.content)
- let expert = content.substring(0, theme.auto_excerpt.length) - let expert = content.substring(0, theme.auto_excerpt.length)

View File

@@ -7,13 +7,15 @@ 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

View File

@@ -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

View File

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

View File

@@ -1,7 +1,4 @@
#sidebar
- 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 - const showToc = is_post() && page.toc != false && theme.toc.enable
- -
let tocNumber let tocNumber

View File

@@ -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
View 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')
})

View File

@@ -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.announcement.content

View File

@@ -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= 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

View File

@@ -8,17 +8,20 @@
.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')
- var no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : ''
- var post_cover = article.cover
a(href=url_for(link)) a(href=url_for(link))
- var post_cover = article.cover if post_cover && theme.cover.aside_enable
.aside-post-cover .aside-post-cover
if theme.lazyload.enable if theme.lazyload.enable
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.lazyload(data-src=`${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=`${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) if (theme.post_meta.page.date_type)
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' - var date_type = theme.post_meta.page.date_type == 'updated' ? 'updated' : 'date'
time.aside-post_meta.post-meta__date #[=date(article[date_type], config.date_format)] time.aside-post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
- }) - })

View File

@@ -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

View File

@@ -1,21 +1,17 @@
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
include ./card_announcement.pug !=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
if theme.aside.card_announcement
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
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
if theme.aside.card_categories if theme.aside.card_categories
include ./card_categories.pug !=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
if theme.aside.card_tags
if theme.aside.card_tags !=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
include ./card_tags.pug if theme.aside.card_archives
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
if theme.aside.card_archives if theme.aside.card_webinfo
include ./card_archives.pug !=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
if theme.aside.card_webinfo
include ./card_webinfo.pug

View File

@@ -3,6 +3,4 @@ extends includes/layout.pug
block content block content
#recent-posts.recent-posts #recent-posts.recent-posts
include includes/recent-posts.pug include includes/recent-posts.pug
include includes/pagination.pug include includes/pagination.pug
#aside_content.aside_content
include includes/widget/index.pug

14
layout/page-tags.pug Normal file
View File

@@ -0,0 +1,14 @@
.tag-cloud
.tag-cloud__title= _p('page.tag')
| -
span.tag-cloud__amount= site.tags.length
.tag-cloud-tags
- 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
-})
if page.comments !== false
include includes/comments/index.pug

View File

@@ -2,25 +2,11 @@ extends includes/layout.pug
block content block content
if page.type === 'tags' if page.type === 'tags'
.tag-cloud include page-tags.pug
.tag-cloud__title= _p('page.tag')
| -
span.tag-cloud__amount= site.tags.length
.tag-cloud-tags
include includes/page_tag.pug
if page.comments !== false
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 +14,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

View File

@@ -1,102 +1,21 @@
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!=page.content
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false) include includes/post/post-copyright.pug
.post-copyright .tag_share
.post-copyright__author if (theme.post_meta.post.tags)
span.post-copyright-meta= _p('post.copyright.author') + ": " .post-meta__tag-list
span.post-copyright-info each item, index in page.tags.data
a(href=`mailto:${config.email}`) #[=config.author] a(href=url_for(item.path)).post-meta__tags #[=item.name]
.post-copyright__type !=partial('includes/share/index', {}, {cache:theme.fragment_cache})
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
if (theme.post_meta.tags)
.post-meta__tag-list
each item, index in page.tags.data
a(href=url_for(item.path)).post-meta__tags #[=item.name]
include includes/share/index.pug
if theme.reward.enable if theme.reward.enable
include includes/reward.pug !=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
include includes/pagination.pug 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
include includes/comments/index.pug include includes/comments/index.pug

View File

@@ -6,13 +6,9 @@ block content
#recent-posts.recent-posts #recent-posts.recent-posts
+UI_NEW(page.posts) +UI_NEW(page.posts)
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

View File

@@ -1,5 +1,5 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "2.1.0", "version": "2.2.0",
"description": "A Hexo Theme: Butterfly" "description": "A Hexo Theme: Butterfly"
} }

8
scripts/events/404.js Normal file
View File

@@ -0,0 +1,8 @@
hexo.extend.generator.register('404', function(locals){
if (!hexo.theme.config.error_404.enable) return
return {
path: '404.html',
data: locals.posts,
layout: ['404']
}
});

View File

@@ -0,0 +1,30 @@
'use strict';
const fs = require('hexo-fs');
const url_for = require('hexo-util').url_for.bind(hexo);
function lazyProcess(htmlContent) {
var bg = url_for(hexo.theme.config.lodding_bg.post);
return htmlContent.replace(/<img(\s*?)src="(.*?)"(.*?)>/gi, (str, p1, p2, p3) => {
if (/data-src/gi.test(str)) {
return str;
}
if (/class="(.*?)"/gi.test(str)){
str = str.replace(/class="(.*?)"/gi, (classStr, p1) => {
return classStr.replace(p1, `${p1} lazyload`);
})
str = str.replace(p2, `${bg}`)
return str.replace(p3, `${p3} data-src="${p2}"`);
}
str = str.replace(p2, `${bg}`)
return str.replace(p3, `${p3} class="lazyload" data-src="${p2}"`);
});
}
var processPost = function(data) {
if (!hexo.theme.config.lazyload.enable) return;
data.content = lazyProcess.call(this, data.content);
return data;
};
hexo.extend.filter.register('after_post_render', processPost);

View File

@@ -0,0 +1,23 @@
hexo.extend.filter.register("before_post_render", function(data) {
if (data.cover == false) {
data.randomcover = random_cover();
return data;
}
data.cover = data.cover || random_cover();
return data;
});
var random_cover = function() {
var cover;
var num;
if (!Array.isArray(hexo.theme.config.cover.default_cover)) {
cover = hexo.theme.config.cover.default_cover;
return cover;
} else {
num = Math.floor(
Math.random() * hexo.theme.config.cover.default_cover.length
);
cover = hexo.theme.config.cover.default_cover[num];
return cover;
}
};

View File

@@ -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});

View File

@@ -1,5 +1,3 @@
const moment = require('moment');
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) { hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
var relatedPosts = []; var relatedPosts = [];
currentPost.tags.forEach(function (tag) { currentPost.tags.forEach(function (tag) {
@@ -9,6 +7,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
title: post.title, title: post.title,
path: post.path, path: post.path,
cover: post.cover, cover: post.cover,
randomcover: post.randomcover,
weight: 1, weight: 1,
updated: post.updated, updated: post.updated,
created: post.date created: post.date
@@ -32,17 +31,9 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
const config = hexo.theme.config; const config = hexo.theme.config;
var limit_num = config.related_post.limit || 6 var limit_num = config.related_post.limit || 6
var lang = hexoConfig.language;
var date_type = config.related_post.date_type || 'created' var date_type = config.related_post.date_type || 'created'
var headline_lang; var headline_lang = this._p('post.recommend')
if (lang === 'zh-CN') {
headline_lang = '相关推荐';
} else if (lang === 'zh-TW') {
headline_lang = '相關推薦';
} else {
headline_lang = 'Recommend';
}
relatedPosts = relatedPosts.sort(compare('weight')); relatedPosts = relatedPosts.sort(compare('weight'));
var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src' var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = '' var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
@@ -53,15 +44,13 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
result += '<div class="relatedPosts_list">' result += '<div class="relatedPosts_list">'
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) { for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
var cover = relatedPosts[i].cover === false ? relatedPosts[i].randomcover : relatedPosts[i].cover
var cover = relatedPosts[i].cover
result += '<div class="relatedPosts_item"><a href="' + hexoConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">'; 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 + '">'; result += '<img class="relatedPosts_cover ' + lazy_class + '"' + lazy_src + '="' + cover + '">';
if (date_type == 'created') { 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>' + ' ' + date(relatedPosts[i].created) + '</div>' 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 { } else {
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-history fa-fw" aria-hidden="true"></i>' + ' ' + date(relatedPosts[i].updated) + '</div>' 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 class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
result += '</div></a></div>' result += '</div></a></div>'
@@ -98,10 +87,4 @@ function compare(attr) {
var val2 = b[attr]; var val2 = b[attr];
return val2 - val1; return val2 - val1;
} }
} }
function date(date) {
var config = hexo.theme.config.rootConfig
moment.locale(config.language)
return moment(date).format(config.date_format)
}

View File

@@ -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);

View File

@@ -1,49 +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) {
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);

View File

@@ -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);

View File

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

27
scripts/tags/gallery.js Normal file
View File

@@ -0,0 +1,27 @@
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);

33
scripts/tags/hide.js Normal file
View File

@@ -0,0 +1,33 @@
/**
* {% hideInline content,display,bg,color %}
* content不能包含當引號可用 &apos;
*/
function hideInline(args) {
args = args.join(' ').split(',')
let content = args[0].trim()
let display = args[1] || 'Click'
let bg = args[2] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
let color = args[3] || '#fff'
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
</a><span class="hide-content">${content}</span></span>`
}
/**
* {% hideBlock display,bg,color %}
* content
* {% endhideBlock %}
*/
function hideBlock(args,content) {
args = args.join(' ').split(',')
let display = args[0] || 'Click'
let bg = args[1] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
let color = args[2] || '#fff'
return `<div class="hide-block"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
</a><span class="hide-content">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}</span></div>`
}
hexo.extend.tag.register('hideInline', hideInline);
hexo.extend.tag.register('hideBlock', hideBlock, {ends: true});

7
scripts/tags/mermaid.js Normal file
View File

@@ -0,0 +1,7 @@
function mermaid(args, content) {
return `<div class="mermaid">
${content}
</div>`;
}
hexo.extend.tag.register('mermaid', mermaid, {ends: true});

View File

@@ -1,8 +0,0 @@
hexo.extend.helper.register('url_check', function (p) {
let src = p ;
let reg = /^https?/ig;
return reg.test(src)
})

View File

@@ -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
@@ -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
@@ -170,7 +157,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 +170,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,37 +183,10 @@ 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
display: none
.medium-zoom-image--opened
z-index: 99999 !important
margin: 0 !important
.medium-zoom-overlay
z-index: 99999 !important
// hexo tag video // hexo tag video
.video-container .video-container
position: relative position: relative
@@ -243,16 +203,51 @@ img:not([src])
width: 100% width: 100%
height: 100% height: 100%
.layout_page, // tag-hide
.layout_post, .hide-inline,
.hide-block
& > .hide-button
position: relative
z-index: 1
display: inline-block
padding: 0 1rem
background: $tag-hide-bg
text-align: center
cursor: pointer
&:hover
text-decoration: none !important
& > .hide-content
display: none
.hide-inline
& > .hide-button
margin: 0 .3rem
& > .hide-content
margin: 0 .3rem
.hide-block
margin: 0 0 .8rem
.comment_headling
margin-bottom: 10px
font-weight: 700
font-size: 20px
#content-inner,
#footer #footer
animation: main 1s animation: main 1s
#nav, #nav
#top-container animation: nav-effect 1s
animation: header 1s
#site-title #page-header
animation: header-effect 1s
#site_title,
#site_subtitle
animation: titlescale 1s animation: titlescale 1s
canvas, canvas,
@@ -266,13 +261,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 .5s
.sidebar-toc__progress
animation: tocsidebarRtoL .5s
.sidebar-toc__content
animation: tocsidebarRtoL .7s
@keyframes scroll-down-effect @keyframes scroll-down-effect
0% 0%
top: 0 top: 0
@@ -286,7 +301,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)
@@ -295,6 +310,18 @@ if hexo-config('avatar_effect') == true
opacity: 1 opacity: 1
transform: translateY(0) transform: translateY(0)
@keyframes header-effect
0%
opacity: 0
50%
opacity: 0
transform: translateY(-50px)
100%
opacity: 1
transform: translateY(0)
@keyframes headerNoOpacity @keyframes headerNoOpacity
0% 0%
transform: translateY(-50px) transform: translateY(-50px)
@@ -369,10 +396,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)

View File

@@ -10,7 +10,6 @@ $code-block
padding: 0 padding: 0
background: $highlight-background background: $highlight-background
color: $highlight-foreground color: $highlight-foreground
font-size: $code-font-size
line-height: $line-height-code-block line-height: $line-height-code-block
if wordWrap if wordWrap
@@ -28,7 +27,7 @@ blockquote
margin: 0 0 1rem margin: 0 0 1rem
padding: .1rem .8rem padding: .1rem .8rem
border-left: .2rem solid $blockquote-padding-color border-left: .2rem solid $blockquote-padding-color
background-color: lighten($blockquote-padding-color, 33) background-color: $blockquote-background-color
color: $blockquote-color color: $blockquote-color
a a
@@ -46,7 +45,7 @@ blockquote
padding: 0 .3em padding: 0 .3em
content: '' content: ''
.article-container #article-container
pre, pre,
code code
font-family: $code-font !important font-family: $code-font !important
@@ -56,7 +55,8 @@ blockquote
background: $code-background background: $code-background
color: $code-foreground color: $code-foreground
word-wrap: break-word word-wrap: break-word
font-size: $code-font-size word-break: break-word
overflow-wrap: break-word
pre pre
@extend $code-block @extend $code-block
@@ -68,7 +68,7 @@ blockquote
color: $highlight-foreground color: $highlight-foreground
text-shadow: none text-shadow: none
.highlight figure.highlight
@extend $code-block @extend $code-block
position: relative position: relative
border-radius: 1px border-radius: 1px
@@ -101,6 +101,7 @@ blockquote
table table
position: relative position: relative
display: table
margin: 0 margin: 0
width: auto width: auto
border: none border: none
@@ -111,23 +112,11 @@ blockquote
figcaption figcaption
clearfix() clearfix()
position: absolute padding: .3rem 0 .1rem .7rem
z-index: 1
margin-bottom: 1em
padding: .2rem 0 .2rem .7rem
width: 100%
height: 1.4em
color: $highlight-foreground color: $highlight-foreground
font-size: 1em font-size: 1em
line-height: 1em line-height: 1em
span
float: left
overflow: hidden
max-width: 100%
text-overflow: ellipsis
white-space: nowrap
a a
float: right float: right
padding-right: 10px padding-right: 10px
@@ -136,15 +125,6 @@ blockquote
&:hover &:hover
border-bottom-color: $highlight-foreground border-bottom-color: $highlight-foreground
&+table
margin-top: 1.1rem
&:before
margin-top: -2.1rem
&:after
top: -2.1rem
.gutter pre .gutter pre
padding-right: .5rem padding-right: .5rem
padding-left: .5rem padding-left: .5rem
@@ -285,14 +265,12 @@ blockquote
.highlight-tools .highlight-tools
position: relative position: relative
overflow: hidden
width: 100% width: 100%
height: 1.4rem height: 1.4rem
background: darken($highlight-background, 5) background: darken($highlight-background, 5)
color: $highlight-foreground color: $highlight-foreground
font-size: 14px font-size: 14px
& + figure
margin: 0 !important
.highlight-close .highlight-close
height: 0 !important height: 0 !important

View File

@@ -0,0 +1,44 @@
if hexo-config('error_404.enable')
#nav.error-no-found
display: flex
flex-direction: column
justify-content: center
height: 100vh
&:before
width: 100%
height: 100%
background-color: alpha($dark-black, .5)
content: ''
#error_info
position: absolute
padding: 0 4rem
width: 100%
letter-spacing: 3px
line-height: 1
#error_title,
#error_subtitle
margin: 0
padding: 0
color: $light-grey
letter-spacing: 5px
font-family: $site-name-font
#error_title
font-size: 10rem
#error_subtitle
font-size: 2rem
@media screen and (max-width: $sm)
#nav.error-no-found
#error_info
padding: 0 2rem
#error_title
font-size: 7rem !important
#error_subtitle
font-size: 1rem !important

View File

@@ -1,11 +1,13 @@
#aside_content #aside_content
width: 25% width: 25%
.card-widget:not(:first-child)
margin-top: 1rem
.card-widget .card-widget
overflow: hidden overflow: hidden
margin-top: 20px
border-radius: 8px border-radius: 8px
background: $white background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06) box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s transition: all .3s
@@ -15,11 +17,9 @@
.card-info .card-info
img img
display: inline-block display: inline-block
padding: 5px width: 110px
width: 120px height: 110px
height: 120px
border-radius: 70px border-radius: 70px
vertical-align: top
transition: all .3s transition: all .3s
&:hover &:hover
@@ -34,21 +34,18 @@
margin-top: -.3rem margin-top: -.3rem
.card-info-data .card-info-data
display: flex
padding: .7rem 0 padding: .7rem 0
& > .card-info-data-item & > .card-info-data-item
flex: 1 1 display: inline-block
min-width: 0 width: 33.3%
a a
text-decoration: none
.headline .headline
display: block display: block
overflow: hidden overflow: hidden
color: $font-black color: $font-black
text-transform: uppercase // text-transform: uppercase
text-overflow: ellipsis text-overflow: ellipsis
white-space: nowrap white-space: nowrap
font-size: .7rem font-size: .7rem
@@ -77,8 +74,7 @@
z-index: 1 z-index: 1
display: block display: block
background-color: $light-blue background-color: $light-blue
color: $white color: $button-color
text-decoration: none
text-transform: uppercase text-transform: uppercase
line-height: 1.6rem line-height: 1.6rem
@@ -96,7 +92,6 @@
.card-tag-cloud .card-tag-cloud
a a
text-decoration: none
word-break: keep-all word-break: keep-all
&:hover &:hover
@@ -111,7 +106,6 @@
& > a & > a
color: $font-black color: $font-black
text-decoration: none
.aside-post-cover .aside-post-cover
float: left float: left
@@ -134,7 +128,7 @@
.aside-post-title .aside-post-title
.aside-post_meta .aside-post_meta
padding-left: 10px padding-left: 10px
color: $theme-link-color color: $theme-meta-color
font-size: .6rem font-size: .6rem
.aside-post_title .aside-post_title
@@ -149,6 +143,10 @@
&:hover &:hover
color: $light-blue !important color: $light-blue !important
&.no-aside-cover
.aside-post_title
height: auto
.card-archives ul.archive-list, .card-archives ul.archive-list,
.card-categories ul.aside-category-item .card-categories ul.aside-category-item
margin: 0 margin: 0
@@ -164,19 +162,23 @@
&:hover &:hover
padding: .2rem .85rem padding: .2rem .85rem
background-color: $light-blue background-color: $light-blue
color: #363636
a a
display: flex
color: $font-black color: $font-black
text-decoration: none
span span
display: inline-block
overflow: hidden
vertical-align: bottom
text-overflow: ellipsis
white-space: nowrap
&:first-child &:first-child
flex: auto width: 80%
overflow: hidden
text-overflow: ellipsis &:last-child
white-space: nowrap width: 20%
text-align: right
.card-categories .card-categories
.aside-category-item .aside-category-item
@@ -211,6 +213,10 @@
#aside_content #aside_content
width: 100% !important width: 100% !important
#aside_content
.card-widget:first-child
margin-top: 1rem
@media screen and (min-width: 900px) @media screen and (min-width: 900px)
#aside_content #aside_content
.card-widget .card-widget
@@ -219,7 +225,7 @@
else else
margin-right: 15px margin-right: 15px
if hexo-config('aside_mobile') == false if hexo-config('aside.mobile') == false
@media screen and (max-width: $sm) @media screen and (max-width: $sm)
#aside_content #aside_content
display: none display: none

View File

@@ -27,7 +27,7 @@
top: 0 top: 0
left: 0 left: 0
background: $light-blue background: $light-blue
color: $white color: $card-bg
cursor: pointer cursor: pointer
transition: all .3s ease-out transition: all .3s ease-out
@@ -48,7 +48,7 @@
li li
&:hover &:hover
&:before &:before
border-color: $ruby border-color: $theme-button-hover-color
&:before &:before
$w = .3rem $w = .3rem
@@ -58,6 +58,6 @@
height: h = w height: h = w
border: .5 * w solid $light-blue border: .5 * w solid $light-blue
border-radius: w border-radius: w
background: $white background: transparent
content: '' content: ''
line-height: h line-height: h

View File

@@ -1,68 +0,0 @@
#disqus_thread
margin-top: 1rem
.comment_headling
margin-bottom: 10px
font-weight: 700
font-size: 20px
// valine
#vcomment
font-size: inherit
input
font-size: .65rem
button
padding: .3rem 1rem
border-color: #fff
background-color: $light-blue
color: #fff
font-size: .7rem
&:hover
background-color: darken($light-blue, 40)
textarea
font-size: .7rem
if hexo-config('valine.bg')
background: url(hexo-config('valine.bg')) 100% 100% no-repeat
.info
display: none
.vimg
border: 0
&:hover
transform: rotate(540deg)
.vcount
font-size: .775rem
.vnum
font-size: 1.1rem
.vsys
font-size: 80%
.vtime
font-size: .65rem
.vcontent
font-size: 100%
.vat
padding: 0 .8rem
border: 1px solid $cyan
border-radius: 5px
color: $cyan
font-size: .7125rem
&:hover
background-color: alpha($cyan, .5)
code,
pre
font-size: 98%

View File

@@ -1,11 +1,9 @@
.flink .flink#article-container
.post-cards .post-cards
margin: -10px 10px 0 margin: -10px 10px 0
.md-links .md-links
overflow: auto overflow: auto
margin: 0 auto
padding: 0
text-align: center text-align: center
& > .md-links-item & > .md-links-item
@@ -13,11 +11,9 @@
float: left float: left
overflow: hidden overflow: hidden
margin: 20px 7px margin: 20px 7px
padding: 0 width: calc(100% / 3 - 15px)
width: calc(100% / 3 - 14px)
height: 90px height: 90px
border-radius: 8px border-radius: 8px
list-style: none
line-height: 17px line-height: 17px
transform: perspective(1px) translateZ(0) transform: perspective(1px) translateZ(0)
@@ -45,15 +41,14 @@
transform: scale(1) transform: scale(1)
a a
color: #333 color: $font-color
text-decoration: none text-decoration: none
img img
float: left float: left
margin: 11px 10px margin: 13px 0 0 10px
padding: 4px width: 65px
width: 70px height: 65px
height: 70px
border-radius: 35px border-radius: 35px
transition: all .3s transition: all .3s
@@ -74,18 +69,14 @@
white-space: nowrap white-space: nowrap
font-size: 13px font-size: 13px
.comment-word
font-weight: bold
font-size: 1.7em
@media screen and (max-width: 1100px) @media screen and (max-width: 1100px)
.flink .flink
.md-links .md-links
.md-links-item .md-links-item
width: calc(50% - 14px) !important width: calc(50% - 15px) !important
@media screen and (max-width: 600px) @media screen and (max-width: 600px)
.flink .flink
.md-links .md-links
.md-links-item .md-links-item
width: calc(100% - 14px) !important width: calc(100% - 15px) !important

View File

@@ -1,6 +1,5 @@
#footer #footer
position: relative position: relative
margin-top: 1rem
background: $light-blue background: $light-blue
background-attachment: local background-attachment: local
background-position: bottom background-position: bottom
@@ -9,10 +8,8 @@
if hexo-config('footer_bg') != false if hexo-config('footer_bg') != false
&:before &:before
position: absolute position: absolute
top: 0 width: 100%
right: 0 height: 100%
bottom: 0
left: 0
background-color: alpha($dark-black, .5) background-color: alpha($dark-black, .5)
content: '' content: ''
@@ -24,11 +21,11 @@
a a
color: $light-grey color: $light-grey
text-decoration: none
cursor: pointer cursor: pointer
&:hover &:hover
color: $white color: $theme-color
text-decoration: underline
.footer-separator .footer-separator
margin: 0 .2rem margin: 0 .2rem

View File

@@ -0,0 +1,109 @@
figure.gallery-group
position: relative
float: left
overflow: hidden
margin: .3rem .2rem
width: calc(50% - .4rem)
height: 250px
border-radius: 8px
background: $dark-black
-webkit-transform: translate3d(0, 0, 0)
&:hover
img
opacity: .4
transform: translate3d(0, 0, 0)
.gallery-group-name::after
transform: translate3d(0, 0, 0)
p
opacity: 1
transform: translate3d(0, 0, 0)
img
position: relative
margin: 0 !important
max-width: none
width: calc(100% + 20px)
height: 250px
backface-visibility: hidden
opacity: .8
transition: opacity .35s, transform .35s
transform: translate3d(-10px, 0, 0)
object-fit: cover
figcaption
position: absolute
top: 0
left: 0
padding: 1.5rem
width: 100%
height: 100%
color: $gallery-color
text-transform: uppercase
backface-visibility: hidden
& > a
position: absolute
top: 0
right: 0
bottom: 0
left: 0
z-index: 1000
opacity: 0
p
display: -webkit-box
overflow: hidden
margin: 0
padding: .4rem 0 0
letter-spacing: 1px
font-size: .8rem
line-height: 1.5
opacity: 0
transition: opacity .35s, transform .35s
transform: translate3d(100%, 0, 0)
-webkit-line-clamp: 4
-webkit-box-orient: vertical
.gallery-group-name
position: relative
display: -webkit-box
overflow: hidden
margin: 0
padding: .4rem 0
font-weight: bold
font-size: 1.2rem
line-height: 1.5
-webkit-line-clamp: 2
-webkit-box-orient: vertical
&:after
position: absolute
bottom: 0
left: 0
width: 100%
height: 2px
background: $gallery-color
content: ''
transition: transform .35s
transform: translate3d(-100%, 0, 0)
.gallery-group-main
overflow: auto
padding: 0 0 .8rem
.justified-gallery
margin: 0 0 .8rem
img
opacity: 0
.fancybox
width: auto
text-align: inherit
@media screen and (max-width: 600px)
figure.gallery-group
width: calc(100% - .4rem)

View File

@@ -1,21 +1,39 @@
#nav #nav
position: relative position: relative
margin-bottom: 1rem
width: 100% width: 100%
background-color: $light-blue background-color: $light-blue
background-attachment: local background-attachment: local
background-position: center background-position: center center
background-size: cover background-size: cover
background-repeat: no-repeat
transition: all .5s
// index
&.full_page &.full_page
display: flex
align-items: center
height: $index_top_img_height height: $index_top_img_height
&.not_index_bg #site-info
height: 20rem position: absolute
top: $index_site_info_top
padding: 0 .5rem
width: 100%
#site-social-icons #site_title,
#site_subtitle,
#scroll_down .scroll-down-effects
color: $light-grey
text-align: center
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
line-height: 1.5
#site_title
margin: 0
font-size: 1.3rem
#site_subtitle
font-size: .8rem
#site_social_icons
display: none display: none
margin: 0 auto margin: 0 auto
width: 15rem width: 15rem
@@ -28,47 +46,83 @@
font-size: .9rem font-size: .9rem
cursor: pointer cursor: pointer
&:hover #scroll_down
color: $white
#site-info
position: absolute
width: 100%
#site-title,
#site-sub-title
color: $light-grey
text-align: center
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
line-height: 1.5
#site-title
font-weight: bold
font-size: 1.3rem
#site-sub-title
font-size: .8rem
#page_site-info
position: absolute
top: 10rem
width: 100%
.scroll-down
position: absolute
bottom: 0
width: 100%
height: 42px
text-align: center
font-size: 30px
cursor: pointer
.scroll-down-effects
position: absolute position: absolute
color: $white bottom: 0
width: 100%
cursor: pointer
header .scroll-down-effects
position: relative position: relative
width: 100%
font-size: 30px
// page
&.not-index-bg
height: 20rem
#page_site-info
position: absolute
top: 10rem
padding: 0 .5rem
width: 100%
// post
&.post-bg
height: 20rem
&:before
position: absolute
top: 0
left: 0
display: block
width: 100%
height: 100%
background-color: alpha($dark-black, .5)
content: ''
#post-info
position: absolute
bottom: 1.5rem
padding: 0 8%
width: 100%
color: $light-grey
text-align: left
#post-title
margin-bottom: .4rem
font-size: 1.5rem
.posttitle
display: -webkit-box
overflow: hidden
line-height: 1.5
-webkit-line-clamp: 3
-webkit-box-orient: vertical
#post-meta
.word-count,
#busuanzi_value_page_pv,
.comment-count
padding-left: .2rem
.post-meta
&__separator
margin: 0 .3rem
&__icon
margin-right: .2rem
&-pv-cv
display: inline-block
a
color: $light-grey
transition: all .3s ease-out
&:hover
color: $light-blue
text-decoration: underline
#page-header #page-header
position: absolute position: absolute
@@ -79,7 +133,6 @@ header
height: 58px height: 58px
border: none border: none
font-size: 18px font-size: 18px
opacity: 0
transition: all .5s transition: all .5s
.toggle-menu .toggle-menu
@@ -95,7 +148,6 @@ header
a a
color: $light-grey color: $light-grey
text-decoration: none
&:hover &:hover
color: $white color: $white
@@ -109,13 +161,14 @@ header
transition: transform .2s ease-in-out, opacity .2s ease-in-out transition: transform .2s ease-in-out, opacity .2s ease-in-out
&.open-sidebar &.open-sidebar
.site-page .menus,
visibility: hidden #search_button
display: none
a, a,
#site-name, #site-name,
.toggle-menu .toggle-menu
color: $light-black color: $font-black
text-shadow: none text-shadow: none
&:hover &:hover
@@ -129,7 +182,7 @@ header
background-color: $white !important background-color: $white !important
#site-name #site-name
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15) text-shadow: .1rem .1rem .2rem rgba($dark-black, .15)
font-weight: bold font-weight: bold
cursor: pointer cursor: pointer
@@ -163,7 +216,7 @@ header
transition: all .3s ease-in-out transition: all .3s ease-in-out
&:hover &:hover
&::after &:after
width: 100% width: 100%
.menus_item_child .menus_item_child
@@ -174,7 +227,7 @@ header
padding: 0 padding: 0
width: max-content width: max-content
background-color: alpha($white, .8) background-color: alpha($white, .8)
box-shadow: 0 5px 20px -4px rgba(0, 0, 0, .5) box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
animation: sub_menus .3s .1s ease both animation: sub_menus .3s .1s ease both
&:before &:before
@@ -194,7 +247,7 @@ header
background: $theme-color background: $theme-color
a a
color: #3b3a3a color: $font-black
text-shadow: none text-shadow: none
#search_button #search_button
@@ -203,34 +256,50 @@ header
.site-page .site-page
position: relative position: relative
padding-bottom: .3rem padding-bottom: .3rem
text-shadow: .05rem .05rem .1rem rgba(0, 0, 0, .3) text-shadow: .05rem .05rem .1rem rgba($dark-black, .3)
font-size: .7rem font-size: .7rem
cursor: pointer cursor: pointer
@media screen and (min-width: $sm) @media screen and (min-width: $sm)
#site-title #nav
font-size: 2rem #site_title
font-size: 2rem
#site-sub-title #site_subtitle
font-size: 1.2rem font-size: 1.2rem
@media screen and (max-width: $sm) @media screen and (max-width: $sm)
#page-header #page-header
padding: 10px .8rem padding: 10px .8rem
#nav #nav
#site-social-icons #site_social_icons
display: block display: block
&.not_index_bg &.not-index-bg
height: 14rem height: 14rem
#page_site-info #page_site-info
top: 7rem top: 7rem
@media screen and (max-width: $bg) &.post-bg
#page-header height: 18rem
&.fixed
&.open-sidebar & > #post-info
.site-page bottom: 1rem
visibility: visible padding: 0 5%
& > #post-title
font-size: 1.2rem
& > #post-meta
font-size: 90%
& > span
display: none
.post-meta-pv-cv
display: block
.post-meta__separator:first-child
display: none

View File

@@ -7,23 +7,21 @@
left: 0 left: 0
z-index: 102 z-index: 102
display: none display: none
background: alpha($dark-black, .7) background: alpha($dark-black, .8)
#mobile-sidebar-menus, #mobile-sidebar-menus
#mobile-sidebar-toc
position: fixed position: fixed
top: 0 top: 0
right: -254px right: -250px
z-index: 103 z-index: 103
display: block display: block
overflow: hidden
overflow-y: scroll overflow-y: scroll
width: 250px width: 250px
height: 100% height: 100%
background: $white background: #f6f8fa
box-shadow: 0 0 4px alpha($dark-black, .27)
transition: all .5s transition: all .5s
#mobile-sidebar-menus
& > .mobile_author_icon & > .mobile_author_icon
padding: 1.3rem 1.5rem 0 padding: 1.3rem 1.5rem 0
text-align: center text-align: center
@@ -31,33 +29,33 @@
img img
display: inline-block display: inline-block
padding: 0 padding: 0
width: 120px width: 110px
height: 120px height: 110px
border-radius: 70px border-radius: 70px
vertical-align: top
transition: all .3s transition: all .3s
.mobile_post_data .mobile_post_data
display: flex
justify-content: center
padding: .6rem .5rem 0 padding: .6rem .5rem 0
.mobile_data_item .mobile_data_item
flex: 1 display: inline-block
width: 33.3%
.mobile_data_link .mobile_data_link
a & > a > div
text-decoration: none overflow: hidden
text-overflow: ellipsis
white-space: nowrap
.length_num .length_num
color: $dark-black color: $dark-black
font-size: .9rem font-size: .9rem
.headline .headline
display: block display: block
color: $font-black color: $font-black
text-transform: uppercase // text-transform: uppercase
font-size: .7rem font-size: .7rem
hr hr
margin: 1rem auto margin: 1rem auto
@@ -74,7 +72,6 @@
margin: 0 margin: 0
padding: .3rem 1.5rem padding: .3rem 1.5rem
color: $font-black color: $font-black
text-decoration: none
text-overflow: ellipsis text-overflow: ellipsis
text-shadow: none text-shadow: none
white-space: nowrap white-space: nowrap
@@ -106,25 +103,4 @@
.menus_item_child .menus_item_child
margin: 0 margin: 0
list-style: none list-style: none
#mobile-sidebar-toc
padding: 1rem .5rem 5rem .3rem
ol,
li
margin: 0
padding: 0 0 0 8px
list-style: none
.toc_mobile_headline
text-align: center
font-weight: bold
font-size: 18px
.toc_mobile_items-link
color: $font-color
text-decoration: none
&:hover
color: $light-blue

View File

@@ -57,7 +57,12 @@
top: 13px top: 13px
left: 15px left: 15px
font-size: larger font-size: larger
font-family: 'FontAwesome'
if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
font-weight: 600
font-family: 'Font Awesome 5 Free'
else
font-family: 'FontAwesome'
&.default &.default
if ($note-style == 'flat') if ($note-style == 'flat')

View File

@@ -2,22 +2,24 @@
display: flex display: flex
align-items: flex-start align-items: flex-start
margin: 0 auto margin: 0 auto
padding: 0 15px padding: 2rem 15px
max-width: 1200px max-width: 1200px
// index // index
#recent-posts #recent-posts
width: 75% width: 75%
& > .recent-post-item:not(:first-child)
margin-top: 1rem
& > .recent-post-item & > .recent-post-item
display: flex display: flex
flex-direction: row flex-direction: row
align-items: center align-items: center
margin-top: 20px
padding: 0 padding: 0
height: 280px height: 280px
border-radius: 8px border-radius: 8px
background: #fff background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06) box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s transition: all .3s
@@ -27,20 +29,20 @@
img.post_bg img.post_bg
transform: scale(1.1) transform: scale(1.1)
if hexo-config('index_post_cover') == 'both' if hexo-config('cover.position') == 'both'
.left_radius .left_radius
border-radius: 8px 0 0 8px border-radius: 8px 0 0 8px
.right_radius .right_radius
order: 2 order: 2
border-radius: 0 8px 8px 0 border-radius: 0 8px 8px 0
else if hexo-config('index_post_cover') == 'left' else if hexo-config('cover.position') == 'left'
.left_radius .left_radius
border-radius: 8px 0 0 8px border-radius: 8px 0 0 8px
.right_radius .right_radius
border-radius: 8px 0 0 8px border-radius: 8px 0 0 8px
else if hexo-config('index_post_cover') == 'right' else if hexo-config('cover.position') == 'right'
.left_radius .left_radius
order: 2 order: 2
border-radius: 0 8px 8px 0 border-radius: 0 8px 8px 0
@@ -53,6 +55,7 @@
overflow: hidden overflow: hidden
width: 45% width: 45%
height: 280px height: 280px
-webkit-mask-image: -webkit-radial-gradient(white, black)
img.post_bg img.post_bg
display: block display: block
@@ -73,12 +76,14 @@
padding: 0 40px padding: 0 40px
width: 55% width: 55%
&.no-cover
width: 100%
& > .article-title & > .article-title
display: -webkit-box display: -webkit-box
overflow: hidden overflow: hidden
margin-bottom: .3rem margin-bottom: .3rem
color: $black color: $font-black
text-decoration: none
text-overflow: ellipsis text-overflow: ellipsis
word-wrap: break-word word-wrap: break-word
font-size: 1.2rem font-size: 1.2rem
@@ -90,36 +95,41 @@
&:hover &:hover
color: $light-blue !important color: $light-blue !important
& > time & > .article-meta-wrap
color: $grey font-size: 95%
& > .article-meta & > time
color: $grey color: $theme-meta-color
& > .article-meta
color: $theme-meta-color
.sticky .sticky
color: $theme-button-hover-color color: $sticky-color
i i
margin: 0 .2rem 0 .3rem margin: 0 .2rem 0 0
.article-meta__separator .article-meta__separator,
margin-left: .3rem .article-meta__link
margin: 0 .3rem
.fa-angle-right .fa-angle-right
margin: 0 0 0 .3rem margin: 0 .3rem
a.article-meta__categories a.article-meta__categories,
color: #858585 a.article-meta__tags
text-decoration: none color: $theme-meta-color
&:hover &:hover
color: #49b1f5 !important color: $light-blue !important
text-decoration: underline
& > .content & > .content
display: -webkit-box display: -webkit-box
overflow: hidden overflow: hidden
margin-top: .5rem margin-top: .3rem
height: 90px height: 85px
word-break: break-word word-break: break-word
-webkit-line-clamp: 3 -webkit-line-clamp: 3
-webkit-box-orient: vertical -webkit-box-orient: vertical
@@ -129,12 +139,11 @@
a a
display: inline-block display: inline-block
padding: 0 .4rem padding: 0 .4rem
text-decoration: none
cursor: pointer cursor: pointer
transition: all .3s transition: all .3s
&:hover &:hover
color: $ruby !important color: $theme-button-hover-color !important
transform: scale(1.1) transform: scale(1.1)
&__title &__title
@@ -144,40 +153,29 @@
&-tags &-tags
text-align: center text-align: center
#tag, .layout_post > #post,
#category, .layout_page > div:first-child:not(.recent-posts)
#archive padding: 50px 40px
padding: 3rem
.tag-cloud,
#page,
.category-content,
.flink
padding: 40px 44px 44px
#page,
.category-content,
#archive,
.tag-cloud,
.flink,
#tag,
#category
margin-top: 20px
width: 75%
border-radius: 8px border-radius: 8px
background: $white background: $card-bg
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06) box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s transition: all .3s
&:hover &:hover
box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15) box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
.layout_page
& > div:first-child:not(.recent-posts)
width: 75%
.article-sort .article-sort
margin-left: .5rem
padding-left: 1rem padding-left: 1rem
border-left: 2px solid $pale-blue border-left: 2px solid lighten($light-blue, 20)
&-title &-title
position: relative position: relative
margin-left: .5rem
padding-bottom: 1.2rem padding-bottom: 1.2rem
padding-left: 1rem padding-left: 1rem
font-size: 1.2rem font-size: 1.2rem
@@ -185,7 +183,7 @@
&:hover &:hover
&:before &:before
border-color: $ruby border-color: $theme-button-hover-color
&:before &:before
position: absolute position: absolute
@@ -196,7 +194,7 @@
height: h = w height: h = w
border: .5 * w solid $light-blue border: .5 * w solid $light-blue
border-radius: w border-radius: w
background: $white background: $card-bg
content: '' content: ''
line-height: h line-height: h
transition: all .2s ease-in-out transition: all .2s ease-in-out
@@ -208,17 +206,19 @@
z-index: 0 z-index: 0
width: .1rem width: .1rem
height: 1.3rem height: 1.3rem
background: $pale-blue background: lighten($light-blue, 20)
content: '' content: ''
&-item &-item
position: relative position: relative
margin: 0 0 1rem .5rem margin: 0 0 1rem .5rem
width: 100%
height: 80px
transition: all .2s ease-in-out transition: all .2s ease-in-out
&:hover &:hover
&:before &:before
border-color: $ruby border-color: $theme-button-hover-color
&:before &:before
$w = .3rem $w = .3rem
@@ -229,12 +229,22 @@
height: h = w height: h = w
border: .5 * w solid $light-blue border: .5 * w solid $light-blue
border-radius: w border-radius: w
background: $white background: $card-bg
content: '' content: ''
line-height: h line-height: h
transition: all .2s ease-in-out transition: all .2s ease-in-out
&.no-article-cover
display: flex
flex-direction: column
justify-content: center
.article-sort-post
padding: 0
width: 100%
&.year &.year
height: auto
font-size: 1rem font-size: 1rem
&:hover &:hover
@@ -243,17 +253,15 @@
&:before &:before
top: .7rem top: .7rem
border-color: $ruby border-color: $theme-button-hover-color
&__time &__time
padding-left: .4rem padding-left: .4rem
color: $a-link-color
font-size: .7rem font-size: .7rem
&__title &__title
display: -webkit-box display: -webkit-box
overflow: hidden overflow: hidden
height: 60px
color: $font-black color: $font-black
font-size: .75rem font-size: .75rem
transition: all .3s transition: all .3s
@@ -276,23 +284,21 @@
transform: scale(1.1) transform: scale(1.1)
&__post &__post
text-decoration: none color: $theme-meta-color
cursor: pointer
&:hover &:hover
color: $a-link-color color: $theme-meta-color
&-img &-img
display: inline-block float: left
overflow: hidden overflow: hidden
width: 80px width: 80px
height: 80px height: 80px
&-post &-post
position: absolute
top: 0
display: inline-block display: inline-block
margin-left: 1rem padding: 0 1rem
width: calc(100% - 80px)
.category-lists .category-lists
padding: 1rem 0 1.5rem padding: 1rem 0 1.5rem
@@ -304,12 +310,11 @@
.category-list .category-list
a a
color: $font-black color: $font-black
text-decoration: none
cursor: pointer cursor: pointer
.category-list-count .category-list-count
margin-left: .4rem margin-left: .4rem
color: $a-link-color color: $theme-meta-color
&:before &:before
content: '(' content: '('
@@ -317,19 +322,19 @@
&:after &:after
content: ')' content: ')'
// aside
.hide-aside
max-width: 1000px
& > div
width: 100% !important
@media screen and (max-width: $sm) @media screen and (max-width: $sm)
.layout_page .layout_page
padding: 0 5px !important padding: 1rem 5px !important
#page, & > div:first-child:not(.recent-posts)
.category-content, padding: 1.8rem .7rem
#archive,
.tag-cloud,
.flink,
#tag,
#category
margin: 0
padding: 1.8rem 1.3rem
.category-lists .category-lists
padding: 0 padding: 0
@@ -347,17 +352,17 @@
.recent-post-info .recent-post-info
order: 2 !important order: 2 !important
padding: 30px 25px 18px !important padding: 1rem 1rem 1.5rem
width: 100% width: 100%
&.no-cover
padding: 1.5rem 1rem
.article-title .article-title
font-size: 1rem font-size: 1rem
.article-meta.tags .content
display: none height: auto
&:first-child
margin: 0
@media screen and (min-width: 900px) @media screen and (min-width: 900px)
if hexo-config('aside.position') == 'left' if hexo-config('aside.position') == 'left'
@@ -366,17 +371,11 @@
.category-content, .category-content,
#archive, #archive,
.tag-cloud, .tag-cloud,
.flink,
#tag, #tag,
#category #category
order: 2 order: 2
@media screen and (max-width: 900px) @media screen and (max-width: 900px)
#page, .layout_page
.category-content, & > div:first-child:not(.recent-posts)
#archive, width: 100% !important
.tag-cloud,
.flink,
#tag,
#category
width: 100% !important

View File

@@ -6,9 +6,6 @@
.pagination .pagination
text-align: center text-align: center
.space
color: $a-link-color
.page-number .page-number
display: inline-block display: inline-block
margin: 0 .2rem margin: 0 .2rem
@@ -19,71 +16,56 @@
cursor: pointer cursor: pointer
&.current &.current
background: $cyan background: $theme-paginator-color
color: $white color: $button-color
cursor: default cursor: default
img.prev_cover, img.prev_cover,
img.next_cover img.next_cover
position: absolute position: absolute
top: 0
left: 0
padding: 0
width: 100% width: 100%
height: 100% height: 100%
background-size: cover
opacity: .4 opacity: .4
transition: all .6s transition: all .6s
pointer-events: none
object-fit: cover object-fit: cover
.pagination-info
position: absolute
top: 50%
padding: 1rem 2rem
width: 100%
transform: translate(0, -50%)
.prev_info, .prev_info,
.next_info .next_info
position: absolute
bottom: 50px
z-index: 100
display: block
overflow: hidden overflow: hidden
width: 70% color: $button-color
color: $white
text-overflow: ellipsis text-overflow: ellipsis
white-space: nowrap white-space: nowrap
font-weight: 400 font-weight: 500
.next_info .next-post
right: 40px .pagination-info
text-align: right text-align: right
.pull-full .pull-full
width: 100% !important width: 100% !important
.prev-post .label, .prev-post .label,
.next-post .label .next-post .label
position: absolute
top: 50px
z-index: 100
display: block
color: alpha($white, .9) color: alpha($white, .9)
text-transform: uppercase text-transform: uppercase
font-size: 90% font-size: 90%
.next-post .label
right: 40px
.prev-post, .prev-post,
.next-post .next-post
float: left
width: 50% width: 50%
a a
position: relative position: relative
display: block display: block
float: left
overflow: hidden overflow: hidden
padding: 55px 40px
width: 100%
height: 150px height: 150px
text-align: left
&:hover &:hover
img.prev_cover, img.prev_cover,

View File

@@ -1,81 +1,18 @@
if hexo-config('post_beautify.enable') #article-container
headStyle(fontsize) if hexo-config('beautify.enable')
padding-left: unit(fontsize + .3, 'rem') headStyle(fontsize)
padding-left: unit(fontsize + .4, 'rem')
code code
font-size: unit(fontsize, 'rem') font-size: unit(fontsize, 'rem')
&:before &:before
top: calc(50% - unit(fontsize / 2 - .05, 'rem')) margin-left: unit((-(fontsize + .2)), 'rem')
font-size: unit(fontsize, 'rem') font-size: unit(fontsize, 'rem')
&:hover &:hover
padding-left: unit(fontsize + .2, 'rem') padding-left: unit(fontsize + .6, 'rem')
#top-container
position: relative
margin-bottom: 1rem
height: 19rem
background-color: $light-blue
background-attachment: local
background-position: center
background-size: cover
&:before
position: absolute
top: 0
left: 0
display: block
width: 100%
height: 100%
background-color: alpha($dark-black, .5)
content: ''
a
color: $light-grey
text-decoration: none
transition: all .3s ease-out
&:hover
text-decoration: underline
& > #post-info
position: absolute
bottom: 1.5rem
padding: 0 8%
width: 100%
color: $light-grey
text-align: left
#post-title
margin-bottom: .4rem
font-size: 1.5rem
.posttitle
display: -webkit-box
overflow: hidden
line-height: 1.5
-webkit-line-clamp: 3
-webkit-box-orient: vertical
#post-meta
.word-count,
#busuanzi_value_page_pv,
.comment-count
padding-left: .2rem
.post-meta
&__separator
margin: 0 .3rem
&__icon
margin-right: .2rem
&-pv-cv
display: inline-block
#post-content
if hexo-config('post_beautify.enable')
h1, h1,
h2, h2,
h3, h3,
@@ -88,16 +25,23 @@ if hexo-config('post_beautify.enable')
&:before &:before
position: absolute position: absolute
top: calc(50% - .35rem) top: calc(50% - .35rem)
left: 0
color: $title-prefix-icon-color color: $title-prefix-icon-color
content: $title-prefix-icon content: $title-prefix-icon
font: normal normal normal 14px / 1 FontAwesome font-style: normal
font-size: .8rem font-variant: normal
line-height: 1
transition: all .2s ease-out transition: all .2s ease-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
&:hover &:hover
padding-left: 1.1rem
&:before &:before
color: $light-blue color: $light-blue
@@ -147,7 +91,7 @@ if hexo-config('post_beautify.enable')
top: 0 top: 0
left: 0 left: 0
background: $light-blue background: $light-blue
color: $white color: $card-bg
cursor: pointer cursor: pointer
transition: all .3s ease-out transition: all .3s ease-out
@@ -168,7 +112,7 @@ if hexo-config('post_beautify.enable')
> li > li
&:hover &:hover
&:before &:before
border-color: $ruby border-color: $theme-button-hover-color
&:before &:before
$w = .3rem $w = .3rem
@@ -178,7 +122,7 @@ if hexo-config('post_beautify.enable')
height: h = w height: h = w
border: .5 * w solid $light-blue border: .5 * w solid $light-blue
border-radius: w border-radius: w
background: $white background: transparent
content: '' content: ''
line-height: h line-height: h
else else
@@ -201,14 +145,13 @@ if hexo-config('post_beautify.enable')
a a
color: $a-link-color color: $a-link-color
text-decoration: none
word-wrap: break-word
transition: all .2s transition: all .2s
overflow-wrap: break-word
&:hover &:hover
color: $light-blue color: $light-blue
text-decoration: none
&#site-name
text-decoration: none
a.fancybox a.fancybox
outline: none outline: none
@@ -219,7 +162,6 @@ a.fancybox
display: inline-block display: inline-block
width: 100% width: 100%
text-align: center text-align: center
text-decoration: none
p p
margin: 0 0 .8rem margin: 0 0 .8rem
@@ -240,14 +182,14 @@ img
transition: all .3s transition: all .3s
transform: rotate(0) transform: rotate(0)
& + .code_lang & + .code-lang
left: 30px left: 30px
&.code-closed &.code-closed
transition: all .3s transition: all .3s
transform: rotate(-90deg) !important transform: rotate(-90deg) !important
.code_lang .code-lang
position: absolute position: absolute
left: 15px left: 15px
z-index: 1 z-index: 1
@@ -279,10 +221,6 @@ img
&:hover &:hover
color: darken($highlight-aqua, 20%) color: darken($highlight-aqua, 20%)
@media screen and (min-width: $md)
.layout_post
width: $content-large-width
.katex-wrap .katex-wrap
overflow: auto overflow: auto
@@ -291,21 +229,14 @@ img
display: none display: none
.layout_post .layout_post
margin: 40px auto margin: 0 auto
padding: 50px padding: 2rem 15px
max-width: 1000px max-width: 1000px
border-radius: 8px
background: #fff
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
transition: all .3s
&:hover
box-shadow: 0 4px 12px 12px rgba(7, 17, 27, .15)
img img
display: block display: block
& >.tag_share .tag_share
.post-meta .post-meta
&__tag-list &__tag-list
display: inline-block display: inline-block
@@ -317,16 +248,14 @@ img
width: fit-content width: fit-content
border: 1px solid $light-blue border: 1px solid $light-blue
border-radius: .6rem border-radius: .6rem
background: $white
color: $light-blue color: $light-blue
text-decoration: none
font-size: 12px font-size: 12px
cursor: pointer cursor: pointer
transition: all .2s ease-in-out transition: all .2s ease-in-out
&:hover &:hover
background: $light-blue background: $light-blue
color: $white color: $button-color
.post_share .post_share
display: inline-block display: inline-block
@@ -344,7 +273,7 @@ img
font-size: 15px font-size: 15px
line-height: 25px line-height: 25px
& > .post-copyright .post-copyright
position: relative position: relative
margin: 2rem 0 .5rem margin: 2rem 0 .5rem
padding: .5rem .8rem padding: .5rem .8rem
@@ -383,47 +312,29 @@ img
padding-left: .3rem padding-left: .3rem
a a
text-decoration: underline
word-break: break-word word-break: break-word
#post &:hover
a text-decoration: none
color: $light-blue
text-decoration: none
&:hover #article-container
text-decoration: underline a
color: $theme-link-color
img &:hover
margin: .8rem auto text-decoration: underline
img
margin: 0 auto .8rem
@media screen and (max-width: 1024px) @media screen and (max-width: 1024px)
.layout_post .layout_post
margin: 0 15px
width: auto width: auto
@media screen and (max-width: $sm) @media screen and (max-width: $sm)
.layout_post .layout_post
margin: 0 5px padding: 1rem 5px
padding: 1.8rem 1rem
#top-container & > #post
height: 18rem padding: 1.8rem .7rem
& > #post-info
bottom: 1rem
padding: 0 5%
& > #post-title
font-size: 1.2rem
& > #post-meta
font-size: 90%
& > span
display: none
.post-meta-pv-cv
display: block
.post-meta__separator:first-child
display: none

View File

@@ -1,93 +0,0 @@
if hexo-config('readmode') && hexo-config('readmode.enable')
.read-mode
padding: 0 !important
background: $pale-yellow
#page-header
#site-name,
.site-page
color: $font-black
text-shadow: none
.menus_item_child
background-color: darken($pale-yellow, 3) !important
& > li
&:hover
background-color: darken($pale-yellow, 10) !important
#top-container
height: 14rem
background-color: $pale-yellow
background-image: none !important
a
color: $font-black
&:before
opacity: 0
& > #post-info
padding: 0
color: $font-black
text-align: center
#page-header
&.fixed
background: alpha(darken($pale-yellow, 5), .5)
box-shadow: none
&.open-sidebar
.site-page
visibility: visible
.layout_post
background: $pale-yellow
box-shadow: none
&:hover
box-shadow: none
.article-container
pre,
.highlight:not(.js-file-line-container)
background: darken($pale-yellow, 5)
.highlight
display: block !important
blockquote
border-left: .2rem solid #d6dbdf
background-color: rgba(102, 128, 153, .05)
#rightside
#darkmode
display: none
& > canvas
display: none !important
.code-area-wrap > .highlight-tools,
#sidebar,
#toggle-sidebar,
#footer,
.layout_post > div,
.layout_post > hr,
.layout_post > nav
display: none
hr
border: 2px dashed #d6dbdf
background: transparent
&:before
color: darken(#d6dbdf, 10)
&::-webkit-scrollbar-thumb
background: darken($pale-yellow, 10)
*::-webkit-scrollbar-thumb
background: darken($pale-yellow, 10)
#web_bg
background: none

View File

@@ -1,74 +1,61 @@
.relatedPosts .relatedPosts
margin: 0 auto
margin-top: 1rem margin-top: 1rem
padding: 0
width: 100%
.relatedPosts_item .relatedPosts_headline
position: relative margin-bottom: 5px
float: left font-weight: 700
overflow: hidden font-size: 20px
margin: 5px
width: calc(100% / 3 - 10px)
height: 200px
background: $dark-black
&:hover .relatedPosts_item
.relatedPosts_cover position: relative
opacity: .8 float: left
transform: scale(1.1)
a
text-decoration: none
.relatedPosts_cover
position: absolute
display: block
margin: 0
padding: 0
width: 100%
height: 100%
border: 0
opacity: .4
transition: all .6s
object-fit: cover
.relatedPosts_main
position: relative
display: flex
flex-direction: column
justify-content: center
margin: 0
padding: 0 1rem
height: 100%
color: $white
.relatedPosts_date
display: block
color: alpha($white, .9)
font-size: 90%
.relatedPosts_title
display: -webkit-box
overflow: hidden overflow: hidden
max-height: 60px margin: 5px
-webkit-line-clamp: 2 width: calc(100% / 3 - 10px)
-webkit-box-orient: vertical height: 200px
background: $dark-black
.relatedPosts_headline &:hover
margin-bottom: 5px .relatedPosts_cover
font-weight: 700 opacity: .8
font-size: 20px transform: scale(1.1)
.clear_both .relatedPosts_cover
clear: both width: 100%
height: 100%
opacity: .4
transition: all .6s
object-fit: cover
.relatedPosts_main
position: absolute
top: 50%
padding: 0 1rem
width: 100%
color: $white
transform: translate(0, -50%)
.relatedPosts_date
color: $light-grey
font-size: 90%
.relatedPosts_title
display: -webkit-box
overflow: hidden
-webkit-line-clamp: 2
-webkit-box-orient: vertical
.clear_both
clear: both
@media screen and (max-width: 768px) @media screen and (max-width: 768px)
.relatedPosts_item .relatedPosts
margin: 2px .relatedPosts_item
width: calc(100% / 2 - 4px) margin: 2px
height: 150px width: calc(100% / 2 - 4px)
height: 150px
@media screen and (max-width: 480px) @media screen and (max-width: 480px)
.relatedPosts_item .relatedPosts
width: calc(100% - 4px) .relatedPosts_item
width: calc(100% - 4px)

View File

@@ -9,7 +9,7 @@
display: inline-block display: inline-block
width: 100px width: 100px
background: $light-blue background: $light-blue
color: $white color: $button-color
text-align: center text-align: center
line-height: 36px line-height: 36px
cursor: pointer cursor: pointer
@@ -34,7 +34,7 @@
padding: 20px 10px 8px padding: 20px 10px 8px
width: 320px width: 320px
border-radius: 4px border-radius: 4px
background: #f5f5f5 background: $reward-pop-up-bg
&:before &:before
position: absolute position: absolute
@@ -52,7 +52,7 @@
margin: 0 auto margin: 0 auto
width: 0 width: 0
height: 0 height: 0
border-top: 13px solid #f5f5f5 border-top: 13px solid $reward-pop-up-bg
border-right: 13px solid transparent border-right: 13px solid transparent
border-left: 13px solid transparent border-left: 13px solid transparent
content: '' content: ''
@@ -70,5 +70,5 @@
.post-qr-code__desc .post-qr-code__desc
margin: -5px 0 margin: -5px 0
color: #858585 color: $reward-pop-up-color
text-align: center text-align: center

View File

@@ -24,15 +24,14 @@
width: 30px width: 30px
height: 30px height: 30px
background-color: $light-blue background-color: $light-blue
color: $white color: $button-color
text-align: center text-align: center
text-decoration: none
font-size: 16px font-size: 16px
line-height: 29px line-height: 29px
cursor: pointer cursor: pointer
&:hover &:hover
background-color: $ruby background-color: $theme-button-hover-color
#rightside_config #rightside_config
i i

Some files were not shown because too many files have changed in this diff Show More