mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa8c509b96 | ||
|
|
0ad2c01fc9 | ||
|
|
a0655a37c8 | ||
|
|
e8a47d040a | ||
|
|
250181c569 | ||
|
|
91d285391d | ||
|
|
92111f3c32 | ||
|
|
6cf59387c8 | ||
|
|
13a0a4af8e | ||
|
|
0d56db50e4 | ||
|
|
dad6fdbcc3 | ||
|
|
796b8e6df4 | ||
|
|
8953e2e1aa | ||
|
|
b512eb761d | ||
|
|
84efd46404 | ||
|
|
d62ec1b866 | ||
|
|
e81a81c9d1 | ||
|
|
6c68ce1c4c | ||
|
|
eb11e4afeb | ||
|
|
5e37ab641a | ||
|
|
16a3ac510d | ||
|
|
0ba52293a2 | ||
|
|
ce72ba4f5d | ||
|
|
c118e1e16a | ||
|
|
67c013d6e7 | ||
|
|
8bf11ddeb0 | ||
|
|
ddff0348b7 | ||
|
|
321091befb | ||
|
|
9c996d0a73 | ||
|
|
748709f56f | ||
|
|
1ef2720c2c | ||
|
|
d85f71887b | ||
|
|
9bb7c2bb99 | ||
|
|
c40db692bf | ||
|
|
eec30fd6be | ||
|
|
24269f457e | ||
|
|
c002fd0e64 | ||
|
|
ae717bd304 | ||
|
|
894c709b3c | ||
|
|
d59ed0b401 | ||
|
|
96ef1478ef | ||
|
|
43b109bdb6 | ||
|
|
995fc7cf9d | ||
|
|
e77ab81941 | ||
|
|
eae694806c | ||
|
|
90726f1a59 | ||
|
|
ae73a2114f | ||
|
|
20dcc61e0d | ||
|
|
f36450dbc0 | ||
|
|
2fc895102d | ||
|
|
e26637c5a8 | ||
|
|
082df56112 | ||
|
|
27adaecf51 | ||
|
|
a33e7e1d89 | ||
|
|
da4a8d77d7 | ||
|
|
8cb366bdda | ||
|
|
7f8e431226 | ||
|
|
b32ff6920b | ||
|
|
25f128fb3d | ||
|
|
9e14fca4a7 | ||
|
|
336e221de5 | ||
|
|
32d1cd3f53 | ||
|
|
1e06a6ca5e | ||
|
|
6c26f20427 | ||
|
|
dc65869042 | ||
|
|
2b90e15596 | ||
|
|
2eb15123f9 | ||
|
|
eecfaaf124 | ||
|
|
05766e396f | ||
|
|
94c51b5d04 | ||
|
|
f6d70e5863 | ||
|
|
3d09a9331b | ||
|
|
51288ec8b6 |
52
.github/ISSUE_TEMPLATE.md
vendored
Normal file
52
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<!--
|
||||||
|
IMPORTANT: Please follow the template to create a new issue.
|
||||||
|
重要:請依照該模板來提交。
|
||||||
|
|
||||||
|
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
|
||||||
|
如果你是由舊版本升級到新版,運行時出現報錯,請首先把config裏新的內容複製到舊的butterfly設置去
|
||||||
|
|
||||||
|
If you are a problem when visit the website, please open your browser 'developer tools (shortcut F12)' and check the console if there is an error, include your website address in the feedback
|
||||||
|
如果你是線上訪問出現問題,請檢查瀏覽器‘開發人員工具(快捷鍵F12)’的console是否有報錯,反饋時附上你的網站
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## I want to create a new issue <!-- 我想要建立一個新的issue -->
|
||||||
|
|
||||||
|
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->
|
||||||
|
<!-- 請確認是否都已經翻閱過如下的資料, 尤其是安裝文檔!! -->
|
||||||
|
- [] Yes, I have read [Hexo Docs page](https://hexo.io/docs/), especially [Templates](https://hexo.io/docs/templates.html), [Variables](https://hexo.io/docs/variables.html), [Helpers](https://hexo.io/docs/helpers.html) and [Troubleshooting](https://hexo.io/docs/troubleshooting.html).
|
||||||
|
- [] Yes, I have read [Hexo-theme-butterfly Documentation](https://jerryc.me/posts/21cfbf15/).
|
||||||
|
- [] And yes, I already searched for current [issues](https://github.com/jerryc127/hexo-theme-butterfly/issues?utf8=%E2%9C%93&q=is%3Aissue) and this did not help me.
|
||||||
|
|
||||||
|
## Butterfly Information
|
||||||
|
|
||||||
|
<!-- Butterfly的版本 -->
|
||||||
|
<!-- 檢視主題的package.json -->
|
||||||
|
**Butterfly Version:**
|
||||||
|
|
||||||
|
<!-- Windows/macOS/Linux/Android/iOS -->
|
||||||
|
**Platform:**
|
||||||
|
|
||||||
|
<!-- Chrome/Safari/FireFox/.. -->
|
||||||
|
**Browser:**
|
||||||
|
|
||||||
|
## Expected behavior <!-- (預期行為) -->
|
||||||
|
|
||||||
|
## Actual behavior <!-- (實際行為) -->
|
||||||
|
|
||||||
|
<!-- Please give me the screenshots to locate the issue -->
|
||||||
|
<!-- 請儘量提供截圖來定位問題 -->
|
||||||
|
|
||||||
|
## Steps to reproduce the behavior <!-- (重現步驟) -->
|
||||||
|
|
||||||
|
## Feature Request
|
||||||
|
|
||||||
|
<!-- If you have any ideas of theme-butterfly, please write down here and we can have a discussion. -->
|
||||||
|
<!-- 如果你有任何關於Butterfly的功能方面的想法,可以在這個部分裡寫下來我們一起討論 -->
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Love hexo-theme-butterfly? Please consider starring the repo to support it!
|
||||||
|
喜歡 hexo-theme-butterfly嗎? 考慮一下給它點個star來支援它吧!
|
||||||
|
-->
|
||||||
21
.github/stale.yml
vendored
Normal file
21
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 30
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
- bug
|
||||||
|
- enhancement
|
||||||
|
- Solved
|
||||||
|
- documentation
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: wontfix
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
||||||
51
README.md
51
README.md
@@ -1,37 +1,54 @@
|
|||||||
# hexo-theme-butterfly
|
# hexo-theme-butterfly
|
||||||
|
|
||||||
[预览](https://jerryc.me/)
|
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></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-4.0+-0e83c"/></a>
|
||||||
|
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||||
|
|
||||||
一款基于[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主题
|
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||||
|
|
||||||
## 安装
|
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
||||||
|
|
||||||
在你的博客根目录里
|
## Installation
|
||||||
|
|
||||||
|
Stable branch [recommend]:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
```
|
```
|
||||||
|
|
||||||
如果想要安裝比較新的dev分支,可以
|
Dev branch:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
```
|
```
|
||||||
|
|
||||||
## 应用主题
|
## Configuration
|
||||||
修改hexo配置文件`_config.yml`,把主题改为`Butterfly`
|
|
||||||
|
|
||||||
```
|
Set theme in the hexo work folder's root config file `_config.yml`:
|
||||||
theme: Butterfly
|
|
||||||
```
|
|
||||||
|
|
||||||
>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-jade hexo-renderer-stylus --save or yarn add hexo-renderer-jade hexo-renderer-stylus
|
> theme: butterfly
|
||||||
|
|
||||||
## 文档
|
If you don't have pug & stylus renderer, try this:
|
||||||
|
|
||||||
可查看或[这里](https://docs.jerryc.me/)或[这里](https://jerryc.me/posts/21cfbf15)
|
> npm install hexo-renderer-pug hexo-renderer-stylus
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
Find in [Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/). it supports `zh-TW` and `zh-CN`
|
||||||
|
|
||||||
|
You can also join the Chat Group.
|
||||||
|
|
||||||
|
[💬 Join QQ Group [recommend]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||||
|
|
||||||
|
[💬 Join Telegram Group](https://t.me/hexo_butterfly)
|
||||||
|
|
||||||
|
|
||||||
## 截图
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
50
README_CN.md
Normal file
50
README_CN.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# hexo-theme-butterfly
|
||||||
|
|
||||||
|
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></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-4.0+-0e83c"/></a>
|
||||||
|
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||||
|
|
||||||
|
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||||
|
|
||||||
|
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
||||||
|
|
||||||
|
## 安裝
|
||||||
|
|
||||||
|
在你的博客根目錄裡安裝穩定版【推薦】
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
|
```
|
||||||
|
|
||||||
|
如果想要安裝比較新的dev分支,可以
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
|
||||||
|
```
|
||||||
|
|
||||||
|
## 應用主題
|
||||||
|
修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
|
||||||
|
|
||||||
|
```
|
||||||
|
theme: butterfly
|
||||||
|
```
|
||||||
|
|
||||||
|
>如果你沒有pug以及stylus的渲染器,請下載安裝: npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus
|
||||||
|
|
||||||
|
## 文檔
|
||||||
|
|
||||||
|
可查看[Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/)
|
||||||
|
|
||||||
|
你也可以加入群組
|
||||||
|
|
||||||
|
[ 💬 QQ群 [推薦]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||||
|
|
||||||
|
[ 💬 Telegram群](https://t.me/hexo_butterfly)
|
||||||
|
|
||||||
|
## 截圖
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
883
_config.yml
883
_config.yml
File diff suppressed because it is too large
Load Diff
@@ -19,25 +19,26 @@ page:
|
|||||||
|
|
||||||
sticky: Sticky
|
sticky: Sticky
|
||||||
no_title: No title
|
no_title: No title
|
||||||
archives: Archives
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: Created
|
created: Created
|
||||||
updated: Updated
|
updated: Updated
|
||||||
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
|
||||||
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: Related Articles
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
hits_empty: "We didn't find any results for the search: ${query}."
|
hits_empty: "We didn't find any results for the search: ${query}."
|
||||||
hits_stats: "${hits} results found in ${time} ms"
|
hits_stats: '${hits} results found in ${time} ms'
|
||||||
|
|
||||||
local_search:
|
local_search:
|
||||||
label: Local search
|
label: Local search
|
||||||
@@ -60,27 +61,51 @@ aside:
|
|||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
card_bookmark: Add to bookmark
|
card_bookmark: Bookmark
|
||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: Info
|
headline: Info
|
||||||
article_name: Article
|
article_name: Article
|
||||||
runtime_name: Run time
|
runtime_name: Run time
|
||||||
|
site_wordcount: Total Count
|
||||||
site_uv_name: UV
|
site_uv_name: UV
|
||||||
site_pv_name: PV
|
site_pv_name: PV
|
||||||
|
more_button: More
|
||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
|
|
||||||
bookmark:
|
bookmark:
|
||||||
title: Bookmark
|
title: Bookmark
|
||||||
message_prev: Press
|
|
||||||
message_next: to bookmark this page
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: Read Mode
|
readmode_title: Read Mode
|
||||||
font_plus_title: Increase font size
|
font_plus_title: Increase Font Size
|
||||||
font_minus_title: Decrease font size
|
font_minus_title: Decrease Font Size
|
||||||
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
translate_title: Switch Between Traditional Chinese And Simplified Chinese
|
||||||
night_mode_title: Dark Mode
|
night_mode_title: Switch Between Light And Dark Mode
|
||||||
|
back_to_top: Back To Top
|
||||||
|
toc: Table Of Contents
|
||||||
|
scroll_to_comment: Scroll To Comments
|
||||||
|
setting: Setting
|
||||||
|
|
||||||
runtime_unit: days
|
runtime_unit: days
|
||||||
|
|
||||||
|
copy_copyright:
|
||||||
|
author: Author
|
||||||
|
link: Link
|
||||||
|
source: Source
|
||||||
|
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: Press
|
||||||
|
message_next: to bookmark this page
|
||||||
|
chs_to_cht: Traditional Chinese Activated Manually
|
||||||
|
cht_to_chs: Simplified Chinese Activated Manually
|
||||||
|
day_to_night: Dark Mode Activated Manually
|
||||||
|
night_to_day: Light Mode Activated Manually
|
||||||
|
|
||||||
|
loading: Loading...
|
||||||
|
|
||||||
|
error404:
|
||||||
|
error_title: Page not found
|
||||||
|
back_button: Go back home
|
||||||
|
|||||||
@@ -19,25 +19,26 @@ page:
|
|||||||
|
|
||||||
sticky: Sticky
|
sticky: Sticky
|
||||||
no_title: No title
|
no_title: No title
|
||||||
archives: Archives
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: Created
|
created: Created
|
||||||
updated: Updated
|
updated: Updated
|
||||||
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
|
||||||
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: Related Articles
|
||||||
|
|
||||||
search: Search
|
search: Search
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: Search for Posts
|
input_placeholder: Search for Posts
|
||||||
hits_empty: "We didn't find any results for the search: ${query}."
|
hits_empty: "We didn't find any results for the search: ${query}."
|
||||||
hits_stats: "${hits} results found in ${time} ms"
|
hits_stats: '${hits} results found in ${time} ms'
|
||||||
|
|
||||||
local_search:
|
local_search:
|
||||||
label: Local search
|
label: Local search
|
||||||
@@ -60,26 +61,51 @@ aside:
|
|||||||
card_tags: Tags
|
card_tags: Tags
|
||||||
card_archives: Archives
|
card_archives: Archives
|
||||||
card_recent_post: Recent Post
|
card_recent_post: Recent Post
|
||||||
card_bookmark: Add to bookmark
|
card_bookmark: Bookmark
|
||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: Info
|
headline: Info
|
||||||
article_name: Article
|
article_name: Article
|
||||||
runtime_name: Run time
|
runtime_name: Run time
|
||||||
|
site_wordcount: Total Count
|
||||||
site_uv_name: UV
|
site_uv_name: UV
|
||||||
site_pv_name: PV
|
site_pv_name: PV
|
||||||
|
more_button: More
|
||||||
|
|
||||||
donate: Donate
|
donate: Donate
|
||||||
share: Share
|
share: Share
|
||||||
bookmark:
|
bookmark:
|
||||||
title: Bookmark
|
title: Bookmark
|
||||||
message_prev: Press
|
|
||||||
message_next: to bookmark this page
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: Read Mode
|
readmode_title: Read Mode
|
||||||
font_plus_title: Increase font size
|
font_plus_title: Increase Font Size
|
||||||
font_minus_title: Decrease font size
|
font_minus_title: Decrease Font Size
|
||||||
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
translate_title: Switch Between Traditional Chinese And Simplified Chinese
|
||||||
night_mode_title: Dark Mode
|
night_mode_title: Switch Between Light And Dark Mode
|
||||||
|
back_to_top: Back To Top
|
||||||
|
toc: Table Of Contents
|
||||||
|
scroll_to_comment: Scroll To Comments
|
||||||
|
setting: Setting
|
||||||
|
|
||||||
runtime_unit: days
|
runtime_unit: days
|
||||||
|
|
||||||
|
copy_copyright:
|
||||||
|
author: Author
|
||||||
|
link: Link
|
||||||
|
source: Source
|
||||||
|
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: Press
|
||||||
|
message_next: to bookmark this page
|
||||||
|
chs_to_cht: Traditional Chinese Activated Manually
|
||||||
|
cht_to_chs: Simplified Chinese Activated Manually
|
||||||
|
day_to_night: Dark Mode Activated Manually
|
||||||
|
night_to_day: Light Mode Activated Manually
|
||||||
|
|
||||||
|
loading: Loading...
|
||||||
|
|
||||||
|
error404:
|
||||||
|
error_title: Page not found
|
||||||
|
back_button: Go back home
|
||||||
|
|||||||
@@ -19,31 +19,33 @@ page:
|
|||||||
|
|
||||||
sticky: 置顶
|
sticky: 置顶
|
||||||
no_title: 无题
|
no_title: 无题
|
||||||
archives: 时间轴
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: 发表于
|
created: 发表于
|
||||||
updated: 更新于
|
updated: 更新于
|
||||||
wordcount: 字数总计
|
wordcount: 字数总计
|
||||||
min2read: "阅读时长: %s 分钟"
|
min2read: '阅读时长: %s 分钟'
|
||||||
page_pv: 阅读量
|
page_pv: 阅读量
|
||||||
|
comments: 评论数
|
||||||
copyright:
|
copyright:
|
||||||
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:
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜索文章
|
||||||
hits_empty: "找不到您查询的内容:${query}"
|
hits_empty: '找不到您查询的内容:${query}'
|
||||||
hits_stats: "找到 ${hits} 条结果,用时 ${time} 毫秒"
|
hits_stats: '找到 ${hits} 条结果,用时 ${time} 毫秒'
|
||||||
|
|
||||||
local_search:
|
local_search:
|
||||||
label: 本地搜索
|
label: 本地搜索
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜索文章
|
||||||
hits_empty: "找不到您查询的内容:${query}"
|
hits_empty: '找不到您查询的内容:${query}'
|
||||||
powered: "提供支持"
|
powered: '提供支持'
|
||||||
by: 由
|
by: 由
|
||||||
|
|
||||||
pagination:
|
pagination:
|
||||||
@@ -66,21 +68,47 @@ aside:
|
|||||||
headline: 网站资讯
|
headline: 网站资讯
|
||||||
article_name: 文章数目
|
article_name: 文章数目
|
||||||
runtime_name: 已运行时间
|
runtime_name: 已运行时间
|
||||||
|
site_wordcount: 本站总字数
|
||||||
site_uv_name: 本站访客数
|
site_uv_name: 本站访客数
|
||||||
site_pv_name: 本站总访问量
|
site_pv_name: 本站总访问量
|
||||||
|
more_button: 查看更多
|
||||||
|
|
||||||
donate: 打赏
|
donate: 打赏
|
||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加书签
|
title: 添加书签
|
||||||
message_prev: 按
|
|
||||||
message_next: 键将本页加入书签
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 阅读模式
|
readmode_title: 阅读模式
|
||||||
font_plus_title: 放大字体
|
font_plus_title: 放大字体
|
||||||
font_minus_title: 缩小字体
|
font_minus_title: 缩小字体
|
||||||
translate_title: 简繁转换
|
translate_title: 简繁转换
|
||||||
night_mode_title: 夜间模式
|
night_mode_title: 浅色和深色模式转换
|
||||||
|
back_to_top: 回到顶部
|
||||||
|
toc: 目录
|
||||||
|
scroll_to_comment: 直达评论
|
||||||
|
setting: 设置
|
||||||
|
|
||||||
runtime_unit: 天
|
runtime_unit: 天
|
||||||
|
|
||||||
|
copy_copyright:
|
||||||
|
author: 作者
|
||||||
|
link: 链接
|
||||||
|
source: 来源
|
||||||
|
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 键将本页加入书签
|
||||||
|
chs_to_cht: 你已切换为繁体
|
||||||
|
cht_to_chs: 你已切换为简体
|
||||||
|
day_to_night: 你已切换为深色模式
|
||||||
|
night_to_day: 你已切换为浅色模式
|
||||||
|
|
||||||
|
error_title: 页面没有找到
|
||||||
|
loading: 加载中...
|
||||||
|
|
||||||
|
error404:
|
||||||
|
error_title: 页面没有找到
|
||||||
|
back_button: 回到主页
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ footer:
|
|||||||
copy:
|
copy:
|
||||||
success: 複製成功
|
success: 複製成功
|
||||||
error: 複製錯誤
|
error: 複製錯誤
|
||||||
noSupport: 瀏覽器不支持
|
noSupport: 瀏覽器不支援
|
||||||
|
|
||||||
page:
|
page:
|
||||||
articles: 文章總覽
|
articles: 文章總覽
|
||||||
@@ -19,32 +19,33 @@ page:
|
|||||||
|
|
||||||
sticky: 置頂
|
sticky: 置頂
|
||||||
no_title: 無題
|
no_title: 無題
|
||||||
archives: 時間軸
|
|
||||||
|
|
||||||
post:
|
post:
|
||||||
created: 發表於
|
created: 發表於
|
||||||
updated: 更新於
|
updated: 更新於
|
||||||
wordcount: 字數總計
|
wordcount: 字數總計
|
||||||
min2read: "閲讀時長: %s 分鐘"
|
min2read: '閱讀時長: %s 分鐘'
|
||||||
page_pv: 閲讀量
|
page_pv: 閱讀量
|
||||||
|
comments: 評論數
|
||||||
copyright:
|
copyright:
|
||||||
author: 文章作者
|
author: 文章作者
|
||||||
link: 文章鏈接
|
link: 文章連結
|
||||||
copyright_notice: 版權聲明
|
copyright_notice: 版權聲明
|
||||||
copyright_content: '本博客所有文章除特別聲明外,均採用
|
copyright_content: '本部落格所有文章除特別聲明外,均採用
|
||||||
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
||||||
|
recommend: 相關推薦
|
||||||
|
|
||||||
search: 搜索
|
search: 搜尋
|
||||||
algolia_search:
|
algolia_search:
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜尋文章
|
||||||
hits_empty: "找不到您查詢的內容:${query}"
|
hits_empty: '找不到您查詢的內容:${query}'
|
||||||
hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
|
hits_stats: '找到 ${hits} 條結果,用時 ${time} 毫秒'
|
||||||
|
|
||||||
local_search:
|
local_search:
|
||||||
label: 本地搜索
|
label: 本地搜尋
|
||||||
input_placeholder: 搜索文章
|
input_placeholder: 搜尋文章
|
||||||
hits_empty: "找不到您查詢的內容:${query}"
|
hits_empty: '找不到您查詢的內容:${query}'
|
||||||
powered: "提供支持"
|
powered: '提供支援'
|
||||||
by: 由
|
by: 由
|
||||||
|
|
||||||
pagination:
|
pagination:
|
||||||
@@ -66,22 +67,47 @@ aside:
|
|||||||
card_webinfo:
|
card_webinfo:
|
||||||
headline: 網站資訊
|
headline: 網站資訊
|
||||||
article_name: 文章數目
|
article_name: 文章數目
|
||||||
runtime_name: 已運行時間
|
runtime_name: 已執行時間
|
||||||
|
site_wordcount: 本站總字數
|
||||||
site_uv_name: 本站訪客數
|
site_uv_name: 本站訪客數
|
||||||
site_pv_name: 本站總訪問量
|
site_pv_name: 本站總訪問量
|
||||||
|
more_button: 檢視更多
|
||||||
|
|
||||||
donate: 打賞
|
donate: 打賞
|
||||||
share: 分享
|
share: 分享
|
||||||
bookmark:
|
bookmark:
|
||||||
title: 添加書籤
|
title: 新增書籤
|
||||||
message_prev: 按
|
|
||||||
message_next: 鍵將本頁加入書籤
|
|
||||||
|
|
||||||
rightside:
|
rightside:
|
||||||
readmode_title: 閲讀模式
|
readmode_title: 閱讀模式
|
||||||
font_plus_title: 放大字體
|
font_plus_title: 放大字型
|
||||||
font_minus_title: 縮小字體
|
font_minus_title: 縮小字型
|
||||||
translate_title: 簡繁轉換
|
translate_title: 簡繁轉換
|
||||||
night_mode_title: 夜間模式
|
night_mode_title: 淺色和深色模式轉換
|
||||||
|
back_to_top: 回到頂部
|
||||||
|
toc: 目錄
|
||||||
|
scroll_to_comment: 直達評論
|
||||||
|
setting: 設定
|
||||||
|
|
||||||
runtime_unit: 天
|
runtime_unit: 天
|
||||||
|
|
||||||
|
copy_copyright:
|
||||||
|
author: 作者
|
||||||
|
link: 連結
|
||||||
|
source: 來源
|
||||||
|
info: 著作權歸作者所有。商業轉載請聯絡作者獲得授權,非商業轉載請註明出處。
|
||||||
|
|
||||||
|
Snackbar:
|
||||||
|
bookmark:
|
||||||
|
message_prev: 按
|
||||||
|
message_next: 鍵將本頁加入書籤
|
||||||
|
chs_to_cht: 你已切換為繁體
|
||||||
|
cht_to_chs: 你已切換為簡體
|
||||||
|
day_to_night: 你已切換為深色模式
|
||||||
|
night_to_day: 你已切換為淺色模式
|
||||||
|
|
||||||
|
loading: 載入中...
|
||||||
|
|
||||||
|
error404:
|
||||||
|
error_title: 頁面沒有找到
|
||||||
|
back_button: 回到主頁
|
||||||
|
|||||||
30
layout/404.pug
Normal file
30
layout/404.pug
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
- var top_img = theme.error_404.background || theme.default_top_img
|
||||||
|
- var bg_img = `background-image: url(${url_for(top_img)})`
|
||||||
|
|
||||||
|
doctype html
|
||||||
|
html(lang=config.language data-theme=theme.display_mode)
|
||||||
|
head
|
||||||
|
include includes/head.pug
|
||||||
|
body
|
||||||
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
if theme.fireworks && theme.fireworks.enable
|
||||||
|
canvas.fireworks
|
||||||
|
|
||||||
|
if theme.background
|
||||||
|
- var is_photo = theme.background.startsWith('url') ? 'photo':'color'
|
||||||
|
#web_bg(data-type=is_photo)
|
||||||
|
|
||||||
|
#error-wrap
|
||||||
|
.error-content
|
||||||
|
.error-img(style=bg_img)
|
||||||
|
.error-info
|
||||||
|
h1.error_title= '404'
|
||||||
|
.error_subtitle= theme.error_404.subtitle
|
||||||
|
a.button--animated(href=url_for(config.root))
|
||||||
|
i.fas.fa-rocket
|
||||||
|
= _p('error404.back_button')
|
||||||
|
|
||||||
|
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||||
|
include includes/additional-js.pug
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
@@ -7,5 +6,3 @@ block content
|
|||||||
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
||||||
+articleSort(page.posts)
|
+articleSort(page.posts)
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/aside.pug
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
if theme.category_ui == 'index'
|
||||||
|
include ./includes/mixins/post-ui.pug
|
||||||
|
#recent-posts.recent-posts.category_ui
|
||||||
|
+postUI
|
||||||
|
include includes/pagination.pug
|
||||||
|
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/aside.pug
|
|
||||||
|
|
||||||
@@ -1,31 +1,23 @@
|
|||||||
.flink
|
#page
|
||||||
|
.flink#article-container
|
||||||
|
if site.data.link
|
||||||
each i in site.data.link
|
each i in site.data.link
|
||||||
p.comment-word= i.class_name
|
if i.class_name
|
||||||
.post-cards
|
h2!= i.class_name
|
||||||
ul.md-links
|
if i.class_desc
|
||||||
|
.flink-desc!=i.class_desc
|
||||||
|
.flink-list
|
||||||
each item in i.link_list
|
each item in i.link_list
|
||||||
li.md-links-item
|
.flink-list-item
|
||||||
a(href=item.link title=item.name target="_blank")
|
a(href=url_for(item.link) title=item.name target="_blank")
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.lozad(data-src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
img(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||||
else
|
else
|
||||||
img(src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||||
div(class="md-links-title")= item.name
|
.flink-item-name= item.name
|
||||||
<br/>
|
.flink-item-desc= item.descr
|
||||||
div(class="md-links-des")=item.descr
|
!= page.content
|
||||||
|
if page.comments !== false
|
||||||
hr
|
include includes/comments/index.pug
|
||||||
div
|
|
||||||
p(style="font-size:15px;font-weight:bold")= theme.Flink.info_headline
|
|
||||||
ul
|
|
||||||
li= theme.Flink.name
|
|
||||||
li= theme.Flink.address
|
|
||||||
li= theme.Flink.avatar
|
|
||||||
li= theme.Flink.info
|
|
||||||
|
|
||||||
hr
|
|
||||||
.comment_int
|
|
||||||
p.comment-word= theme.Flink.comment
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
extends includes/layout.pug
|
|
||||||
|
|
||||||
block content
|
|
||||||
include includes/gallery/layout.pug
|
|
||||||
@@ -1,20 +1,24 @@
|
|||||||
if (theme.algolia_search.enable)
|
script(src=url_for(theme.CDN.jquery))
|
||||||
script(async src=url_for('/js/search/algolia.js'))
|
script(src=url_for(theme.CDN.utils))
|
||||||
if (theme.mathjax && theme.mathjax.enable)
|
script(src=url_for(theme.CDN.main))
|
||||||
if(!is_tag() && !is_category() && !is_archive())
|
|
||||||
include ./third-party/mathjax.pug
|
if theme.translate && theme.translate.enable
|
||||||
if (theme.katex && theme.katex.enable)
|
script(src=url_for(theme.CDN.translate))
|
||||||
if(!is_tag() && !is_category() && !is_archive())
|
|
||||||
include ./third-party/katex.pug
|
if theme.medium_zoom
|
||||||
if (theme.local_search && theme.local_search.enable)
|
script(src=url_for(theme.CDN.medium_zoom))
|
||||||
script(async src=url_for('/js/search/local-search.js'))
|
|
||||||
|
if theme.fancybox
|
||||||
|
script(src=url_for(theme.CDN.fancybox))
|
||||||
|
|
||||||
|
include ./math/index.pug
|
||||||
|
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
script(src='https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js')
|
script(src=url_for(theme.CDN.anime))
|
||||||
script(src=url_for('/js/third-party/fireworks.js'))
|
script(src=url_for(theme.CDN.fireworks))
|
||||||
|
|
||||||
if theme.nightshift.enable
|
if (theme.snackbar && theme.snackbar.enable)
|
||||||
script(src=url_for('js/nightshift.js'))
|
script(src=url_for(theme.CDN.snackbar))
|
||||||
|
|
||||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||||
include ./third-party/canvas-ribbon.pug
|
include ./third-party/canvas-ribbon.pug
|
||||||
@@ -25,77 +29,48 @@ if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
|||||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||||
include ./third-party/canvas-nest.pug
|
include ./third-party/canvas-nest.pug
|
||||||
|
|
||||||
if theme.baidu_push && theme.baidu_push.enable
|
|
||||||
script(src=url_for('js/baidupush.js'))
|
|
||||||
|
|
||||||
if theme.activate_power_mode.enable
|
if theme.activate_power_mode.enable
|
||||||
script(src=url_for('js/activate-power-mode.js'))
|
script(src=url_for(theme.CDN.activate_power_mode))
|
||||||
script.
|
script.
|
||||||
POWERMODE.colorful = true; // make power mode colorful
|
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||||
POWERMODE.shake = true; // turn off shake
|
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||||
document.body.addEventListener('input', POWERMODE);
|
document.body.addEventListener('input', POWERMODE);
|
||||||
|
|
||||||
if theme.translate && theme.translate.enable
|
|
||||||
script(src=url_for('/js/tw_cn.js'))
|
|
||||||
script.
|
|
||||||
translateInitilization()
|
|
||||||
|
|
||||||
|
|
||||||
if is_home() && theme.subtitle.enable
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
|
||||||
script.
|
|
||||||
var typed = new Typed(".subtitle", {
|
|
||||||
strings: ['!{theme.subtitle.sub1}','!{theme.subtitle.sub2}'],
|
|
||||||
startDelay: 300,
|
|
||||||
typeSpeed: 100,
|
|
||||||
loop: true,
|
|
||||||
backSpeed: 50
|
|
||||||
});
|
|
||||||
|
|
||||||
if is_home()
|
|
||||||
script.
|
|
||||||
//首頁fullpage
|
|
||||||
function alignContent() {
|
|
||||||
for (var n = $(window).height(), e = document.querySelectorAll(".full_page"), i = 0; i < e.length; i++)
|
|
||||||
e[i].style.height = n + "px";
|
|
||||||
$("#site-info").each(function () {
|
|
||||||
var x = $(this).height();
|
|
||||||
$(this).css("top", (n-x)/2)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function recent_post_padding() {
|
|
||||||
$(".recent-post-info").each(function () {
|
|
||||||
var k = $(".recent-post-item").height();
|
|
||||||
var e = $(this).height();
|
|
||||||
$(this).css({"padding-top": (k-e)/2 , "padding-bottom": (k-e)/2 })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
alignContent();
|
|
||||||
|
|
||||||
//recent-post-item垂直置中
|
|
||||||
if ($(window).width() > 768) {
|
|
||||||
recent_post_padding();
|
|
||||||
}
|
|
||||||
|
|
||||||
$(window).bind("resize", function () {
|
|
||||||
|
|
||||||
alignContent()
|
|
||||||
|
|
||||||
if ($(window).width() > 768) {
|
|
||||||
recent_post_padding();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
script(async src=url_for(theme.CDN.busuanzi))
|
||||||
|
|
||||||
if theme.instantpage.enable
|
if theme.instantpage
|
||||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
||||||
|
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
script(src=url_for(theme.lazyload.script))
|
script(src=url_for(theme.CDN.lazyload) async)
|
||||||
script.
|
|
||||||
const observer = lozad(); // lazy loads elements with default selector as '.lozad'
|
//- 鼠標特效
|
||||||
observer.observe();
|
if theme.click_heart
|
||||||
|
script(src=url_for(theme.CDN.click_heart))
|
||||||
|
|
||||||
|
if theme.ClickShowText && theme.ClickShowText.enable
|
||||||
|
script(src=url_for(theme.CDN.ClickShowText))
|
||||||
|
|
||||||
|
if theme.pangu && theme.pangu.enable
|
||||||
|
include ./third-party/pangu.pug
|
||||||
|
|
||||||
|
//- search
|
||||||
|
if theme.algolia_search && theme.algolia_search.enable
|
||||||
|
script(src=url_for(theme.CDN.algolia_js))
|
||||||
|
else if theme.local_search && theme.local_search.enable
|
||||||
|
script(src=url_for(theme.CDN.local_search))
|
||||||
|
|
||||||
|
//- mermaid
|
||||||
|
if theme.mermaid.enable
|
||||||
|
include ./math/mermaid.pug
|
||||||
|
|
||||||
|
if is_home()
|
||||||
|
include ./head/subtitle.pug
|
||||||
|
|
||||||
|
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||||
|
|
||||||
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
if theme.aside.card_author
|
|
||||||
include widget/card_author.pug
|
|
||||||
|
|
||||||
if theme.aside.card_announcement
|
|
||||||
include widget/card_announcement.pug
|
|
||||||
|
|
||||||
if theme.aside.card_recent_post
|
|
||||||
include widget/card_recent_post.pug
|
|
||||||
|
|
||||||
if theme.aside.card_categories
|
|
||||||
include widget/card_categories.pug
|
|
||||||
|
|
||||||
if theme.aside.card_tags
|
|
||||||
include widget/card_tags.pug
|
|
||||||
|
|
||||||
if theme.aside.card_archives
|
|
||||||
include widget/card_archives.pug
|
|
||||||
|
|
||||||
if theme.aside.card_webinfo
|
|
||||||
include widget/card_webinfo.pug
|
|
||||||
|
|
||||||
30
layout/includes/chat/chatra.pug
Normal file
30
layout/includes/chat/chatra.pug
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//- https://chatra.io/help/api/
|
||||||
|
script.
|
||||||
|
(function(d, w, c) {
|
||||||
|
w.ChatraID = '#{theme.chatra.id}';
|
||||||
|
var s = d.createElement('script');
|
||||||
|
w[c] = w[c] || function() {
|
||||||
|
(w[c].q = w[c].q || []).push(arguments);
|
||||||
|
};
|
||||||
|
s.async = true;
|
||||||
|
s.src = 'https://call.chatra.io/chatra.js';
|
||||||
|
if (d.head) d.head.appendChild(s);
|
||||||
|
})(document, window, 'Chatra');
|
||||||
|
|
||||||
|
if (!{theme.chat_btn}) {
|
||||||
|
var chatBtn = document.getElementById("chat_btn")
|
||||||
|
chatBtn.addEventListener("click", function(){
|
||||||
|
Chatra('openChat')
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (!{theme.chat_hide_show}) {
|
||||||
|
function chatBtnHide () {
|
||||||
|
Chatra('hide')
|
||||||
|
}
|
||||||
|
function chatBtnShow () {
|
||||||
|
Chatra('show')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
37
layout/includes/chat/daovoice.pug
Normal file
37
layout/includes/chat/daovoice.pug
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
//- https://guide.daocloud.io/daovoice/javascript-api-5869833.html
|
||||||
|
script.
|
||||||
|
(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/!{theme.daovoice.app_id}.js","daovoice")
|
||||||
|
|
||||||
|
script.
|
||||||
|
var isChatBtn = !{theme.chat_btn}
|
||||||
|
daovoice('init', {
|
||||||
|
app_id: '!{theme.daovoice.app_id}',},{
|
||||||
|
launcher: {
|
||||||
|
disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
|
||||||
|
},
|
||||||
|
});
|
||||||
|
daovoice('update');
|
||||||
|
|
||||||
|
if (isChatBtn) {
|
||||||
|
var chatBtn = document.getElementById("chat_btn")
|
||||||
|
chatBtn.addEventListener("click", function(){
|
||||||
|
daovoice('show')
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (!{theme.chat_hide_show}) {
|
||||||
|
function chatBtnHide () {
|
||||||
|
daovoice('update', {},{
|
||||||
|
launcher: {
|
||||||
|
disableLauncherIcon: true // 悬浮 ICON 是否显示
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function chatBtnShow () {
|
||||||
|
daovoice('update', {},{
|
||||||
|
launcher: {
|
||||||
|
disableLauncherIcon: false // 悬浮 ICON 是否显示
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
layout/includes/chat/gitter.pug
Normal file
28
layout/includes/chat/gitter.pug
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
//- https://sidecar.gitter.im/
|
||||||
|
script.
|
||||||
|
var isChatBtn = !{theme.chat_btn}
|
||||||
|
|
||||||
|
if (isChatBtn) {
|
||||||
|
((window.gitter = {}).chat = {}).options = {
|
||||||
|
room: '#{theme.gitter.room}',
|
||||||
|
activationElement: '#chat_btn'
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
((window.gitter = {}).chat = {}).options = {
|
||||||
|
room: '#{theme.gitter.room}',
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!{theme.chat_hide_show}) {
|
||||||
|
var gitterBtn = document.getElementsByClassName('gitter-open-chat-button')
|
||||||
|
|
||||||
|
function chatBtnHide () {
|
||||||
|
gitterBtn[0].style.display= 'none'
|
||||||
|
}
|
||||||
|
|
||||||
|
function chatBtnShow () {
|
||||||
|
gitterBtn[0].style.display= 'block'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||||
8
layout/includes/chat/index.pug
Normal file
8
layout/includes/chat/index.pug
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
if theme.chatra && theme.chatra.enable
|
||||||
|
include ./chatra.pug
|
||||||
|
else if theme.tidio && theme.tidio.enable
|
||||||
|
include ./tidio.pug
|
||||||
|
else if theme.daovoice && theme.daovoice.enable
|
||||||
|
include ./daovoice.pug
|
||||||
|
else if theme.gitter && theme.gitter.enable
|
||||||
|
include ./gitter.pug
|
||||||
39
layout/includes/chat/tidio.pug
Normal file
39
layout/includes/chat/tidio.pug
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
script(src=`//code.tidio.co/${theme.tidio.public_key}.js` async)
|
||||||
|
|
||||||
|
if theme.chat_btn
|
||||||
|
script.
|
||||||
|
(function() {
|
||||||
|
function onTidioChatApiReady() {
|
||||||
|
window.tidioChatApi.hide();
|
||||||
|
window.tidioChatApi.on("close", function() {
|
||||||
|
window.tidioChatApi.hide();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (window.tidioChatApi) {
|
||||||
|
window.tidioChatApi.on("ready", onTidioChatApiReady);
|
||||||
|
} else {
|
||||||
|
document.addEventListener("tidioChat-ready", onTidioChatApiReady);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("chat_btn").addEventListener("click", function(){
|
||||||
|
window.tidioChatApi.show();
|
||||||
|
window.tidioChatApi.open();
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
else if theme.chat_hide_show
|
||||||
|
script.
|
||||||
|
function chatBtnHide () {
|
||||||
|
if (window.tidioChatApi) {
|
||||||
|
window.tidioChatApi.hide();
|
||||||
|
//- document.getElementById('tidio-chat').style.display= 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function chatBtnShow () {
|
||||||
|
if (window.tidioChatApi) {
|
||||||
|
window.tidioChatApi.show();
|
||||||
|
//- document.getElementById('tidio-chat').style.display= 'block'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,13 +1,24 @@
|
|||||||
if theme.disqus && theme.disqus.enable
|
|
||||||
#disqus_thread
|
#disqus_thread
|
||||||
script.
|
script.
|
||||||
var unused = null;
|
|
||||||
var disqus_config = function () {
|
var disqus_config = function () {
|
||||||
this.page.url = '!{ page.permalink }';
|
this.page.url = '!{ page.permalink }';
|
||||||
this.page.identifier = '!{ page.path }';
|
this.page.identifier = '!{ page.path }';
|
||||||
this.page.title = '!{ page.title }';
|
this.page.title = '!{ page.title }';
|
||||||
}
|
};
|
||||||
|
(function() {
|
||||||
var d = document, s = d.createElement('script');
|
var d = document, s = d.createElement('script');
|
||||||
s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js";
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
|
||||||
s.setAttribute('data-timestamp', '' + +new Date());
|
s.setAttribute('data-timestamp', +new Date());
|
||||||
(d.head || d.body).appendChild(s);
|
(d.head || d.body).appendChild(s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
if is_post() && theme.disqus.count
|
||||||
|
script.
|
||||||
|
function getDisqusCount() {
|
||||||
|
var d = document, s = d.createElement('script');
|
||||||
|
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
||||||
|
s.id = 'dsq-count-scr';
|
||||||
|
(d.head || d.body).appendChild(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', getDisqusCount, false);
|
||||||
25
layout/includes/comments/disqusjs.pug
Normal file
25
layout/includes/comments/disqusjs.pug
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#disqus_thread
|
||||||
|
script(src=url_for(theme.CDN.disqusjs))
|
||||||
|
script.
|
||||||
|
var dsqjs = new DisqusJS({
|
||||||
|
shortname: '!{theme.disqusjs.shortname}',
|
||||||
|
siteName: '!{theme.disqusjs.siteName}',
|
||||||
|
identifier: '!{ page.path }',
|
||||||
|
url: '!{ page.permalink }',
|
||||||
|
title: '!{ page.title }',
|
||||||
|
api: '!{theme.disqusjs.api}',
|
||||||
|
apikey: '!{theme.disqusjs.apikey}',
|
||||||
|
nocomment: '!{theme.disqusjs.nocomment}',
|
||||||
|
admin: '!{theme.disqusjs.admin}',
|
||||||
|
adminLabel: '!{theme.disqusjs.adminLabel}'
|
||||||
|
});
|
||||||
|
|
||||||
|
if is_post() && theme.disqusjs.count
|
||||||
|
script.
|
||||||
|
function getDisqusCount() {
|
||||||
|
var d = document, s = d.createElement('script');
|
||||||
|
s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
|
||||||
|
s.id = 'dsq-count-scr';
|
||||||
|
(d.head || d.body).appendChild(s);
|
||||||
|
}
|
||||||
|
window.addEventListener('load', getDisqusCount, false);
|
||||||
12
layout/includes/comments/facebook_comments.pug
Normal file
12
layout/includes/comments/facebook_comments.pug
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#fb-root
|
||||||
|
script(async defer crossorigin="anonymous" src=`https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v6.0`)
|
||||||
|
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
|
||||||
|
data-href=urlNoIndex()
|
||||||
|
data-numposts= theme.facebook_comments.pageSize || 10
|
||||||
|
data-order-by= theme.facebook_comments.order_by || 'social'
|
||||||
|
data-width="100%")
|
||||||
|
|
||||||
|
if theme.darkmode.enable
|
||||||
|
script.
|
||||||
|
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||||
|
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
if theme.gitalk && theme.gitalk.enable
|
|
||||||
#gitalk-container
|
#gitalk-container
|
||||||
script.
|
script.
|
||||||
var gitalk = new Gitalk({
|
var gitalk = new Gitalk({
|
||||||
@@ -6,8 +5,23 @@ if theme.gitalk && theme.gitalk.enable
|
|||||||
clientSecret: '!{theme.gitalk.client_secret}',
|
clientSecret: '!{theme.gitalk.client_secret}',
|
||||||
repo: '!{theme.gitalk.repo}',
|
repo: '!{theme.gitalk.repo}',
|
||||||
owner: '!{theme.gitalk.owner}',
|
owner: '!{theme.gitalk.owner}',
|
||||||
admin: '!{theme.gitalk.admin}',
|
admin: ['!{theme.gitalk.admin}'],
|
||||||
id: md5(decodeURI(location.pathname)),
|
id: md5(decodeURI(location.pathname)),
|
||||||
language: '!{lang}'
|
language: '!{theme.gitalk.language}',
|
||||||
|
perPage: !{theme.gitalk.perPage},
|
||||||
|
distractionFreeMode: !{theme.gitalk.distractionFreeMode},
|
||||||
|
pagerDirection: '!{theme.gitalk.pagerDirection}',
|
||||||
|
createIssueManually: !{theme.gitalk.createIssueManually},
|
||||||
|
updateCountCallback: commentCount
|
||||||
})
|
})
|
||||||
gitalk.render('gitalk-container')
|
gitalk.render('gitalk-container')
|
||||||
|
|
||||||
|
function commentCount(n){
|
||||||
|
try {
|
||||||
|
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
if theme.gitment && theme.gitment.enable
|
|
||||||
#gitment-container
|
|
||||||
script.
|
|
||||||
var gitment = new Gitment({
|
|
||||||
id: md5(decodeURI(location.pathname)),
|
|
||||||
owner: '!{theme.gitment.owner}',
|
|
||||||
repo: '!{theme.gitment.repo}',
|
|
||||||
oauth: {
|
|
||||||
client_id: '!{theme.gitment.client_id}',
|
|
||||||
client_secret: '!{theme.gitment.client_secret}'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
gitment.render('gitment-container')
|
|
||||||
@@ -1,35 +1,29 @@
|
|||||||
if theme.disqus && theme.disqus.enable
|
- var d = theme.disqus && theme.disqus.enable
|
||||||
|
- var dj = theme.disqusjs && theme.disqusjs.enable
|
||||||
|
- var l = theme.livere && theme.livere.enable
|
||||||
|
- var gt = theme.gitalk && theme.gitalk.enable
|
||||||
|
- var v = theme.valine && theme.valine.enable
|
||||||
|
- var u = theme.utterances && theme.utterances.enable
|
||||||
|
- var fb = theme.facebook_comments && theme.facebook_comments.enable
|
||||||
|
- var isComment = d || dj || l || gt || v || u || fb
|
||||||
|
|
||||||
|
if isComment
|
||||||
hr
|
hr
|
||||||
#post-comment
|
#post-comment
|
||||||
.comment_headling
|
.comment_headling
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
i.fas.fa-comments.fa-fw
|
||||||
span= ' ' + _p('comment')
|
span= ' ' + _p('comment')
|
||||||
|
if d
|
||||||
include ./disqus.pug
|
include ./disqus.pug
|
||||||
else if theme.laibili && theme.laibili.enable
|
else if dj
|
||||||
hr
|
include ./disqusjs.pug
|
||||||
#post-comment
|
else if l
|
||||||
.comment_headling
|
include ./livere.pug
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
else if gt
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./laibili.pug
|
|
||||||
else if theme.gitment && theme.gitment.enable
|
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./gitment.pug
|
|
||||||
else if theme.gitalk && theme.gitalk.enable
|
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./gitalk.pug
|
include ./gitalk.pug
|
||||||
else if theme.valine && theme.valine.enable
|
else if v
|
||||||
hr
|
|
||||||
#post-comment
|
|
||||||
.comment_headling
|
|
||||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
|
||||||
span= ' ' + _p('comment')
|
|
||||||
include ./valine.pug
|
include ./valine.pug
|
||||||
|
else if u
|
||||||
|
include ./utterances.pug
|
||||||
|
else if fb
|
||||||
|
include ./facebook_comments.pug
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
if theme.laibili && theme.laibili.enable
|
|
||||||
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
|
||||||
script.
|
|
||||||
(function(d, s) {
|
|
||||||
var j, e = d.getElementsByTagName(s)[0];
|
|
||||||
if (typeof LivereTower === 'function') { return; }
|
|
||||||
j = d.createElement(s);
|
|
||||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
|
||||||
j.async = true;
|
|
||||||
e.parentNode.insertBefore(j, e);
|
|
||||||
})(document, 'script');
|
|
||||||
10
layout/includes/comments/livere.pug
Normal file
10
layout/includes/comments/livere.pug
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#lv-container(data-id="city" data-uid=theme.livere.uid)
|
||||||
|
script.
|
||||||
|
(function(d, s) {
|
||||||
|
var j, e = d.getElementsByTagName(s)[0];
|
||||||
|
if (typeof LivereTower === 'function') { return; }
|
||||||
|
j = d.createElement(s);
|
||||||
|
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||||
|
j.async = true;
|
||||||
|
e.parentNode.insertBefore(j, e);
|
||||||
|
})(document, 'script');
|
||||||
21
layout/includes/comments/utterances.pug
Normal file
21
layout/includes/comments/utterances.pug
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
script#utterances_comment(src=theme.CDN.utterances
|
||||||
|
repo=theme.utterances.repo
|
||||||
|
issue-term=theme.utterances.issue_term
|
||||||
|
theme= theme.display_mode === 'dark' ? theme.utterances.dark_theme : theme.utterances.light_theme
|
||||||
|
crossorigin="anonymous"
|
||||||
|
async)
|
||||||
|
|
||||||
|
if theme.darkmode.enable
|
||||||
|
script.
|
||||||
|
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||||
|
document.getElementById('utterances_comment').setAttribute('theme',themeNow)
|
||||||
|
|
||||||
|
function utterancesTheme () {
|
||||||
|
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||||
|
const message = {
|
||||||
|
type: 'set-theme',
|
||||||
|
theme: theme
|
||||||
|
};
|
||||||
|
const iframe = document.querySelector('.utterances-frame');
|
||||||
|
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||||
|
}
|
||||||
@@ -1,25 +1,35 @@
|
|||||||
if theme.valine && theme.valine.enable
|
- let emojiMaps = '""'
|
||||||
|
if site.data.valine
|
||||||
|
- emojiMaps = JSON.stringify(site.data.valine)
|
||||||
|
|
||||||
#vcomment.vcomment
|
#vcomment.vcomment
|
||||||
script(src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js')
|
script(src=url_for(theme.CDN.valine))
|
||||||
script.
|
script.
|
||||||
var notify = #{ theme.valine.notify } == true ? true : false;
|
var requestSetting = function (from,set) {
|
||||||
var verify = #{ theme.valine.verify } == true ? true : false;
|
var from = from
|
||||||
var GUEST_INFO = ['nick','mail','link'];
|
var setting = set.split(',').filter(function(item){
|
||||||
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
|
return from.indexOf(item) > -1
|
||||||
return GUEST_INFO.indexOf(item) > -1
|
|
||||||
});
|
});
|
||||||
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
|
setting = setting.length == 0 ? from :setting;
|
||||||
|
return setting
|
||||||
|
}
|
||||||
|
|
||||||
|
var guestInfo = requestSetting(['nick','mail','link'],'#{ theme.valine.guest_info }')
|
||||||
|
var requiredFields = requestSetting(['nick','mail'],'#{ theme.valine.requiredFields }')
|
||||||
|
|
||||||
window.valine = new Valine({
|
window.valine = new Valine({
|
||||||
el:'#vcomment',
|
el:'#vcomment',
|
||||||
notify:notify,
|
|
||||||
verify:verify,
|
|
||||||
appId: '#{theme.valine.appId}',
|
appId: '#{theme.valine.appId}',
|
||||||
appKey: '#{theme.valine.appKey}',
|
appKey: '#{theme.valine.appKey}',
|
||||||
placeholder: '#{theme.valine.placeholder}',
|
placeholder: '#{theme.valine.placeholder}',
|
||||||
avatar: '#{theme.valine.avatar}',
|
avatar: '#{theme.valine.avatar}',
|
||||||
guest_info:guest_info,
|
meta: guestInfo,
|
||||||
pageSize: '#{theme.valine.pageSize}',
|
pageSize: '#{theme.valine.pageSize}',
|
||||||
lang: '#{theme.valine.lang}',
|
lang: '#{theme.valine.lang}',
|
||||||
recordIP: true
|
recordIP: #{theme.valine.recordIP},
|
||||||
|
serverURLs: '#{theme.valine.serverURLs}',
|
||||||
|
emojiCDN: '#{theme.valine.emojiCDN}',
|
||||||
|
emojiMaps: !{emojiMaps},
|
||||||
|
enableQQ: #{theme.valine.enableQQ},
|
||||||
|
requiredFields: requiredFields
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
-
|
|
||||||
var algolia = 'undefined';
|
|
||||||
var env = process.env;
|
|
||||||
if (theme.algolia_search.enable) {
|
|
||||||
algolia = JSON.stringify({
|
|
||||||
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
|
|
||||||
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
|
|
||||||
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
|
|
||||||
hits: theme.algolia_search.hits,
|
|
||||||
// search languages
|
|
||||||
languages: {
|
|
||||||
input_placeholder: _p("algolia_search.input_placeholder"),
|
|
||||||
hits_empty: _p("algolia_search.hits_empty"),
|
|
||||||
hits_stats: _p("algolia_search.hits_stats")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var localSearch = 'undefined';
|
|
||||||
if (theme.local_search && theme.local_search.enable) {
|
|
||||||
localSearch = JSON.stringify({
|
|
||||||
path: config.search.path,
|
|
||||||
languages: {
|
|
||||||
// search languages
|
|
||||||
hits_empty: _p("local_search.hits_empty")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
var translate = 'undefined';
|
|
||||||
if (theme.translate && theme.translate.enable){
|
|
||||||
var defaultEncoding;
|
|
||||||
translate = JSON.stringify({
|
|
||||||
defaultEncoding: theme.translate.defaultEncoding,
|
|
||||||
translateDelay: theme.translate.translateDelay,
|
|
||||||
cookieDomain: theme.translate.cookieDomain,
|
|
||||||
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
|
||||||
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
script.
|
|
||||||
var GLOBAL_CONFIG = {
|
|
||||||
root: '!{config.root}',
|
|
||||||
algolia: !{algolia},
|
|
||||||
localSearch: !{localSearch},
|
|
||||||
translate: !{translate},
|
|
||||||
highlight_copy: '!{theme.highlight_copy}',
|
|
||||||
highlight_lang: '!{theme.highlight_lang}',
|
|
||||||
highlight_shrink: '!{theme.highlight_shrink}',
|
|
||||||
copy: {
|
|
||||||
success: '!{_p("copy.success")}',
|
|
||||||
error: '!{_p("copy.error")}',
|
|
||||||
noSupport: '!{_p("copy.noSupport")}'
|
|
||||||
},
|
|
||||||
bookmark: {
|
|
||||||
title: '!{_p("bookmark.title")}',
|
|
||||||
message_prev: '!{_p("bookmark.message_prev")}',
|
|
||||||
message_next: '!{_p("bookmark.message_next")}'
|
|
||||||
},
|
|
||||||
runtime_unit: '!{_p("runtime_unit")}'
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
#footer
|
#footer-wrap
|
||||||
- var now = new Date()
|
- var now = new Date()
|
||||||
- var nowYear = now.getFullYear()
|
- var nowYear = now.getFullYear()
|
||||||
if theme.since && theme.since != nowYear
|
if theme.since && theme.since != nowYear
|
||||||
.copyright!= `©${theme.since} - ${nowYear} By ${config.author}`
|
.copyright!= `©${theme.since} - ${nowYear} By ${config.author}`
|
||||||
else
|
else
|
||||||
.copyright!= `©${nowYear} By ${config.author}`
|
.copyright!= `©${nowYear} By ${config.author}`
|
||||||
if theme.footer_copyright.enable
|
if theme.footer_copyright
|
||||||
.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') + ' '
|
||||||
@@ -19,4 +19,6 @@
|
|||||||
if theme.ICP.enable
|
if theme.ICP.enable
|
||||||
.icp
|
.icp
|
||||||
a(href=theme.ICP.url)
|
a(href=theme.ICP.url)
|
||||||
|
if theme.ICP.icon
|
||||||
|
img.icp-icon(src=url_for(theme.ICP.icon))
|
||||||
span=theme.ICP.text
|
span=theme.ICP.text
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#gallery!= page.content
|
|
||||||
@@ -1,118 +1,100 @@
|
|||||||
- var without_index = url.replace('index.html', '')
|
- var pageTitle
|
||||||
- var without_html = without_index.replace('.html', '')
|
- if (is_archive()) pageTitle = _p('page.archives')
|
||||||
- var photo_check = page.cover || theme.avatar
|
- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||||
- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||||
|
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||||
|
- else if (is_year()) pageTitle += ': ' + page.year
|
||||||
|
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404.error_title')
|
||||||
|
- else pageTitle = page.title || config.title || ''
|
||||||
|
|
||||||
meta(http-equiv="x-dns-prefetch-control" content="on")
|
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||||
if theme.canonical
|
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||||
link(rel="canonical" href=without_html)
|
|
||||||
|
|
||||||
if theme.twitter_meta
|
- var pageDescription = page_description()
|
||||||
meta(name="twitter:card" content="summary_large_image")
|
- var pageKeywords
|
||||||
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||||||
meta(name="twitter:description" content=pageDescription)
|
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||||
meta(name="twitter:image" content=photo_link)
|
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||||
|
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||||
|
- var pageCopyright = config.copyright || config.author
|
||||||
|
|
||||||
if theme.Open_Graph_meta
|
meta(charset='UTF-8')
|
||||||
if is_post()
|
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||||
meta(property="og:type" content="article")
|
meta(name="viewport" content="width=device-width,initial-scale=1")
|
||||||
else
|
title= tabTitle
|
||||||
meta(property="og:type" content="website")
|
meta(name="description" content!=pageDescription)
|
||||||
|
if pageKeywords
|
||||||
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
meta(name="keywords" content=pageKeywords)
|
||||||
meta(property="og:url" content=without_html)
|
meta(name="author" content=pageAuthor)
|
||||||
meta(property="og:site_name" content=config.title)
|
meta(name="copyright" content=pageCopyright)
|
||||||
meta(property="og:description" content=pageDescription)
|
meta(name ="format-detection" content="telephone=no")
|
||||||
meta(property="og:image" content=photo_link)
|
!=favicon_tag(theme.favicon || config.favicon)
|
||||||
|
link(rel="canonical" href=urlNoIndex())
|
||||||
|
|
||||||
if theme.disable_baidu_transformation
|
if theme.disable_baidu_transformation
|
||||||
meta(http-equiv="Cache-Control" content="no-transform")
|
meta(http-equiv="Cache-Control" content="no-transform")
|
||||||
meta(http-equiv="Cache-Control" content="no-siteapp")
|
meta(http-equiv="Cache-Control" content="no-siteapp")
|
||||||
|
|
||||||
|
if theme.douban
|
||||||
|
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/preconnect', {}, {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})
|
||||||
|
|
||||||
|
if theme.darkmode.enable
|
||||||
|
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
//- main css
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome))
|
||||||
|
|
||||||
|
if theme.fancybox
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
||||||
|
|
||||||
|
if (theme.snackbar && theme.snackbar.enable)
|
||||||
|
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
||||||
|
|
||||||
if is_post()
|
if is_post()
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
||||||
if(page.next)
|
if(page.next)
|
||||||
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
||||||
|
|
||||||
|
|
||||||
if theme.algolia_search.enable
|
if theme.algolia_search.enable
|
||||||
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css")
|
script(src=url_for(theme.CDN.algolia_search) defer)
|
||||||
script(src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" defer)
|
|
||||||
|
|
||||||
if (theme.gitment && theme.gitment.enable)
|
//- comment css
|
||||||
link(rel="dns-prefetch" href="https://unpkg.com")
|
include ./head/comment.pug
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitment/style/default.min.css")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/gitment/dist/gitment.browser.min.js")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
||||||
if (theme.gitalk && theme.gitalk.enable)
|
|
||||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css")
|
|
||||||
if(theme.gitalk.js)
|
|
||||||
script(src=theme.gitalk.js)
|
|
||||||
else
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
|
||||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
|
||||||
|
|
||||||
|
//- google_adsense
|
||||||
|
!=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
//- analytics
|
||||||
|
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if (theme.pwa && theme.pwa.enable)
|
//- font
|
||||||
link(rel="manifest" href=theme.pwa.manifest)
|
|
||||||
if(theme.pwa.theme_color)
|
|
||||||
meta(name="theme-color" content=theme.pwa.theme_color)
|
|
||||||
if(theme.pwa.theme_color)
|
|
||||||
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
|
||||||
if(theme.pwa.apple_touch_icon)
|
|
||||||
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon)
|
|
||||||
if(theme.pwa.favicon_32_32)
|
|
||||||
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32)
|
|
||||||
if(theme.pwa.favicon_16_16)
|
|
||||||
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
|
||||||
if(theme.pwa.mask_icon)
|
|
||||||
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
|
||||||
|
|
||||||
|
|
||||||
if theme.baidu_analytics
|
|
||||||
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
|
||||||
script.
|
|
||||||
var _hmt = _hmt || [];
|
|
||||||
(function() {
|
|
||||||
var hm = document.createElement("script");
|
|
||||||
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
|
||||||
var s = document.getElementsByTagName("script")[0];
|
|
||||||
s.parentNode.insertBefore(hm, s);
|
|
||||||
})();
|
|
||||||
if theme.google_analytics
|
|
||||||
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
|
||||||
script.
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
||||||
|
|
||||||
ga('create', '!{theme.google_analytics}', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
|
|
||||||
if theme.google_site_verification
|
|
||||||
meta(name="google-site-verification" content=theme.google_site_verification)
|
|
||||||
|
|
||||||
if theme.bing_site_verification
|
|
||||||
meta(name="msvalidate.01" content=theme.bing_site_verification)
|
|
||||||
|
|
||||||
if theme.baidu_site_verification
|
|
||||||
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
|
|
||||||
|
|
||||||
if theme.qihu_site_verification
|
|
||||||
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
|
||||||
|
|
||||||
|
|
||||||
- var preload_archive_img = theme.archive_img ||theme.top_img || config.top_img
|
|
||||||
- var preload_img = page.top_img || theme.top_img || config.top_img
|
|
||||||
|
|
||||||
if (is_archive() && preload_archive_img)
|
|
||||||
link(rel="preload" href=url_for(preload_archive_img) as="image" )
|
|
||||||
else if (!is_post() && preload_img)
|
|
||||||
link(rel="preload" href=url_for(preload_img) as="image" )
|
|
||||||
|
|
||||||
if theme.blog_title_font.font_link
|
if theme.blog_title_font.font_link
|
||||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link))
|
||||||
|
|
||||||
|
//- global config
|
||||||
|
!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
|
include ./head/config_site.pug
|
||||||
|
include ./head/noscript.pug
|
||||||
|
|
||||||
|
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||||
|
|
||||||
|
if page.aplayer
|
||||||
|
include ./head/aplayer.pug
|
||||||
12
layout/includes/head/Open_Graph.pug
Normal file
12
layout/includes/head/Open_Graph.pug
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
- var contentType = is_post() ? 'article' : 'website'
|
||||||
|
|
||||||
|
if theme.Open_Graph_meta
|
||||||
|
meta(property="og:type" content=contentType)
|
||||||
|
meta(property="og:title" content=pageTitle)
|
||||||
|
meta(property="og:url" content=urlNoIndex())
|
||||||
|
meta(property="og:site_name" content=config.title)
|
||||||
|
meta(property="og:description" content!=pageDescription)
|
||||||
|
meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||||
|
meta(property="article:published_time" content=date_xml(page.date))
|
||||||
|
meta(property="article:modified_time" content=date_xml(page.updated))
|
||||||
|
meta(name="twitter:card" content="summary")
|
||||||
22
layout/includes/head/analytics.pug
Normal file
22
layout/includes/head/analytics.pug
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
if theme.baidu_analytics
|
||||||
|
script.
|
||||||
|
var _hmt = _hmt || [];
|
||||||
|
(function() {
|
||||||
|
var hm = document.createElement("script");
|
||||||
|
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
||||||
|
var s = document.getElementsByTagName("script")[0];
|
||||||
|
s.parentNode.insertBefore(hm, s);
|
||||||
|
})();
|
||||||
|
|
||||||
|
if theme.google_analytics
|
||||||
|
script.
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', '!{theme.google_analytics}', 'auto');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
|
||||||
|
if theme.tencent_analytics
|
||||||
|
script(src=`https://tajs.qq.com/stats?sId=${theme.tencent_analytics}` charset="UTF-8")
|
||||||
3
layout/includes/head/aplayer.pug
Normal file
3
layout/includes/head/aplayer.pug
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
link(rel='stylesheet' href=url_for(theme.CDN.aplayer_css))
|
||||||
|
script(src=url_for(theme.CDN.aplayer_js))
|
||||||
|
script(src=url_for(theme.CDN.meting_js))
|
||||||
14
layout/includes/head/comment.pug
Normal file
14
layout/includes/head/comment.pug
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
if (theme.facebook_comments.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
if theme.facebook_comments.app_id
|
||||||
|
meta(property="fb:app_id" content=theme.facebook_comments.app_id )
|
||||||
|
if theme.facebook_comments.user_id
|
||||||
|
meta(property="fb:admins" content=theme.facebook_comments.user_id)
|
||||||
|
|
||||||
|
if (theme.disqusjs && theme.disqusjs.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))
|
||||||
|
|
||||||
|
if (theme.gitalk && theme.gitalk.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
|
||||||
|
script(src=url_for(theme.CDN.gitalk))
|
||||||
|
script(src=url_for(theme.CDN.blueimp_md5))
|
||||||
|
|
||||||
110
layout/includes/head/config.pug
Normal file
110
layout/includes/head/config.pug
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
-
|
||||||
|
var algolia = 'undefined';
|
||||||
|
var env = process.env;
|
||||||
|
if (theme.algolia_search.enable) {
|
||||||
|
algolia = JSON.stringify({
|
||||||
|
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
|
||||||
|
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
|
||||||
|
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
|
||||||
|
hits: theme.algolia_search.hits,
|
||||||
|
// search languages
|
||||||
|
languages: {
|
||||||
|
input_placeholder: _p("algolia_search.input_placeholder"),
|
||||||
|
hits_empty: _p("algolia_search.hits_empty"),
|
||||||
|
hits_stats: _p("algolia_search.hits_stats")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var localSearch = 'undefined';
|
||||||
|
if (theme.local_search && theme.local_search.enable) {
|
||||||
|
localSearch = JSON.stringify({
|
||||||
|
path: config.search.path,
|
||||||
|
languages: {
|
||||||
|
// search languages
|
||||||
|
hits_empty: _p("local_search.hits_empty")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
var translate = 'undefined';
|
||||||
|
if (theme.translate && theme.translate.enable){
|
||||||
|
translate = JSON.stringify({
|
||||||
|
defaultEncoding: theme.translate.defaultEncoding,
|
||||||
|
translateDelay: theme.translate.translateDelay,
|
||||||
|
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||||
|
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var copyright = 'undefined' ;
|
||||||
|
if (theme.copy.enable && theme.copy.copyright){
|
||||||
|
copyright = JSON.stringify({
|
||||||
|
languages: {
|
||||||
|
author: _p("copy_copyright.author") + ': ' + config.author,
|
||||||
|
link: _p("copy_copyright.link") + ': ',
|
||||||
|
source: _p("copy_copyright.source") + ': ' + config.title,
|
||||||
|
info: _p("copy_copyright.info")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var ClickShowText = 'undefined';
|
||||||
|
if (theme.ClickShowText && theme.ClickShowText.enable) {
|
||||||
|
ClickShowText = JSON.stringify({
|
||||||
|
text: theme.ClickShowText.text.join(","),
|
||||||
|
fontSize: theme.ClickShowText.fontSize
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var Snackbar = 'undefined';
|
||||||
|
if (theme.snackbar && theme.snackbar.enable) {
|
||||||
|
Snackbar = JSON.stringify({
|
||||||
|
bookmark: {
|
||||||
|
message_prev: _p("Snackbar.bookmark.message_prev"),
|
||||||
|
message_next: _p("Snackbar.bookmark.message_next")
|
||||||
|
},
|
||||||
|
chs_to_cht: _p("Snackbar.chs_to_cht"),
|
||||||
|
cht_to_chs: _p("Snackbar.cht_to_chs"),
|
||||||
|
day_to_night: _p("Snackbar.day_to_night"),
|
||||||
|
night_to_day: _p("Snackbar.night_to_day"),
|
||||||
|
bgLight: theme.snackbar.bg_light,
|
||||||
|
bgDark: theme.snackbar.bg_dark,
|
||||||
|
position: theme.snackbar.position,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
script.
|
||||||
|
var GLOBAL_CONFIG = {
|
||||||
|
root: '!{config.root}',
|
||||||
|
algolia: !{algolia},
|
||||||
|
localSearch: !{localSearch},
|
||||||
|
translate: !{translate},
|
||||||
|
copy: {
|
||||||
|
success: '!{_p("copy.success")}',
|
||||||
|
error: '!{_p("copy.error")}',
|
||||||
|
noSupport: '!{_p("copy.noSupport")}'
|
||||||
|
},
|
||||||
|
bookmark: {
|
||||||
|
message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
|
||||||
|
message_next: '!{_p("Snackbar.bookmark.message_next")}'
|
||||||
|
},
|
||||||
|
runtime_unit: '!{_p("runtime_unit")}',
|
||||||
|
runtime: !{theme.runtimeshow.enable},
|
||||||
|
copyright: !{copyright},
|
||||||
|
ClickShowText: !{ClickShowText},
|
||||||
|
medium_zoom: !{theme.medium_zoom},
|
||||||
|
fancybox: !{theme.fancybox},
|
||||||
|
Snackbar: !{Snackbar},
|
||||||
|
justifiedGallery: {
|
||||||
|
js: '!{theme.CDN.justifiedGallery_js}',
|
||||||
|
css: '!{theme.CDN.justifiedGallery_css}'
|
||||||
|
},
|
||||||
|
baiduPush: !{theme.baidu_push},
|
||||||
|
highlightCopy: !{theme.highlight_copy},
|
||||||
|
highlightLang: !{theme.highlight_lang},
|
||||||
|
isPhotoFigcaption: !{theme.photofigcaption},
|
||||||
|
islazyload: !{theme.lazyload.enable},
|
||||||
|
isanchor: !{theme.anchor}
|
||||||
|
}
|
||||||
|
|
||||||
17
layout/includes/head/config_site.pug
Normal file
17
layout/includes/head/config_site.pug
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
-
|
||||||
|
let isHighlightShrink
|
||||||
|
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
||||||
|
else if (page.highlight_shrink !== undefined) isHighlightShrink = page.highlight_shrink
|
||||||
|
else isHighlightShrink = theme.highlight_shrink
|
||||||
|
|
||||||
|
const pageToc = page.toc !== undefined ? page.toc : theme.toc.enable
|
||||||
|
const showToc = is_post() && pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
||||||
|
-
|
||||||
|
|
||||||
|
script.
|
||||||
|
var GLOBAL_CONFIG_SITE = {
|
||||||
|
isPost: !{is_post()},
|
||||||
|
isHome: !{is_home()},
|
||||||
|
isHighlightShrink: !{isHighlightShrink},
|
||||||
|
isSidebar: !{showToc}
|
||||||
|
}
|
||||||
56
layout/includes/head/darkmode.pug
Normal file
56
layout/includes/head/darkmode.pug
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
script.
|
||||||
|
var activateDarkMode = function () {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'dark')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#000')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var activateLightMode = function () {
|
||||||
|
document.documentElement.setAttribute('data-theme', 'light')
|
||||||
|
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||||
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#fff')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var getCookies = function (name) {
|
||||||
|
const value = `; ${document.cookie}`
|
||||||
|
const parts = value.split(`; ${name}=`)
|
||||||
|
if (parts.length === 2) return parts.pop().split(';').shift()
|
||||||
|
}
|
||||||
|
|
||||||
|
var autoChangeMode = '#{theme.darkmode.autoChangeMode}'
|
||||||
|
var t = getCookies('theme')
|
||||||
|
if (autoChangeMode === '1') {
|
||||||
|
var isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
|
var isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
|
||||||
|
var isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
|
||||||
|
var 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.')
|
||||||
|
var now = new Date()
|
||||||
|
var hour = now.getHours()
|
||||||
|
var isNight = hour <= 6 || hour >= 18
|
||||||
|
isNight ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
|
||||||
|
if (Cookies.get('theme') === undefined) {
|
||||||
|
e.matches ? activateDarkMode() : activateLightMode()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
} else if (autoChangeMode === '2') {
|
||||||
|
now = new Date()
|
||||||
|
hour = now.getHours()
|
||||||
|
isNight = hour <= 6 || hour >= 18
|
||||||
|
if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
|
||||||
|
else if (t === 'light') activateLightMode()
|
||||||
|
else activateDarkMode()
|
||||||
|
} else {
|
||||||
|
if (t === 'dark') activateDarkMode()
|
||||||
|
else if (t === 'light') activateLightMode()
|
||||||
|
}
|
||||||
7
layout/includes/head/google_adsense.pug
Normal file
7
layout/includes/head/google_adsense.pug
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
if (theme.google_adsense && theme.google_adsense.enable)
|
||||||
|
script(async src=theme.google_adsense.js)
|
||||||
|
script.
|
||||||
|
(adsbygoogle = window.adsbygoogle || []).push({
|
||||||
|
google_ad_client: '!{theme.google_adsense.client}',
|
||||||
|
enable_page_level_ads: '!{theme.google_adsense.enable_page_level_ads}'
|
||||||
|
});
|
||||||
9
layout/includes/head/noscript.pug
Normal file
9
layout/includes/head/noscript.pug
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
noscript.
|
||||||
|
<style>
|
||||||
|
#nav {
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
.justified-gallery img{
|
||||||
|
opacity: 1
|
||||||
|
}
|
||||||
|
</style>
|
||||||
19
layout/includes/head/preconnect.pug
Normal file
19
layout/includes/head/preconnect.pug
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||||
|
|
||||||
|
if theme.google_analytics
|
||||||
|
link(rel="preconnect" href="//www.google-analytics.com" crossorigin)
|
||||||
|
|
||||||
|
if theme.baidu_analytics
|
||||||
|
link(rel="preconnect" href="//hm.baidu.com")
|
||||||
|
|
||||||
|
if theme.tencent_analytics
|
||||||
|
link(rel="preconnect" href="//ta.qq.com")
|
||||||
|
|
||||||
|
if theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1
|
||||||
|
link(rel="preconnect" href="//fonts.googleapis.com" crossorigin)
|
||||||
|
|
||||||
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
|
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||||
|
|
||||||
|
if theme.baidu_push
|
||||||
|
link(rel="preconnect" href="//zz.bdstatic.com")
|
||||||
13
layout/includes/head/pwa.pug
Normal file
13
layout/includes/head/pwa.pug
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
link(rel="manifest" href=theme.pwa.manifest)
|
||||||
|
if(theme.pwa.theme_color)
|
||||||
|
meta(name="theme-color" content=theme.pwa.theme_color)
|
||||||
|
if(theme.pwa.theme_color)
|
||||||
|
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
||||||
|
if(theme.pwa.apple_touch_icon)
|
||||||
|
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon)
|
||||||
|
if(theme.pwa.favicon_32_32)
|
||||||
|
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32)
|
||||||
|
if(theme.pwa.favicon_16_16)
|
||||||
|
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
||||||
|
if(theme.pwa.mask_icon)
|
||||||
|
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
||||||
11
layout/includes/head/site_verification.pug
Normal file
11
layout/includes/head/site_verification.pug
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
if theme.google_site_verification
|
||||||
|
meta(name="google-site-verification" content=theme.google_site_verification)
|
||||||
|
|
||||||
|
if theme.bing_site_verification
|
||||||
|
meta(name="msvalidate.01" content=theme.bing_site_verification)
|
||||||
|
|
||||||
|
if theme.baidu_site_verification
|
||||||
|
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
|
||||||
|
|
||||||
|
if theme.qihu_site_verification
|
||||||
|
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
||||||
130
layout/includes/head/subtitle.pug
Normal file
130
layout/includes/head/subtitle.pug
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
if theme.subtitle.enable
|
||||||
|
- var source = theme.subtitle.source
|
||||||
|
- var subtitleEffect = theme.subtitle.effect
|
||||||
|
|
||||||
|
if subtitleEffect
|
||||||
|
script(src=url_for(theme.CDN.typed))
|
||||||
|
|
||||||
|
if source == '1'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',)
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json()
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||||
|
var both = sub.unshift(data.text)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = data.text
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '2'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
fetch('https://v1.hitokoto.cn')
|
||||||
|
.then(function (res) {
|
||||||
|
return res.json()
|
||||||
|
})
|
||||||
|
.then(function (data) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var from = '出自 ' + data.from
|
||||||
|
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||||
|
var both = sub.unshift(data.hitokoto, from)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(function (err) {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '3'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
loadScript('http://yijuzhan.com/api/word.php?m=js', function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
var con = str[0]
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var from = '出自 ' + str[1]
|
||||||
|
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||||
|
var both = sub.unshift(con, from)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = con
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else if source == '4'
|
||||||
|
script.
|
||||||
|
var subtitleType = function () {
|
||||||
|
loadScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
|
||||||
|
var subtitleEffect = !{ subtitleEffect }
|
||||||
|
jinrishici.load(function (result) {
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||||
|
var content = result.data.content
|
||||||
|
var both = sub.unshift(content)
|
||||||
|
var typed = new Typed('#subtitle', {
|
||||||
|
strings: sub,
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById('subtitle').innerHTML = result.data.content
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
window.addEventListener('load', subtitleType)
|
||||||
|
|
||||||
|
else
|
||||||
|
script.
|
||||||
|
var subtitleEffect = !{subtitleEffect}
|
||||||
|
if (subtitleEffect) {
|
||||||
|
var typed = new Typed("#subtitle", {
|
||||||
|
strings: "!{theme.subtitle.sub}".split(","),
|
||||||
|
startDelay: 300,
|
||||||
|
typeSpeed: 150,
|
||||||
|
loop: !{theme.subtitle.loop},
|
||||||
|
backSpeed: 50
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||||
|
}
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#page-header
|
|
||||||
span.pull-left
|
|
||||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
|
||||||
//- i.fa.fa-bars.toggle-menu.pull-right(aria-hidden="true")
|
|
||||||
.open.toggle-menu.pull-right
|
|
||||||
.menu-icon-first
|
|
||||||
.menu-icon-second
|
|
||||||
.menu-icon-third
|
|
||||||
|
|
||||||
.menu_mask
|
|
||||||
|
|
||||||
span.pull-right.menus
|
|
||||||
.mobile_author_icon
|
|
||||||
img.lozad.avatar_img(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
|
||||||
.mobile_post_data
|
|
||||||
if site.posts.length
|
|
||||||
.mobile_data_item.text-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.text-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.text-center
|
|
||||||
.mobile_data_link
|
|
||||||
a(href=url_for(config.category_dir) + '/')
|
|
||||||
.headline= _p('aside.categories')
|
|
||||||
.length_num= site.categories.length
|
|
||||||
|
|
||||||
hr
|
|
||||||
.menus_items
|
|
||||||
each value, label in theme.menu
|
|
||||||
if !Array.isArray(value)
|
|
||||||
.menus_item
|
|
||||||
a.site-page(href=value.split('||')[0])
|
|
||||||
i.fa-fw(class=value.split('||')[1])
|
|
||||||
span=' '+label
|
|
||||||
else
|
|
||||||
.menus_item
|
|
||||||
a.site-page
|
|
||||||
i.fa-fw(class=label.split('||')[1] aria-hidden="true")
|
|
||||||
span=' '+label.split('||')[0]
|
|
||||||
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
|
||||||
ul.menus_item_child
|
|
||||||
each i in value
|
|
||||||
li
|
|
||||||
a.site-page(href=i.split('||')[1])
|
|
||||||
i.fa-fw(class=i.split('||')[2])
|
|
||||||
span=' '+i.split('||')[0]
|
|
||||||
|
|
||||||
|
|
||||||
script.
|
|
||||||
document.body.addEventListener('touchstart', function(){ });
|
|
||||||
span.pull-right
|
|
||||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
|
||||||
a.site-page.social-icon.search
|
|
||||||
i.fa.fa-search.fa-fw
|
|
||||||
span=' '+_p('search')
|
|
||||||
43
layout/includes/header/index.pug
Normal file
43
layout/includes/header/index.pug
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
if is_home()
|
||||||
|
- var top_img = theme.index_img || theme.default_top_img
|
||||||
|
else if is_post()
|
||||||
|
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
||||||
|
else if is_archive()
|
||||||
|
- var top_img = theme.archive_img || theme.default_top_img
|
||||||
|
else if is_tag()
|
||||||
|
- var top_img = theme.tag_img || theme.default_top_img
|
||||||
|
else if is_category()
|
||||||
|
- var top_img = theme.category_img || theme.default_top_img
|
||||||
|
else
|
||||||
|
- var top_img = page.top_img || theme.default_top_img
|
||||||
|
|
||||||
|
if theme.douban
|
||||||
|
if is_current('/movies/', [strict])
|
||||||
|
- var top_img = theme.douban.movies_img || theme.default_top_img
|
||||||
|
else if is_current('/books/', [strict])
|
||||||
|
- var top_img = theme.douban.books_img || theme.default_top_img
|
||||||
|
else if is_current('/games/', [strict])
|
||||||
|
- var top_img = theme.douban.games_img || theme.default_top_img
|
||||||
|
|
||||||
|
- var bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : ''
|
||||||
|
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||||
|
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||||
|
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||||
|
|
||||||
|
header#page-header(class=isHomeClass style=bg_img)
|
||||||
|
!=partial('includes/header/nav', {}, {cache:theme.fragment_cache})
|
||||||
|
if is_home()
|
||||||
|
#site-info
|
||||||
|
h1#site_title=site_title
|
||||||
|
#site_subtitle
|
||||||
|
span#subtitle
|
||||||
|
if(theme.social)
|
||||||
|
#site_social_icons
|
||||||
|
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||||
|
#scroll_down
|
||||||
|
i.fas.fa-angle-down.scroll-down-effects
|
||||||
|
else if is_post()
|
||||||
|
include ./post-info.pug
|
||||||
|
else
|
||||||
|
#page_site-info
|
||||||
|
h1#site_title=site_title
|
||||||
22
layout/includes/header/menu_item.pug
Normal file
22
layout/includes/header/menu_item.pug
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
.menus_items
|
||||||
|
each value, label in theme.menu
|
||||||
|
if !Array.isArray(value)
|
||||||
|
.menus_item
|
||||||
|
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||||
|
if value.split('||')[1]
|
||||||
|
i.fa-fw(class=trim(value.split('||')[1]))
|
||||||
|
span=' '+label
|
||||||
|
else
|
||||||
|
.menus_item
|
||||||
|
a.site-page
|
||||||
|
if label.split('||')[1]
|
||||||
|
i.fa-fw(class=trim(label.split('||')[1]) )
|
||||||
|
span=' '+ trim(label.split('||')[0])
|
||||||
|
i.fas.fa-chevron-down.menus-expand
|
||||||
|
ul.menus_item_child
|
||||||
|
each i in value
|
||||||
|
li
|
||||||
|
a.site-page(href=url_for(trim(i.split('||')[1])))
|
||||||
|
if i.split('||')[2]
|
||||||
|
i.fa-fw(class=trim(i.split('||')[2]))
|
||||||
|
span=' '+trim(i.split('||')[0])
|
||||||
17
layout/includes/header/nav.pug
Normal file
17
layout/includes/header/nav.pug
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
nav#nav
|
||||||
|
span#blog_name.pull-left
|
||||||
|
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||||
|
|
||||||
|
span.pull-right.menus
|
||||||
|
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||||
|
#search_button
|
||||||
|
a.site-page.social-icon.search
|
||||||
|
i.fas.fa-search.fa-fw
|
||||||
|
span=' '+_p('search')
|
||||||
|
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||||
|
|
||||||
|
span.toggle-menu.close
|
||||||
|
a.site-page
|
||||||
|
i.fas.fa-bars.fa-fw
|
||||||
|
|
||||||
|
|
||||||
88
layout/includes/header/post-info.pug
Normal file
88
layout/includes/header/post-info.pug
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
#post-info
|
||||||
|
#post-title
|
||||||
|
.posttitle= page.title || _p('no_title')
|
||||||
|
|
||||||
|
#post-meta
|
||||||
|
.meta-firstline
|
||||||
|
if (theme.post_meta.post.date_type)
|
||||||
|
if (theme.post_meta.post.date_type === 'both')
|
||||||
|
time.post-meta__date
|
||||||
|
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date))
|
||||||
|
i.far.fa-calendar-alt.fa-fw
|
||||||
|
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||||
|
span.post-meta__separator |
|
||||||
|
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated))
|
||||||
|
i.fas.fa-history.fa-fw
|
||||||
|
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||||
|
else
|
||||||
|
- var data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||||
|
- var date_type = data_type_update ? 'updated' : 'date'
|
||||||
|
- var date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt'
|
||||||
|
- var data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||||
|
time.post-meta__date(title=data_info + ' ' + full_date(page[date_type]))
|
||||||
|
i.fa-fw(class=date_icon)
|
||||||
|
=' ' + data_info + ' ' + date(page[date_type], config.date_format)
|
||||||
|
|
||||||
|
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||||
|
span.post-meta__categories
|
||||||
|
if (theme.post_meta.post.date_type)
|
||||||
|
span.post-meta__separator |
|
||||||
|
|
||||||
|
each item, index in page.categories.data
|
||||||
|
i.fas.fa-inbox.fa-fw.post-meta__icon
|
||||||
|
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||||
|
if (index < page.categories.data.length - 1)
|
||||||
|
i.fas.fa-angle-right.post-meta__separator
|
||||||
|
|
||||||
|
.meta-secondline
|
||||||
|
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||||
|
if (postWordcount)
|
||||||
|
span.post-meta-wordcount
|
||||||
|
if theme.wordcount.post_wordcount
|
||||||
|
i.far.fa-file-word.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.wordcount') + ':'
|
||||||
|
span.word-count= wordcount(page.content)
|
||||||
|
if theme.wordcount.min2read
|
||||||
|
span.post-meta__separator |
|
||||||
|
if theme.wordcount.min2read
|
||||||
|
i.far.fa-clock.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||||
|
|
||||||
|
.meta-thirdline
|
||||||
|
span.post-meta-pv-cv
|
||||||
|
if (postWordcount && theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
if theme.busuanzi.page_pv
|
||||||
|
i.far.fa-eye.fa-fw.post-meta__icon
|
||||||
|
span=_p('post.page_pv') + ':'
|
||||||
|
span#busuanzi_value_page_pv
|
||||||
|
|
||||||
|
span.post-meta-commentcount
|
||||||
|
if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.far.fa-comments.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
span.disqus-comment-count.comment-count
|
||||||
|
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||||
|
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.far.fa-comments.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||||
|
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||||
|
else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.far.fa-comments.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a(href=url_for(page.path) + '#post-comment')
|
||||||
|
span.gitalk-comment-count.comment-count
|
||||||
|
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false
|
||||||
|
if (postWordcount || theme.busuanzi.page_pv)
|
||||||
|
span.post-meta__separator |
|
||||||
|
i.far.fa-comments.fa-fw.post-meta__icon
|
||||||
|
span= _p('post.comments') + ':'
|
||||||
|
a.comment-count(href=url_for(page.path) + '#post-comment')
|
||||||
|
span.fb-comments-count(data-href=urlNoIndex())
|
||||||
4
layout/includes/header/social.pug
Normal file
4
layout/includes/header/social.pug
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
each url, icon in theme.social
|
||||||
|
a.social-icon(href=url_for(trim(url.split('||')[0])) target="_blank"
|
||||||
|
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
|
||||||
|
i(class=icon)
|
||||||
@@ -1,92 +1,48 @@
|
|||||||
|
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||||
- var pageTitle = page.title || config.subtitle || ''
|
- var pageHighlightShrinkSet = page.highlight_shrink !== undefined ? page.highlight_shrink : theme.highlight_shrink
|
||||||
- if (is_archive()) pageTitle = _p('page.archives')
|
- var pageHighlightShrink = theme.highlight_shrink !== 'none' && pageHighlightShrinkSet ? 'code-close' : ''
|
||||||
- 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
|
|
||||||
|
|
||||||
- var pageDescription = page.description || page.title || config.description || ''
|
|
||||||
- var pageKeywords = (config.keywords || []).join(',')
|
|
||||||
- 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 body_class = theme.display_mode == 'night' ? 'night-mode' : ''
|
|
||||||
|
|
||||||
|
|
||||||
doctype html
|
doctype html
|
||||||
html(lang=config.language)
|
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=1")
|
|
||||||
title= pageTitle
|
|
||||||
meta(name="description" content=pageDescription)
|
|
||||||
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')
|
|
||||||
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
|
||||||
each url in theme.stylesheets
|
|
||||||
link(rel='stylesheet', href=url_for(url))
|
|
||||||
each item in theme.cdn.css
|
|
||||||
if item !== undefined
|
|
||||||
link(rel='stylesheet', href=item)
|
|
||||||
include ./head.pug
|
include ./head.pug
|
||||||
include ./config.pug
|
body
|
||||||
body(class=body_class)
|
if theme.preloader
|
||||||
|
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.fireworks && theme.fireworks.enable
|
if theme.fireworks && theme.fireworks.enable
|
||||||
canvas.fireworks
|
canvas.fireworks
|
||||||
if theme.background
|
|
||||||
#web_bg
|
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
|
||||||
if (is_post() && page.toc != false && theme.toc.enable)
|
|
||||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
|
||||||
include ./sidebar.pug
|
include ./sidebar.pug
|
||||||
|
|
||||||
|
#body-wrap(class=pageHighlightShrink)
|
||||||
|
if theme.background
|
||||||
|
- var is_photo = theme.background.startsWith('url') ? 'photo':'color'
|
||||||
|
#web_bg(data-type=is_photo)
|
||||||
|
|
||||||
|
include ./header/index.pug
|
||||||
|
|
||||||
if (!is_post())
|
if (!is_post())
|
||||||
include ./nav.pug
|
main#content-inner.layout_page(class=hideAside)
|
||||||
#content-outer
|
|
||||||
block top_img
|
|
||||||
if (!is_post())
|
|
||||||
#content-inner.layout_page
|
|
||||||
if body
|
if body
|
||||||
div!= body
|
div!= body
|
||||||
else
|
else
|
||||||
block content
|
block content
|
||||||
|
include widget/index.pug
|
||||||
else
|
else
|
||||||
#content-inner.layout.layout_post
|
main#content-inner.layout_post
|
||||||
if body
|
if body
|
||||||
div!= body
|
div!= body
|
||||||
else
|
else
|
||||||
block content
|
block content
|
||||||
|
|
||||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||||
footer(style=footer_bg)
|
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
|
||||||
include ./footer.pug
|
footer#footer(style=footer_bg data-type=is_bg)
|
||||||
i.fa.fa-arrow-up#go-up(aria-hidden="true")
|
!=partial('includes/footer', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
include ./rightside.pug
|
include ./rightside.pug
|
||||||
if (is_post())
|
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||||
include ./post-bottom.pug
|
|
||||||
each item in theme.cdn.js
|
|
||||||
if item !== undefined
|
|
||||||
script(src=url_for(item))
|
|
||||||
if theme.scripts !== undefined && theme.scripts.length > 0
|
|
||||||
//- scripts list from config.yml
|
|
||||||
each url in theme.scripts
|
|
||||||
script(src=url_for(url))
|
|
||||||
include ./additional-js.pug
|
include ./additional-js.pug
|
||||||
include ./search/index.pug
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
6
layout/includes/loading/loading-js.pug
Normal file
6
layout/includes/loading/loading-js.pug
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
script.
|
||||||
|
var endLoading = function () {
|
||||||
|
document.body.style.overflow = 'auto';
|
||||||
|
document.getElementById('loading-box').classList.add("loaded")
|
||||||
|
}
|
||||||
|
window.addEventListener('load',endLoading)
|
||||||
9
layout/includes/loading/loading.pug
Normal file
9
layout/includes/loading/loading.pug
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#loading-box
|
||||||
|
.loading-left-bg
|
||||||
|
.loading-right-bg
|
||||||
|
.spinner-box
|
||||||
|
.configure-border-1
|
||||||
|
.configure-core
|
||||||
|
.configure-border-2
|
||||||
|
.configure-core
|
||||||
|
.loading-word= _p('loading')
|
||||||
15
layout/includes/math/index.pug
Normal file
15
layout/includes/math/index.pug
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if theme.mathjax && theme.mathjax.enable
|
||||||
|
if theme.mathjax.per_page
|
||||||
|
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
include ./mathjax.pug
|
||||||
|
else
|
||||||
|
if page.mathjax
|
||||||
|
include ./mathjax.pug
|
||||||
|
|
||||||
|
if theme.katex && theme.katex.enable
|
||||||
|
if theme.katex.per_page
|
||||||
|
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||||
|
include ./katex.pug
|
||||||
|
else
|
||||||
|
if page.katex
|
||||||
|
include ./katex.pug
|
||||||
7
layout/includes/math/katex.pug
Normal file
7
layout/includes/math/katex.pug
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
link(rel="stylesheet" type="text/css" href=theme.CDN.katex)
|
||||||
|
script(src=url_for(theme.CDN.katex_copytex))
|
||||||
|
link(rel="stylesheet" type="text/css" href=theme.CDN.katex_copytex_css)
|
||||||
|
script.
|
||||||
|
$(function () {
|
||||||
|
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
||||||
|
})
|
||||||
@@ -24,4 +24,4 @@ script(type="text/x-mathjax-config").
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
script(src=theme.mathjax.cdn)
|
script(src=theme.CDN.mathjax)
|
||||||
8
layout/includes/math/mermaid.pug
Normal file
8
layout/includes/math/mermaid.pug
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
script.
|
||||||
|
if (document.getElementsByClassName('mermaid').length) {
|
||||||
|
loadScript('!{theme.CDN.mermaid}',function () {
|
||||||
|
mermaid.initialize({
|
||||||
|
theme: '!{theme.mermaid.theme}',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -3,10 +3,18 @@ mixin articleSort(posts)
|
|||||||
- var year
|
- var year
|
||||||
- posts.each(function (article) {
|
- posts.each(function (article) {
|
||||||
- var tempYear = date(article.date, 'YYYY')
|
- var tempYear = date(article.date, 'YYYY')
|
||||||
|
- var no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
|
||||||
if tempYear !== year
|
if tempYear !== year
|
||||||
- year = tempYear
|
- year = tempYear
|
||||||
.article-sort-item.year= year
|
.article-sort-item.year= year
|
||||||
.article-sort-item
|
.article-sort-item(class=no_cover)
|
||||||
time.article-sort-item__time= date(article.date)
|
if article.cover && theme.cover.archives_enable
|
||||||
a.article-sort-item__title(href=url_for(article.path))= article.title || 'No Title'
|
.article-sort-img
|
||||||
|
a.article-sort-item__img(href=url_for(article.path))
|
||||||
|
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'`)
|
||||||
|
.article-sort-post
|
||||||
|
a.article-sort-item__post(href=url_for(article.path))
|
||||||
|
i.far.fa-calendar-alt
|
||||||
|
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
||||||
|
.article-sort-item__title= article.title || 'No Title'
|
||||||
- })
|
- })
|
||||||
78
layout/includes/mixins/post-ui.pug
Normal file
78
layout/includes/mixins/post-ui.pug
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
mixin postUI(posts)
|
||||||
|
each article , index in page.posts.data
|
||||||
|
.recent-post-item
|
||||||
|
- var link = article.link || article.path
|
||||||
|
- var title = article.title || _p('no_title')
|
||||||
|
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||||
|
- var post_cover = article.cover
|
||||||
|
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||||
|
if post_cover && theme.cover.index_enable
|
||||||
|
.post_cover(class=leftOrRight)
|
||||||
|
a(href=url_for(link) title=title)
|
||||||
|
if theme.lazyload.enable
|
||||||
|
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
|
||||||
|
else
|
||||||
|
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
|
||||||
|
.recent-post-info(class=no_cover)
|
||||||
|
a.article-title(href=url_for(link) title=title)= title
|
||||||
|
.article-meta-wrap
|
||||||
|
if (is_home() && (article.top || article.sticky > 0))
|
||||||
|
span.article-meta
|
||||||
|
i.fas.fa-thumbtack.article-meta__icon.sticky
|
||||||
|
span.sticky= _p('sticky')
|
||||||
|
span.article-meta__separator |
|
||||||
|
if (theme.post_meta.page.date_type)
|
||||||
|
if (theme.post_meta.page.date_type === 'both')
|
||||||
|
time.post-meta__date
|
||||||
|
span.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date))
|
||||||
|
i.far.fa-calendar-alt
|
||||||
|
=date(article.date, config.date_format)
|
||||||
|
span.article-meta__separator |
|
||||||
|
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
|
||||||
|
i.fas.fa-history
|
||||||
|
=date(article.updated, config.date_format)
|
||||||
|
else
|
||||||
|
- var data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||||
|
- var date_type = data_type_updated ? 'updated' : 'date'
|
||||||
|
- var date_icon = data_type_updated ? 'fas fa-history' :'far fa-calendar-alt'
|
||||||
|
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created')
|
||||||
|
time.post-meta__date(title=date_title + ' ' + full_date(article[date_type]))
|
||||||
|
i(class=date_icon)
|
||||||
|
=date(article[date_type], config.date_format)
|
||||||
|
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||||
|
span.article-meta
|
||||||
|
span.article-meta__separator |
|
||||||
|
i.fas.fa-inbox.article-meta__icon
|
||||||
|
each item, index in article.categories.data
|
||||||
|
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||||
|
if (index < article.categories.data.length - 1)
|
||||||
|
i.fas.fa-angle-right
|
||||||
|
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||||
|
span.article-meta.tags
|
||||||
|
span.article-meta__separator |
|
||||||
|
i.fas.fa-tag.article-meta__icon
|
||||||
|
each item, index in article.tags.data
|
||||||
|
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||||
|
if (index < article.tags.data.length - 1)
|
||||||
|
span.article-meta__link #[='•']
|
||||||
|
|
||||||
|
//- Display the article introduction on homepage
|
||||||
|
if theme.index_post_content.method == 1
|
||||||
|
.content!= article.description
|
||||||
|
else if theme.index_post_content.method == 2
|
||||||
|
if article.description
|
||||||
|
.content!= article.description
|
||||||
|
else
|
||||||
|
- const content = strip_html(article.content)
|
||||||
|
- let expert = content.substring(0, theme.index_post_content.length)
|
||||||
|
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||||
|
.content!= expert
|
||||||
|
else
|
||||||
|
- const content = strip_html(article.content)
|
||||||
|
- let expert = content.substring(0, theme.index_post_content.length)
|
||||||
|
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||||
|
.content!= expert
|
||||||
|
|
||||||
|
if theme.ad && theme.ad.index
|
||||||
|
if (index + 1) % 3 == 0
|
||||||
|
.recent-post-item.ad_height!=theme.ad.index
|
||||||
3
layout/includes/mobile-sidebar/index.pug
Normal file
3
layout/includes/mobile-sidebar/index.pug
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#mobile-sidebar
|
||||||
|
#menu_mask
|
||||||
|
include ../mobile-sidebar/mobile-menus.pug
|
||||||
26
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
26
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#mobile-sidebar-menus
|
||||||
|
.mobile_author_icon
|
||||||
|
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar")
|
||||||
|
.mobile_post_data
|
||||||
|
if site.posts.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.archive_dir) + '/')
|
||||||
|
.headline= _p('aside.articles')
|
||||||
|
.length_num= site.posts.length
|
||||||
|
|
||||||
|
if site.tags.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.tag_dir) + '/' )
|
||||||
|
.headline= _p('aside.tags')
|
||||||
|
.length_num= site.tags.length
|
||||||
|
|
||||||
|
if site.categories.length
|
||||||
|
.mobile_data_item.is-center
|
||||||
|
.mobile_data_link
|
||||||
|
a(href=url_for(config.category_dir) + '/')
|
||||||
|
.headline= _p('aside.categories')
|
||||||
|
.length_num= site.categories.length
|
||||||
|
hr
|
||||||
|
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
if (is_archive())
|
|
||||||
- var top_img = theme.archive_img ||theme.top_img || config.top_img
|
|
||||||
else
|
|
||||||
- var top_img = page.top_img||theme.top_img || config.top_img
|
|
||||||
|
|
||||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
|
||||||
|
|
||||||
|
|
||||||
if is_home()
|
|
||||||
nav#nav.full_page
|
|
||||||
.nav_bg(style=bg_img)
|
|
||||||
include ./header.pug
|
|
||||||
#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)
|
|
||||||
|
|
||||||
.scroll-down
|
|
||||||
i.fa.fa-angle-down.scroll-down-effects
|
|
||||||
|
|
||||||
else
|
|
||||||
nav#nav.not_index_bg
|
|
||||||
.nav_bg(style=bg_img)
|
|
||||||
include ./header.pug
|
|
||||||
#page_site-info
|
|
||||||
#site-title
|
|
||||||
if (is_archive())
|
|
||||||
span.blogtitle= _p('archives')
|
|
||||||
else
|
|
||||||
span.blogtitle= page.title || page.tag || page.category || config.title
|
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
-
|
-
|
||||||
var options = {
|
var options = {
|
||||||
prev_text: '<i class="fa fa-chevron-left"></i>',
|
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
|
||||||
next_text: '<i class="fa fa-chevron-right"></i>',
|
next_text: '<i class="fas fa-chevron-right fa-fw"></i>',
|
||||||
mid_size: 1
|
mid_size: 1,
|
||||||
|
escape: false
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_post())
|
if(!is_post())
|
||||||
@@ -10,53 +11,29 @@ if(!is_post())
|
|||||||
div.pagination
|
div.pagination
|
||||||
!=paginator(options)
|
!=paginator(options)
|
||||||
else
|
else
|
||||||
nav#pagination.pagination_post
|
nav#pagination.pagination-post
|
||||||
if(page.prev)
|
if(page.prev)
|
||||||
if(page.next)
|
- var hasPageNext = page.next ? 'pull-left' : 'pull-full'
|
||||||
.prev-post.pull-left
|
.prev-post(class=hasPageNext)
|
||||||
- var pagination_cover = page.prev.cover || random_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.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` )
|
||||||
else
|
else
|
||||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.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 || random_cover()
|
|
||||||
a(href=url_for(page.prev.path))
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.prev_cover.lozad(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 || random_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.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`)
|
||||||
else
|
else
|
||||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.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 || random_cover()
|
|
||||||
a(href=url_for(page.next.path))
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.next_cover.lozad(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
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
- var no_comment_show = page.comments !== false ? '' : 'no_comment_show'
|
|
||||||
- var no_toc_show = (is_post() && page.toc != false && theme.toc.enable) ? '' : 'no_toc_show'
|
|
||||||
#post_bottom(class= no_comment_show + ' ' + no_toc_show)
|
|
||||||
#post_bottom_items
|
|
||||||
if page.comments !== false
|
|
||||||
a#mobile_to_comment(href="#post-comment")
|
|
||||||
i.mobile_scroll_to_comment.fa.fa-comments
|
|
||||||
|
|
||||||
if (is_post() && page.toc != false && theme.toc.enable)
|
|
||||||
i#mobile_toc.fa.fa-list
|
|
||||||
#toc_mobile
|
|
||||||
.toc_mobile_headline= _p('sidebar.catalog')
|
|
||||||
if (page.encrypt == true)
|
|
||||||
.toc-div-class(style="display:none")!=toc(page.origin,{"class":"toc_mobile_items"})
|
|
||||||
else
|
|
||||||
!=toc(page.content,{"class":"toc_mobile_items"})
|
|
||||||
|
|
||||||
13
layout/includes/post/post-copyright.pug
Normal file
13
layout/includes/post/post-copyright.pug
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
|
||||||
|
.post-copyright
|
||||||
|
.post-copyright__author
|
||||||
|
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
||||||
|
span.post-copyright-info
|
||||||
|
a(href=`mailto:${config.email}`) #[=config.author]
|
||||||
|
.post-copyright__type
|
||||||
|
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
||||||
|
span.post-copyright-info
|
||||||
|
a(href=url_for(page.permalink))= theme.post_copyright.decode ? decodeURI(page.permalink) : page.permalink
|
||||||
|
.post-copyright__notice
|
||||||
|
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
||||||
|
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
||||||
12
layout/includes/post/reward.pug
Normal file
12
layout/includes/post/reward.pug
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.post-reward
|
||||||
|
button.reward-button
|
||||||
|
i.fas.fa-qrcode
|
||||||
|
= ' ' + _p('donate')
|
||||||
|
.reward-main
|
||||||
|
ul.reward-all
|
||||||
|
each item in theme.reward.QR_code
|
||||||
|
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
|
||||||
|
li.reward-item
|
||||||
|
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text onclick=`window.open('${url_for(clickTo)}')`)
|
||||||
|
.post-qr-code__desc=(item.itemlist||item).text
|
||||||
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
each article , index in page.posts.data
|
|
||||||
.recent-post-item.article-container
|
|
||||||
- var link = article.link || article.path
|
|
||||||
if index%2 == 0
|
|
||||||
.post_cover.is_left
|
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
|
||||||
- var post_cover = article.cover
|
|
||||||
- var default_post_cover = random_cover()
|
|
||||||
if (post_cover)
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
.post_cover.is_right
|
|
||||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
|
||||||
- var post_cover = article.cover
|
|
||||||
- var default_post_cover = random_cover()
|
|
||||||
if (post_cover)
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
if theme.lazyload.enable
|
|
||||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
else
|
|
||||||
img.post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
|
||||||
.recent-post-info
|
|
||||||
a.article-title(href=url_for(link) title= article.title || _p('no_title'))= article.title || _p('no_title')
|
|
||||||
if (article.top)
|
|
||||||
span.article-meta
|
|
||||||
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
|
||||||
span.sticky= _p('sticky')
|
|
||||||
span.article-meta__separator(style="margin-right: 0.3rem") |
|
|
||||||
if (theme.post_meta.date_type)
|
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
|
|
||||||
if (theme.post_meta.categories && article.categories.data.length > 0)
|
|
||||||
span.article-meta
|
|
||||||
span.article-meta__separator |
|
|
||||||
each item, index in article.categories.data
|
|
||||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
|
||||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
|
||||||
if (index < article.categories.data.length - 1)
|
|
||||||
i.fa.fa-angle-right(aria-hidden="true")
|
|
||||||
//- if (theme.post_meta.tags && article.tags.data.length > 0)
|
|
||||||
//- span.article-meta.tags
|
|
||||||
//- span.article-meta__separator |
|
|
||||||
//- each item, index in article.tags.data
|
|
||||||
//- i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
|
||||||
//- a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
|
||||||
//- if (index < article.tags.data.length - 1)
|
|
||||||
//- span.article-meta__link -
|
|
||||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
|
||||||
- const content = strip_html(article.content)
|
|
||||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
|
||||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
|
||||||
.content!= expert
|
|
||||||
else
|
|
||||||
.content!= article.description
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
.post-reward
|
|
||||||
a.reward-buttom
|
|
||||||
i.fa.fa-qrcode
|
|
||||||
= ' ' + _p('donate')
|
|
||||||
.reward-main
|
|
||||||
ul.reward-all
|
|
||||||
each item in theme.reward.QR_code
|
|
||||||
li.reward-item
|
|
||||||
img.lozad.post-qr-code__img(src=(item.itemlist||item).img)
|
|
||||||
.post-qr-code__desc=(item.itemlist||item).text
|
|
||||||
|
|
||||||
@@ -1,13 +1,32 @@
|
|||||||
section#rightside.rightside
|
section#rightside.rightside
|
||||||
if is_post() && page.comments !== false
|
#rightside-config-hide
|
||||||
a#to_comment(href="#post-comment")
|
if is_post()
|
||||||
i.scroll_to_comment.fa.fa-comments
|
if theme.readmode
|
||||||
if theme.readmode.enable && is_post()
|
button#readmode(title=_p('rightside.readmode_title'))
|
||||||
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
|
i.fas.fa-book-open
|
||||||
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
button#font_plus(title=_p('rightside.font_plus_title'))
|
||||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
i.fas.fa-plus
|
||||||
|
button#font_minus(title=_p('rightside.font_minus_title'))
|
||||||
|
i.fas.fa-minus
|
||||||
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'))= theme.translate.default
|
button#translateLink.translate_chn_to_cht(title=_p('rightside.translate_title'))= theme.translate.default
|
||||||
if theme.nightshift.enable
|
if theme.darkmode.enable && theme.darkmode.button
|
||||||
- var display_mode = theme.display_mode == 'night'? 'fa fa-sun-o' : 'fa fa-moon-o'
|
button#darkmode(title=_p('rightside.night_mode_title'))
|
||||||
i#nightshift.nightshift(class=display_mode title=_p('rightside.night_mode_title'))
|
i.fas.fa-adjust
|
||||||
|
#rightside-config-show
|
||||||
|
button#rightside_config(title=_p("rightside.setting"))
|
||||||
|
i.fas.fa-cog
|
||||||
|
if is_post() && page.comments !== false && isComment
|
||||||
|
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||||
|
i.scroll_to_comment.fas.fa-comments
|
||||||
|
if showToc
|
||||||
|
button#mobile-toc-button.close(title=_p("rightside.toc"))
|
||||||
|
i.fas.fa-list-ul
|
||||||
|
if theme.chat_btn && (theme.chatra.enable || theme.tidio.enable || theme.daovoice.enable || theme.gitter.enable)
|
||||||
|
button#chat_btn(title=_p("rightside.chat_btn"))
|
||||||
|
i.fas.fa-sms
|
||||||
|
|
||||||
|
button#go-up(title=_p("rightside.back_to_top"))
|
||||||
|
i.fas.fa-arrow-up
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,5 +8,5 @@
|
|||||||
#algolia-pagination
|
#algolia-pagination
|
||||||
#algolia-stats
|
#algolia-stats
|
||||||
span.search-close-button
|
span.search-close-button
|
||||||
i.fa.fa-times
|
i.fas.fa-times
|
||||||
.search-mask
|
.search-mask
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -19,5 +19,5 @@
|
|||||||
span=_p("local_search.powered_by")
|
span=_p("local_search.powered_by")
|
||||||
| #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search]
|
| #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search]
|
||||||
span.search-close-button
|
span.search-close-button
|
||||||
i.fa.fa-times
|
i.fas.fa-times
|
||||||
.search-mask
|
.search-mask
|
||||||
@@ -4,6 +4,6 @@
|
|||||||
a(class="a2a_button_" + name)
|
a(class="a2a_button_" + name)
|
||||||
|
|
||||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||||
script(async src="https://static.addtoany.com/menu/page.js")
|
script(async src=url_for(theme.CDN.addtoany))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (theme.sharejs && theme.sharejs.enable)
|
if (theme.sharejs && theme.sharejs.enable)
|
||||||
.social-share(data-image= page.cover|| theme.avatar data-sites= theme.sharejs.sites)
|
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||||
link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css")
|
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||||
script(src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js")
|
script(src=url_for(theme.CDN.sharejs))
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
|
|
||||||
- var sidebar_class = theme.auto_open_sidebar.enable === true ? 'auto_open' : ''
|
|
||||||
|
|
||||||
#sidebar(class=sidebar_class)
|
|
||||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
|
||||||
-
|
-
|
||||||
let tocNumber
|
let tocNumber = page.toc_number !== undefined ? page.toc_number : theme.toc.number
|
||||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
let autoOpenPostSet = page.auto_open == undefined ? theme.toc.auto_open : page.auto_open
|
||||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
let autoOpenSidebar = autoOpenPostSet ? 'on' : ''
|
||||||
else tocNumber = true
|
|
||||||
-
|
-
|
||||||
|
|
||||||
if(showToc)
|
if(showToc)
|
||||||
|
i.fas.fa-arrow-right#toggle-sidebar(class=autoOpenSidebar)
|
||||||
|
#sidebar
|
||||||
.sidebar-toc
|
.sidebar-toc
|
||||||
div.sidebar-toc__title= _p('sidebar.catalog')
|
div.sidebar-toc__title= _p('sidebar.catalog')
|
||||||
div.sidebar-toc__progress
|
div.sidebar-toc__progress
|
||||||
|
|||||||
2
layout/includes/third-party/canvas-nest.pug
vendored
2
layout/includes/third-party/canvas-nest.pug
vendored
@@ -1 +1 @@
|
|||||||
script(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count src=url_for(theme.canvas_nest.script))
|
script#canvas_nest(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.CDN.canvas_nest))
|
||||||
@@ -1 +1 @@
|
|||||||
script(id="ribbon" src=url_for('https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/js/piao.js'))
|
script(id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
script(id="ribbon" src=url_for('/js/third-party/canvas-ribbon.js') 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 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}`)
|
||||||
|
|
||||||
|
|||||||
7
layout/includes/third-party/katex.pug
vendored
7
layout/includes/third-party/katex.pug
vendored
@@ -1,7 +0,0 @@
|
|||||||
link(rel="stylesheet" type="text/css" href=theme.katex.cdn.css)
|
|
||||||
script(src='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js')
|
|
||||||
link(rel="stylesheet" type="text/css" href='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css')
|
|
||||||
script.
|
|
||||||
$(function () {
|
|
||||||
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
|
||||||
})
|
|
||||||
12
layout/includes/third-party/pangu.pug
vendored
Normal file
12
layout/includes/third-party/pangu.pug
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
script(src=url_for(theme.CDN.pangu))
|
||||||
|
if theme.pangu.field === 'post' && is_post()
|
||||||
|
script.
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
pangu.autoSpacingPage()
|
||||||
|
})
|
||||||
|
else if theme.pangu.field === 'site'
|
||||||
|
script.
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
pangu.autoSpacingPage()
|
||||||
|
})
|
||||||
|
|
||||||
2
layout/includes/widget/card_ad.pug
Normal file
2
layout/includes/widget/card_ad.pug
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.card-widget.card-ad
|
||||||
|
!= theme.ad.aside
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
.card_widget.card-announcement
|
.card-widget.card-announcement
|
||||||
.card-content
|
.card-content
|
||||||
.item_headline
|
.item-headline
|
||||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
i.fas.fa-bullhorn.card-announcement-animation
|
||||||
span= _p('aside.card_announcement')
|
span= _p('aside.card_announcement')
|
||||||
.announcement_content= theme.announcement.content
|
.announcement_content!= theme.aside.card_announcement.content
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
.card_widget.card-archives
|
.card-widget.card-archives
|
||||||
.card-content
|
.card-content
|
||||||
.item_headline
|
.item-headline
|
||||||
i.fa.fa-archive(aria-hidden="true")
|
i.fas.fa-archive
|
||||||
span= _p('aside.card_archives')
|
span= _p('aside.card_archives')
|
||||||
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
|
||||||
|
- let type = theme.aside.card_archives.type || 'monthly'
|
||||||
|
- let format = theme.aside.card_archives.format || 'MMMM YYYY'
|
||||||
|
- let order = theme.aside.card_archives.order || -1
|
||||||
|
- let limit = theme.aside.card_archives.limit === 0 ? 0 : theme.aside.card_archives.limit || 8
|
||||||
|
!= aside_archives({ type:type, format: format, order: order, limit: limit })
|
||||||
|
|||||||
@@ -1,41 +1,34 @@
|
|||||||
.card_widget.card-author
|
.card-widget.card-info
|
||||||
.card-content
|
.card-content
|
||||||
.post_data
|
.card-info-avatar.is-center
|
||||||
.data-item.text-center
|
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
|
||||||
img.lozad.avatar_img(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
.author-info__name= config.author
|
||||||
p.author-info__name.text-center= config.author
|
.author-info__description!= theme.aside.card_author.description || config.description
|
||||||
p.author-info__description.text-center= config.description
|
|
||||||
|
|
||||||
.post_data.data_config
|
.card-info-data
|
||||||
if site.posts.length
|
if site.posts.length
|
||||||
.data-item.text-center
|
.card-info-data-item.is-center
|
||||||
.data_link
|
a(href=url_for(config.archive_dir))
|
||||||
a(href=url_for(config.archive_dir) + '/')
|
.headline= _p('aside.articles')
|
||||||
p.headline= _p('aside.articles')
|
.length_num= site.posts.length
|
||||||
p.length_num= site.posts.length
|
|
||||||
|
|
||||||
if site.tags.length
|
if site.tags.length
|
||||||
.data-item.text-center
|
.card-info-data-item.is-center
|
||||||
.data_link
|
a(href=url_for(config.tag_dir))
|
||||||
a(href=url_for(config.tag_dir) + '/' )
|
.headline= _p('aside.tags')
|
||||||
p.headline= _p('aside.tags')
|
.length_num= site.tags.length
|
||||||
p.length_num= site.tags.length
|
|
||||||
|
|
||||||
if site.categories.length
|
if site.categories.length
|
||||||
.data-item.text-center
|
.card-info-data-item.is-center
|
||||||
.data_link
|
a(href=url_for(config.category_dir))
|
||||||
a(href=url_for(config.category_dir) + '/')
|
.headline= _p('aside.categories')
|
||||||
p.headline= _p('aside.categories')
|
.length_num= site.categories.length
|
||||||
p.length_num= site.categories.length
|
|
||||||
|
|
||||||
.post_data.text-center
|
|
||||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
|
||||||
|
|
||||||
|
|
||||||
|
.card-info-bookmark.is-center
|
||||||
|
button#bookmark-it.button--animated(title= _p('aside.card_bookmark'))
|
||||||
|
i.fas.fa-bookmark
|
||||||
|
span= _p('aside.card_bookmark') || 'Follow Me'
|
||||||
|
|
||||||
if(theme.social)
|
if(theme.social)
|
||||||
.post_data.data_config
|
.card-info-social-icons.is-center
|
||||||
#aside-social-icons
|
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||||
each url, icon in theme.social
|
|
||||||
a.social-icon.data-item(href=url target="_blank")
|
|
||||||
i(class=icon)
|
|
||||||
|
|||||||
@@ -1,23 +1,9 @@
|
|||||||
if site.categories.length
|
if site.categories.length
|
||||||
.card_widget.card-categories
|
.card-widget.card-categories
|
||||||
.card-content
|
.card-content
|
||||||
.item_headline
|
.item-headline
|
||||||
i.fa.fa-folder-open(aria-hidden="true")
|
i.fas.fa-folder-open
|
||||||
span= _p('aside.card_categories')
|
span= _p('aside.card_categories')
|
||||||
ul.aside_category_item
|
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 , expand: theme.aside.card_categories.expand })
|
||||||
mixin displayCategories(parent = undefined)
|
|
||||||
- site.categories.find({ parent }).sort("name").each(function(category) {
|
|
||||||
- var childCount = site.categories.find({ parent: category._id }).count();
|
|
||||||
li.aside_category_list
|
|
||||||
a.aside_category_list_link(href=url_for(category.path))
|
|
||||||
span.aside_category_list_name= category.name
|
|
||||||
span.aside_category_list_length= category.length
|
|
||||||
|
|
||||||
if childCount > 0
|
|
||||||
ul.aside_category_item.child
|
|
||||||
+displayCategories(category._id)
|
|
||||||
- })
|
|
||||||
|
|
||||||
+displayCategories()
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,26 @@
|
|||||||
.card_widget.card-recent-post
|
.card-widget.card-recent-post
|
||||||
.card-content
|
.card-content
|
||||||
.item_headline
|
.item-headline
|
||||||
i.fa.fa-history(aria-hidden="true")
|
i.fas.fa-history
|
||||||
span= _p('aside.card_recent_post')
|
span= _p('aside.card_recent_post')
|
||||||
.aside_recent_item
|
.aside-recent-item
|
||||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||||
.aside_recent_post
|
- site.posts.sort('date', -1).limit(postLimit).each(function(article){
|
||||||
|
.aside-recent-post
|
||||||
- var link = article.link || article.path
|
- var link = article.link || article.path
|
||||||
a(href=url_for(link))
|
- 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
|
- var post_cover = article.cover
|
||||||
- var default_post_cover = random_cover()
|
|
||||||
.aside_post_cover
|
a(href=url_for(link))
|
||||||
if (post_cover)
|
if post_cover && theme.cover.aside_enable
|
||||||
|
.aside-post-cover
|
||||||
if theme.lazyload.enable
|
if theme.lazyload.enable
|
||||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
img.aside-post-bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title)
|
||||||
else
|
else
|
||||||
img.aside_post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title)
|
||||||
else
|
.aside-post-title(class=no_cover)
|
||||||
if theme.lazyload.enable
|
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||||
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||||
else
|
|
||||||
img.aside_post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
|
||||||
div#aside_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)
|
|
||||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
|
||||||
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
|
||||||
|
|
||||||
- })
|
- })
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
if site.tags.length
|
if site.tags.length
|
||||||
.card_widget.card-tags
|
.card-widget.card-tags
|
||||||
.card-content
|
.card-content
|
||||||
.item_headline
|
.item-headline
|
||||||
i.fa.fa-tags(aria-hidden="true")
|
i.fas.fa-tags
|
||||||
span= _p('aside.card_tags')
|
span= _p('aside.card_tags')
|
||||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
|
||||||
|
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
|
||||||
|
if theme.aside.card_tags.color
|
||||||
|
.card-tag-cloud!=cloudTags({source: site.tags, minfontsize: 16, maxfontsize: 22, limit: tagLimit})
|
||||||
|
else
|
||||||
|
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 22, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
.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.fas.fa-chart-line
|
||||||
span= _p('aside.card_webinfo.headline')
|
span= _p('aside.card_webinfo.headline')
|
||||||
.webinfo
|
.webinfo
|
||||||
.webinfo_item
|
.webinfo-item
|
||||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
.webinfo-article-name= _p('aside.card_webinfo.article_name') + " :"
|
||||||
.webinfo_article_count= site.posts.length
|
.webinfo-article-count= site.posts.length
|
||||||
if theme.runtimeshow.enable
|
if theme.runtimeshow.enable
|
||||||
.webinfo_item
|
.webinfo-item
|
||||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||||
#webinfo_runtime_count.webinfo_runtime_count
|
#webinfo-runtime-count.webinfo-runtime-count(publish_date=theme.runtimeshow.publish_date)
|
||||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
if theme.wordcount.enable && theme.wordcount.total_wordcount
|
||||||
|
.webinfo-item
|
||||||
|
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :"
|
||||||
|
.webinfo-site-wordcount=totalcount(site)
|
||||||
if theme.busuanzi.site_uv
|
if theme.busuanzi.site_uv
|
||||||
.webinfo_item
|
.webinfo-item
|
||||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
.webinfo-site-uv-name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
.webinfo-site-uv-count#busuanzi_value_site_uv
|
||||||
if theme.busuanzi.site_pv
|
if theme.busuanzi.site_pv
|
||||||
.webinfo_item
|
.webinfo-item
|
||||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
.webinfo-site-name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
.webinfo-site-pv-count#busuanzi_value_site_pv
|
||||||
|
|
||||||
|
|||||||
19
layout/includes/widget/index.pug
Normal file
19
layout/includes/widget/index.pug
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
if theme.aside.enable
|
||||||
|
if page.aside !== false
|
||||||
|
#aside_content.aside_content
|
||||||
|
if theme.aside.card_author.enable
|
||||||
|
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_announcement.enable
|
||||||
|
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_recent_post.enable
|
||||||
|
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.ad && theme.ad.aside
|
||||||
|
!=partial('includes/widget/card_ad', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_categories.enable
|
||||||
|
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_tags.enable
|
||||||
|
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_archives.enable
|
||||||
|
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
|
||||||
|
if theme.aside.card_webinfo
|
||||||
|
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
include ./includes/mixins/post-ui.pug
|
||||||
#recent-posts.recent-posts
|
#recent-posts.recent-posts
|
||||||
include includes/recent-posts.pug
|
+postUI
|
||||||
include includes/pagination.pug
|
include includes/pagination.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/aside.pug
|
|
||||||
@@ -6,20 +6,14 @@ block content
|
|||||||
.tag-cloud__title= _p('page.tag')
|
.tag-cloud__title= _p('page.tag')
|
||||||
| -
|
| -
|
||||||
span.tag-cloud__amount= site.tags.length
|
span.tag-cloud__amount= site.tags.length
|
||||||
.tag-cloud-tags!= tags(site.tags)
|
.tag-cloud-tags
|
||||||
|
!=cloudTags({source: site.tags, minfontsize: 15, maxfontsize: 30, limit: 0})
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
include includes/comments/index.pug
|
include includes/comments/index.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/aside.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/aside.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')
|
||||||
| -
|
| -
|
||||||
@@ -27,14 +21,8 @@ block content
|
|||||||
div!= list_categories()
|
div!= list_categories()
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
include includes/comments/index.pug
|
include includes/comments/index.pug
|
||||||
#aside_content.aside_content
|
|
||||||
include includes/aside.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/aside.pug
|
|
||||||
|
|||||||
@@ -1,75 +1,24 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block top_img
|
|
||||||
- var top_img = page.top_img || page.cover || theme.post_meta.top_img || theme.post_img || theme.top_img || config.top_img
|
|
||||||
- var bg_img = top_img !== true ? `background-image: url(${top_img})` : ''
|
|
||||||
div#top-container(style=bg_img)
|
|
||||||
include ./includes/header.pug
|
|
||||||
#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(aria-hidden="true")
|
|
||||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
|
||||||
span.post-meta__separator |
|
|
||||||
i.fa.fa-history(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(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.mobile_hidden |
|
|
||||||
span.mobile_hidden
|
|
||||||
each item, index in page.categories.data
|
|
||||||
i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
|
|
||||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
|
||||||
if (index < page.categories.data.length - 1)
|
|
||||||
i.fa.fa-angle-right(aria-hidden="true")
|
|
||||||
if (theme.wordcount && theme.wordcount.enable)
|
|
||||||
.post-meta-wordcount
|
|
||||||
span= _p('post.wordcount') + ': '
|
|
||||||
span.word-count= wordcount(page.content)
|
|
||||||
span.post-meta__separator |
|
|
||||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
|
||||||
if theme.busuanzi.page_pv
|
|
||||||
span.post-meta__separator |
|
|
||||||
span= _p('post.page_pv') + ': '
|
|
||||||
span#busuanzi_value_page_pv
|
|
||||||
|
|
||||||
|
|
||||||
block content
|
block content
|
||||||
article#post(class="")
|
article#post(class="")
|
||||||
#post-content.article-container!= page.content
|
#article-container.post-content!=page.content
|
||||||
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
|
include includes/post/post-copyright.pug
|
||||||
.post-copyright
|
|
||||||
.post-copyright__author
|
|
||||||
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
|
||||||
span.post-copyright-info
|
|
||||||
a(href=`mailto:${config.email}`) #[=config.author]
|
|
||||||
.post-copyright__type
|
|
||||||
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
|
||||||
span.post-copyright-info
|
|
||||||
a(href=url_for(page.permalink)) #[=page.permalink]
|
|
||||||
.post-copyright__notice
|
|
||||||
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
|
||||||
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
|
||||||
|
|
||||||
.tag_share
|
.tag_share
|
||||||
if (theme.post_meta.tags)
|
if (theme.post_meta.post.tags)
|
||||||
.post-meta__tag-list
|
.post-meta__tag-list
|
||||||
each item, index in page.tags.data
|
each item, index in page.tags.data
|
||||||
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
||||||
include includes/share/index.pug
|
!=partial('includes/share/index', {}, {cache:theme.fragment_cache})
|
||||||
|
|
||||||
if theme.reward.enable
|
if theme.reward.enable
|
||||||
include includes/reward.pug
|
!=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
|
||||||
include includes/pagination.pug
|
|
||||||
|
|
||||||
|
//- ad
|
||||||
|
if theme.ad && theme.ad.post
|
||||||
|
.post-ad!=theme.ad.post
|
||||||
|
|
||||||
|
include includes/pagination.pug
|
||||||
if theme.related_post && theme.related_post.enable
|
if theme.related_post && theme.related_post.enable
|
||||||
!= related_posts(page,site.posts)
|
!= related_posts(page,site.posts)
|
||||||
if page.comments !== false
|
if page.comments !== false
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
extends includes/layout.pug
|
extends includes/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
if theme.tag_ui == 'index'
|
||||||
|
include ./includes/mixins/post-ui.pug
|
||||||
|
#recent-posts.recent-posts
|
||||||
|
+postUI
|
||||||
|
include includes/pagination.pug
|
||||||
|
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/aside.pug
|
|
||||||
|
|||||||
20
package.json
20
package.json
@@ -1,6 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-melody",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "1.1.5",
|
"version": "2.3.5",
|
||||||
"description": "A Hexo Theme: Butterfly"
|
"private": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
},
|
||||||
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
|
"keywords": [
|
||||||
|
"hexo",
|
||||||
|
"theme",
|
||||||
|
"butterfly",
|
||||||
|
"Card UI Design"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/jerryc127/hexo-theme-butterfly.git",
|
||||||
|
"author": "Jerry <wong@jerryc.me>",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
15
scripts/events/404.js
Normal file
15
scripts/events/404.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Butterfly
|
||||||
|
* 404 error page
|
||||||
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
hexo.extend.generator.register('404', function (locals) {
|
||||||
|
if (!hexo.theme.config.error_404.enable) return
|
||||||
|
return {
|
||||||
|
path: '404.html',
|
||||||
|
data: locals.posts,
|
||||||
|
layout: ['404']
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
|
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict'
|
||||||
|
|
||||||
hexo.on('generateBefore', function () {
|
hexo.on('generateBefore', function () {
|
||||||
const rootConfig = hexo.config
|
const rootConfig = hexo.config
|
||||||
if (hexo.locals.get) {
|
if (hexo.locals.get) {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user