Compare commits

...

68 Commits

171 changed files with 5702 additions and 4169 deletions

View File

@@ -1,21 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- Do not delete the template (不要刪除模板) -->
<!-- <!--
IMPORTANT: Please follow the template to create a new issue. IMPORTANT: Please follow the template to create a new issue.
重要:請依照該模板來提交。 重要:請依照該模板來提交。
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml 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設置去 如果你是由舊版本升級到新版,行時出現報錯請首先把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 If you are a problem when visiting 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是否有報錯反饋時附上你的網站 如果你是線上訪問出現問題請檢查瀏覽器開發人員工具快捷鍵F12的console是否有報錯反饋時附上你的網站
--> -->
## I want to create a new issue <!-- 我想要建立一個新的issue --> ## I want to create a Bug report <!-- 我想要建立一個 Bug report -->
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) --> <!-- 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 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/). - [] Yes, I have read [Butterfly Documentation](https://demo.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. - [] 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 Information
@@ -34,19 +45,17 @@ If you are a problem when visit the website, please open your browser 'developer
## Actual behavior <!-- (實際行為) --> ## Actual behavior <!-- (實際行為) -->
<!-- Please give me the screenshots to locate the issue -->
<!-- 請儘量提供截圖來定位問題 -->
## Steps to reproduce the behavior <!-- (重現步驟) --> ## Steps to reproduce the behavior <!-- (重現步驟) -->
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Feature Request <!-- If applicable, add screenshots to help explain your problem -->
<!-- 請儘量提供截圖來定位問題 -->
## Screenshots <!-- (截圖) -->
<!-- If you have any ideas of theme-butterfly, please write down here and we can have a discussion. --> <!-- Provide your website to find the issues -->
<!-- 如果你有任何關於Butterfly的功能方面的想法可以在這個部分裡寫下來我們一起討論 --> ## Website
--- ## Describe the bug
<!--
Love hexo-theme-butterfly? Please consider starring the repo to support it!
喜歡 hexo-theme-butterfly嗎 考慮一下給它點個star來支援它吧
-->

9
.github/ISSUE_TEMPLATE/custom.md vendored Normal file
View File

@@ -0,0 +1,9 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''
---

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

1
.github/stale.yml vendored
View File

@@ -8,7 +8,6 @@ exemptLabels:
- security - security
- bug - bug
- enhancement - enhancement
- Solved
- documentation - documentation
# Label to use when marking an issue as stale # Label to use when marking an issue as stale
staleLabel: wontfix staleLabel: wontfix

204
LICENSE
View File

@@ -1,8 +1,202 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,16 +1,21 @@
# hexo-theme-butterfly # hexo-theme-butterfly
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></a> ![version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly)
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a> ![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff)
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a> ![hexo version](https://img.shields.io/badge/hexo-4.2+-0e83c)
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a> ![npm download](https://img.shields.io/npm/dw/hexo-theme-butterfly?color=green)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/) Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
Docs: 📖 [Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/)
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme. Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
## Installation ## Installation
### GIT
Stable branch [recommend]: Stable branch [recommend]:
``` ```
@@ -23,6 +28,16 @@ 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
``` ```
### NPM
> It supports Hexo 5.0.0 or later
In Hexo site root directory
```powershell
npm i hexo-theme-butterfly
```
## Configuration ## Configuration
Set theme in the hexo work folder's root config file `_config.yml`: Set theme in the hexo work folder's root config file `_config.yml`:
@@ -33,22 +48,49 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
> npm install hexo-renderer-pug hexo-renderer-stylus > npm install hexo-renderer-pug hexo-renderer-stylus
## Documentation ## Features
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)
- [x] Card UI Design
- [X] Support sub-menu
- [x] Two Column designs
- [x] Responsive Web Design
- [x] Dark Mode
- [x] Pjax
- [x] Read Mode
- [x] Conversion between Traditional and Simplified Chinese
- [X] TOC catalog is available for both computers and mobile phones
- [X] Color themes (darker/pale night/light/ocean/mac/mac light), support custom colors
- [X] Code Blocks (Display code language/close or expand Code Blocks/Copy Button/word wrap)
- [X] Disable copy/Add a Copyright Notice to the Copied Text
- [X] Search (Algolia SearchZ/Local Search)
- [x] Mathjax and Katex
- [x] Built-in 404 page
- [x] WordCount
- [x] Related articles
- [x] Displays outdated notice for a post
- [x] Share (AddThis/Sharejs/Addtoany)
- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Utterances/Facebook Comments)
- [x] Multiple Comment System Support
- [x] Online Chats (Chatra/Tidio/Daovoice/Gitter/Crisp)
- [x] Web analytics (Baidu Analytics/Google Analytics/Tencent Analytics/CNZZ Analytics)
- [x] Google AdSense
- [x] Webmaster Verification (google/Bing/Baidu/360/Yandex)
- [x] Change website colour scheme
- [x] Typewriter Effect: activate_power_mode
- [x] Background effects (Canvas ribbon/canvas_ribbon_piao/canvas_nest)
- [x] Mouse click effects (Fireworks/Heart/Text)
- [x] Preloader/Loading Animation
- [x] Busuanzi visitor counter
- [x] Medium Zoom/Fancybox
- [x] Mermaid
- [x] Justified Gallery
- [x] Lazyload images
- [x] Instantpage/Pangu/Snackbar notification toast/PWA......
## Screenshots ## Screenshots
![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-1.png)
![](https://user-images.githubusercontent.com/16351105/58887457-3cc4b500-8718-11e9-9417-2bdea603c92e.png) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-2.png)
![](https://user-images.githubusercontent.com/16351105/69338594-7d03f980-0c9e-11ea-8b64-7f165e6508e2.png) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-post.png)

View File

@@ -1,28 +1,44 @@
# hexo-theme-butterfly # hexo-theme-butterfly
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></a> ![version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly)
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a> ![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff)
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a> ![hexo version](https://img.shields.io/badge/hexo-4.2+-0e83c)
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a> ![npm download](https://img.shields.io/npm/dw/hexo-theme-butterfly?color=green)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
預覽: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
文檔: 📖 [Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/)
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題 一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
## 安裝 ## 安裝
在你的博客根目錄裡安裝穩定版【推薦】 ### Git 安裝
``` 在博客根目錄裡安裝穩定版【推薦】
```powershell
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分支可以
``` ```powershell
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
``` ```
### npm 安裝
> 此方法只支持Hexo 5.0.0以上版本
在博客根目錄裡
```powershell
npm i hexo-theme-butterfly
```
## 應用主題 ## 應用主題
修改hexo配置文件`_config.yml`,把主題改為`Butterfly` 修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
@@ -30,21 +46,51 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
theme: butterfly theme: butterfly
``` ```
>如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus >如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save
## 文檔 ## 特色
可查看[Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/) - [x] 卡片化設計
- [X] 支持二級目錄
你也可以加入群組 - [x] 雙欄設計
- [x] 響應式主題
[ 💬 QQ群 [推薦]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb) - [x] 夜間模式
- [x] Pjax
[ 💬 Telegram群](https://t.me/hexo_butterfly) - [x] 文章閲讀模式
- [x] 簡體和繁體轉換
- [X] 電腦和手機都可查看TOC目錄
- [X] 內置多種代碼配色darker/pale night/light/ocean/mac/mac light可自定義代碼配色
- [X] 代碼塊顯示代碼語言/關閉或展開代碼塊/代碼複製/代碼自動換行
- [X] 可關閉文字複製/可開啟內容複製增加版權信息)
- [X] 兩種搜索Algolia搜索和本地搜索
- [x] Mathjax 和 Katex
- [x] 內置404頁面
- [x] 顯示字數統計
- [x] 顯示相關文章
- [x] 過期文章提醒
- [x] 多種分享系統AddThis/Sharejs/Addtoany
- [X] 多種評論系統Disqus/Disqusjs/Livere/Gitalk/Valine/Utterances/Facebook Comments
- [x] 支持雙評論部署
- [x] 多種在線聊天Chatra/Tidio/Daovoice/Gitter/Crisp
- [x] 多種分析系統(百度分析/谷歌分析/騰訊分析/CNZZ分析
- [x] 谷歌廣告/手動廣告位置
- [x] 各種站長驗證Google/Bing/Baidu/360/Yandex
- [x] 修改網站配色
- [x] 打字特效 activate_power_mode
- [x] 多種背景特效(靜止彩帶/動態彩帶/Canvas Nest
- [x] 多種鼠標點擊特效(煙花/文字/愛心)
- [x] 內置一種 Preloader 加載動畫
- [x] 不蒜子訪問統計
- [x] 兩種大圖模式Medium Zoom/Fancybox
- [x] Mermaid 圖表顯示
- [x] 照片牆
- [x] 圖片懶加載
- [x] Instantpage/Pangu/Snackbar彈窗/PWA......
## 截圖 ## 截圖
![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-1.png)
![image](https://user-images.githubusercontent.com/16351105/58887457-3cc4b500-8718-11e9-9417-2bdea603c92e.png)
![](https://user-images.githubusercontent.com/16351105/69338594-7d03f980-0c9e-11ea-8b64-7f165e6508e2.png) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-2.png)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-post.png)

View File

@@ -7,20 +7,23 @@
# name || link || icon # name || link || icon
menu: menu:
Home: / || fas fa-home # Home: / || fas fa-home
Archives: /archives/ || fas fa-archive # Archives: /archives/ || fas fa-archive
Tags: /tags/ || fas fa-tags # Tags: /tags/ || fas fa-tags
Categories: /categories/ || fas fa-folder-open # Categories: /categories/ || fas fa-folder-open
List||fas fa-list: # List||fas fa-list:
- Music || /music/ || fas fa-music # - Music || /music/ || fas fa-music
- Movie || /movies/ || fas fa-video # - Movie || /movies/ || fas fa-video
Link: /link/ || fas fa-link # Link: /link/ || fas fa-link
About: /about/ || fas fa-heart # About: /about/ || fas fa-heart
# Hide the child menu items in mobile sidebar
hide_sidebar_menu_child: false
# Code Blocks (代碼相關) # Code Blocks (代碼相關)
# -------------------------------------- # --------------------------------------
highlight_theme: light # default / darker / pale night / light / ocean / mac / false highlight_theme: light # darker / pale night / light / ocean / mac / mac light / false
highlight_copy: true # copy button highlight_copy: true # copy button
highlight_lang: true # show the code language highlight_lang: true # show the code language
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
@@ -30,14 +33,16 @@ code_word_wrap: false
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息) # copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
copy: copy:
enable: true enable: true
copyright: false copyright:
enable: false
limit_count: 50
# social settings (社交圖標設置) # social settings (社交圖標設置)
# formal: # formal:
# icon: link || the description # icon: link || the description
social: social:
fab fa-github: https://github.com/xxxxx || Github # fab fa-github: https://github.com/xxxxx || Github
fas fa-envelope: mailto:xxxxxx@gmail.com || Email # fas fa-envelope: mailto:xxxxxx@gmail.com || Email
# search (搜索) # search (搜索)
# -------------------------------------- # --------------------------------------
@@ -86,24 +91,24 @@ favicon: /img/favicon.png
# Avatar (頭像) # Avatar (頭像)
avatar: avatar:
img: /img/avatar.png img:
effect: false effect: false
# the banner image of home page # the banner image of home page
index_img: index_img:
# if the banner of page not setting,it will show the top_img # if the banner of page not setting, it will show the top_img
default_top_img: https://i.loli.net/2020/05/01/IuWi8QbHvzjlOPw.jpg default_top_img:
# the banner image of archive page # the banner image of archive page
archive_img: archive_img:
# the banner image of tag page # the banner image of tag page
# tag page, look like https://xxxxxxxxx.com/tags/butterfly # note: tag page, not tags page (子標籤頁面的 top_img)
tag_img: tag_img:
# the banner image of category page # the banner image of category page
# category page, look like https://xxxxxxxxx.com/categories/butterfly # note: category page, not categories page (子分類頁面的 top_img)
category_img: category_img:
# If you are using hexo-douban, you can configure it (如果你有使用 hexo-douban,可配置這個) # If you are using hexo-douban, you can configure it (如果你有使用 hexo-douban,可配置這個)
@@ -123,7 +128,7 @@ cover:
position: both position: both
# When cover is not set, the default cover is displayed (當沒有設置cover時默認的封面顯示) # When cover is not set, the default cover is displayed (當沒有設置cover時默認的封面顯示)
default_cover: default_cover:
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg # - https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
# Replace Broken Images (替換無法顯示的圖片) # Replace Broken Images (替換無法顯示的圖片)
error_img: error_img:
@@ -141,10 +146,12 @@ post_meta:
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示 date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
categories: true # true or false 主頁是否顯示分類 categories: true # true or false 主頁是否顯示分類
tags: false # true or false 主頁是否顯示標籤 tags: false # true or false 主頁是否顯示標籤
label: true # true or false 顯示描述性文字
post: post:
date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示 date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
categories: true # true or false 文章頁是否顯示分類 categories: true # true or false 文章頁是否顯示分類
tags: true # true or false 文章頁是否顯示標籤 tags: true # true or false 文章頁是否顯示標籤
label: true # true or false 顯示描述性文字
# wordcount (字數統計) # wordcount (字數統計)
wordcount: wordcount:
@@ -155,7 +162,7 @@ wordcount:
# Display the article introduction on homepage # Display the article introduction on homepage
# 1: description # 1: description
# 2: both (if the description exists, it will show description. or show the auto_excerpt) # 2: both (if the description exists, it will show description, or show the auto_excerpt)
# 3: auto_excerpt (default) # 3: auto_excerpt (default)
index_post_content: index_post_content:
method: 3 method: 3
@@ -180,12 +187,12 @@ post_copyright:
reward: reward:
enable: false enable: false
QR_code: QR_code:
- img: /img/wechat.jpg # - img: /img/wechat.jpg
link: # link:
text: wechat # text: wechat
- img: /img/alipay.jpg # - img: /img/alipay.jpg
link: # link:
text: alipay # text: alipay
# Related Articles # Related Articles
related_post: related_post:
@@ -200,6 +207,15 @@ photofigcaption: false
# when you scroll in post, the URL will update according to header id. # when you scroll in post, the URL will update according to header id.
anchor: false anchor: false
# Displays outdated notice for a post (文章過期提醒)
noticeOutdate:
enable: false
style: flat # style: simple/flat
limit_day: 500 # When will it be shown
position: top # position: top/bottom
message_prev: It has been
message_next: days since the last update, the content of the article may be outdated.
# Share System (分享功能) # Share System (分享功能)
# -------------------------------------- # --------------------------------------
@@ -219,30 +235,32 @@ sharejs:
# https://www.addtoany.com/ # https://www.addtoany.com/
addtoany: addtoany:
enable: false enable: false
item: item: facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link
- facebook
- twitter
- wechat
- sina_weibo
- facebook_messenger
- email
- copy_link
# Comments System # Comments System
# -------------------------------------- # --------------------------------------
comments:
# Up to two comments system, the first will be shown as default
# Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Utterances/Facebook Comments
use:
# - Valine
# - Disqus
text: true # Display the comment name next to the button
# lazyload: The comment system will be load when comment element enters the browser's viewport.
# If you set it to true, the comment count will be invalid
lazyload: false
count: false # Display comment count in top_img
# disqus # disqus
# https://disqus.com/ # https://disqus.com/
disqus: disqus:
enable: false
shortname: shortname:
count: false # dispaly comment count in top_img
# Alternative Disqus - Render comments with Disqus API # Alternative Disqus - Render comments with Disqus API
# DisqusJS評論系統可以實現在網路審查地區載入 Disqus 評論列表,兼容原版 # DisqusJS 評論系統,可以實現在網路審查地區載入 Disqus 評論列表,兼容原版
# https://github.com/SukkaW/DisqusJS # https://github.com/SukkaW/DisqusJS
disqusjs: disqusjs:
enable: false
shortname: shortname:
siteName: siteName:
apikey: apikey:
@@ -250,18 +268,15 @@ disqusjs:
nocomment: # display when a blog post or an article has no comment attached nocomment: # display when a blog post or an article has no comment attached
admin: admin:
adminLabel: adminLabel:
count: false # dispaly comment count in top_img
# livere(來必力) # livere (來必力)
# https://www.livere.com/ # https://www.livere.com/
livere: livere:
enable: false
uid: uid:
# gitalk # gitalk
# https://github.com/gitalk/gitalk # https://github.com/gitalk/gitalk
gitalk: gitalk:
enable: false
client_id: client_id:
client_secret: client_secret:
repo: repo:
@@ -272,31 +287,27 @@ gitalk:
distractionFreeMode: false # Facebook-like distraction free mode. distractionFreeMode: false # Facebook-like distraction free mode.
pagerDirection: last # Comment sorting direction, available values are last and first. pagerDirection: last # Comment sorting direction, available values are last and first.
createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
count: false # dispaly comment count in top_img
# valine # valine
# https://valine.js.org # https://valine.js.org
valine: valine:
enable: false # if you want use valine,please set this value is true
appId: # leancloud application app id appId: # leancloud application app id
appKey: # leancloud application app key appKey: # leancloud application app key
pageSize: 10 # comment list page size pageSize: 10 # comment list page size
avatar: monsterid # gravatar style https://valine.js.org/#/avatar avatar: monsterid # gravatar style https://valine.js.org/#/avatar
lang: en # i18n: zh-CN/zh-TW/en/ja lang: en # i18n: zh-CN/zh-TW/en/ja
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints ) placeholder: Please leave your footprints # valine comment input placeholder (like: Please leave your footprints)
guest_info: nick,mail,link #valine comment header info (nick/mail/link) guest_info: nick,mail,link # valine comment header info (nick/mail/link)
recordIP: false # Record reviewer IP recordIP: false # Record reviewer IP
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in) serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
bg: # valine background bg: # valine background
emojiCDN: # emoji CDN emojiCDN: # emoji CDN
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
requiredFields: nick,mail # required fields (nick/mail) requiredFields: nick,mail # required fields (nick/mail)
count: false # dispaly comment count in top_img
# utterances # utterances
# https://utteranc.es/ # https://utteranc.es/
utterances: utterances:
enable: false
repo: repo:
# Issue Mapping: pathname/url/title/og:title # Issue Mapping: pathname/url/title/og:title
issue_term: pathname issue_term: pathname
@@ -307,13 +318,11 @@ utterances:
# Facebook Comments Plugin # Facebook Comments Plugin
# https://developers.facebook.com/docs/plugins/comments/ # https://developers.facebook.com/docs/plugins/comments/
facebook_comments: facebook_comments:
enable: false
app_id: app_id:
user_id: # optional user_id: # optional
pageSize: 10 # The number of comments to show pageSize: 10 # The number of comments to show
order_by: social # social/time/reverse_time order_by: social # social/time/reverse_time
lang: en_US # Language en_US/zh_CN/zh_TW and so on lang: en_US # Language en_US/zh_CN/zh_TW and so on
count: false
# Chat Services # Chat Services
# -------------------------------------- # --------------------------------------
@@ -349,16 +358,21 @@ gitter:
enable: false enable: false
room: room:
# crisp
# https://crisp.chat/en/
crisp:
enable: false
website_id:
# Footer Settings # Footer Settings
# -------------------------------------- # --------------------------------------
footer:
since: 2020 owner:
enable: true
footer_custom_text: since: 2020
custom_text:
footer_copyright: true copyright: true # Copyright of theme and framework
ICP: # Chinese ICP License
ICP:
enable: false enable: false
url: url:
text: text:
@@ -368,20 +382,28 @@ ICP:
# -------------------------------------- # --------------------------------------
# Baidu Analytics # Baidu Analytics
# https://tongji.baidu.com/web/welcome/login
baidu_analytics: baidu_analytics:
# Google Analytics # Google Analytics
# https://analytics.google.com/analytics/web/
google_analytics: google_analytics:
# Tencent Analytics ID # Tencent Analytics ID
# https://mta.qq.com
tencent_analytics: tencent_analytics:
# CNZZ Analytics
# https://www.umeng.com/
cnzz_analytics:
# Advertisement # Advertisement
# -------------------------------------- # --------------------------------------
# Google Adsense (谷歌廣告) # Google Adsense (谷歌廣告)
google_adsense: google_adsense:
enable: false enable: false
auto_ads: true
js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
client: client:
enable_page_level_ads: true enable_page_level_ads: true
@@ -411,6 +433,10 @@ baidu_site_verification:
# see http://zhanzhang.so.com/ # see http://zhanzhang.so.com/
qihu_site_verification: qihu_site_verification:
# Yandex Webmaster tools verification setting
# see https://webmaster.yandex.com/
yandex_site_verification:
# Beautify/Effect (美化/效果) # Beautify/Effect (美化/效果)
# -------------------------------------- # --------------------------------------
@@ -434,7 +460,7 @@ qihu_site_verification:
# The top_img settings of home page # The top_img settings of home page
# default: top img - full screen, site info - middle (默認top_img全屏site_info在中間) # default: top img - full screen, site info - middle (默認top_img全屏site_info在中間)
# The positon of site info, eg: 300px/300em/300rem/10% (主頁標題距離頂部距離) # The position of site info, eg: 300px/300em/300rem/10% (主頁標題距離頂部距離)
index_site_info_top: index_site_info_top:
# The height of top_img, eg: 300px/300em/300rem (主頁top_img高度) # The height of top_img, eg: 300px/300em/300rem (主頁top_img高度)
index_top_img_height: index_top_img_height:
@@ -505,9 +531,9 @@ click_heart: false
ClickShowText: ClickShowText:
enable: false enable: false
text: text:
- I # - I
- LOVE # - LOVE
- YOU # - YOU
fontSize: 15px fontSize: 15px
# Default display mode (網站默認的顯示模式) # Default display mode (網站默認的顯示模式)
@@ -524,24 +550,26 @@ beautify:
# Global font settings # Global font settings
# Don't modify the following settings unless you know how they work (非必要不要修改) # Don't modify the following settings unless you know how they work (非必要不要修改)
font: font:
global-font-size:
code-font-size:
font-family: font-family:
code-font: code-font-family:
# Font settings for the site title and site subtitle # Font settings for the site title and site subtitle
# 左上角網站名字 主頁居中網站名字 # 左上角網站名字 主頁居中網站名字
blog_title_font: # blog_title_font:
font_link: https://fonts.googleapis.com/css?family=Titillium+Web&display=swap # font_link: https://fonts.googleapis.com/css?family=Titillium+Web&display=swap
font-family: Titillium Web, 'PingFang SC', 'Hiragino Sans GB', Microsoft YaHei', sans-serif # font-family: Titillium Web, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif
# The setting of divider icon (水平分隔線圖標設置) # The setting of divider icon (水平分隔線圖標設置)
hr_icon: hr_icon:
enable: true enable: true
icon: # the unicode value of Font Awesome icon icon: # the unicode value of Font Awesome icon, such as '\3423'
icon-top: icon-top:
# the subtitle on homepage (主頁subtitle) # the subtitle on homepage (主頁subtitle)
subtitle: subtitle:
enable: true enable: false
# Typewriter Effect (打字效果) # Typewriter Effect (打字效果)
effect: true effect: true
# loop (循環打字) # loop (循環打字)
@@ -559,8 +587,6 @@ subtitle:
# 開頭不允許轉義字元,如需要,請把整個句子用雙引號包住 # 開頭不允許轉義字元,如需要,請把整個句子用雙引號包住
# 如果關閉打字效果subtitle只會顯示sub的第一行文字 # 如果關閉打字效果subtitle只會顯示sub的第一行文字
sub: sub:
- 今日事&#44;今日畢
- Never put off till tomorrow what you can do today
# Loading Animation (加載動畫) # Loading Animation (加載動畫)
preloader: false preloader: false
@@ -575,12 +601,17 @@ aside:
card_author: card_author:
enable: true enable: true
description: description:
button:
icon: fab fa-github
text: Follow Me
link: https://github.com/xxxxxx
card_announcement: card_announcement:
enable: true enable: true
content: This is my Blog content: This is my Blog
card_recent_post: card_recent_post:
enable: true enable: true
limit: 5 # if set 0 will show all limit: 5 # if set 0 will show all
sort: date # date or updated
card_categories: card_categories:
enable: true enable: true
limit: 8 # if set 0 will show all limit: 8 # if set 0 will show all
@@ -595,7 +626,10 @@ aside:
format: MMMM YYYY # eg: YYYY年MM月 format: MMMM YYYY # eg: YYYY年MM月
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
limit: 8 # if set 0 will show all limit: 8 # if set 0 will show all
card_webinfo: true card_webinfo:
enable: true
post_count: true
last_push_date: true
# busuanzi count for PV / UV in site # busuanzi count for PV / UV in site
# 訪問人數 # 訪問人數
@@ -610,12 +644,31 @@ runtimeshow:
enable: false enable: false
publish_date: publish_date:
# Aside widget - Newest Comments
newest_comments:
enable: false
limit: 6
avatar: true
leancloud:
enable: false
appId: # leancloud application app id
appKey: # leancloud application app key
serverURL: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
default_avatar: # mp/identicon/monsterid/wavatar/retro/robohash/blank
github_issues:
enable: false
repo:
disqus:
enable: false
forum:
api_key:
# Bottom right button (右下角按鈕) # Bottom right button (右下角按鈕)
# -------------------------------------- # --------------------------------------
# Conversion between Traditional and Simplified Chinese (簡繁轉換) # Conversion between Traditional and Simplified Chinese (簡繁轉換)
translate: translate:
enable: true enable: false
# The text of a button # The text of a button
default: default:
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese # the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese
@@ -680,6 +733,20 @@ note:
# other # other
# -------------------------------------- # --------------------------------------
# Pjax [Beta]
# It may contain bugs and unstable, give feedback when you find the bugs.
# https://github.com/MoOx/pjax
pjax:
enable: false
exclude:
# - xxxx
# - xxxx
# Inject the css and script (aplayer/meting)
aplayerInject:
enable: false
per_page: true
# Snackbar (Toast Notification 彈窗) # Snackbar (Toast Notification 彈窗)
# https://github.com/polonel/SnackBar # https://github.com/polonel/SnackBar
# position 彈窗位置 # position 彈窗位置
@@ -695,7 +762,7 @@ baidu_push: false
# https://instant.page/ # https://instant.page/
# prefetch (預加載) # prefetch (預加載)
instantpage: true instantpage: false
# https://github.com/vinta/pangu.js # https://github.com/vinta/pangu.js
# Insert a space between Chinese character and English character (中英文之間添加空格) # Insert a space between Chinese character and English character (中英文之間添加空格)
@@ -706,7 +773,7 @@ pangu:
# Lazyload (圖片懶加載) # Lazyload (圖片懶加載)
# https://github.com/verlok/lazyload # https://github.com/verlok/lazyload
lazyload: lazyload:
enable: true enable: false
post: /img/loading.gif post: /img/loading.gif
# PWA # PWA
@@ -715,7 +782,6 @@ lazyload:
# pwa: # pwa:
# enable: false # enable: false
# manifest: /image/pwa/manifest.json # manifest: /image/pwa/manifest.json
# theme_color: "#fff"
# apple_touch_icon: /image/pwa/apple-touch-icon.png # apple_touch_icon: /image/pwa/apple-touch-icon.png
# favicon_32_32: /image/pwa/32.png # favicon_32_32: /image/pwa/32.png
# favicon_16_16: /image/pwa/16.png # favicon_16_16: /image/pwa/16.png
@@ -750,8 +816,10 @@ CDN:
main: /js/main.js main: /js/main.js
utils: /js/utils.js utils: /js/utils.js
# pjax
pjax: https://cdn.jsdelivr.net/npm/pjax/pjax.min.js
# comments # comments
blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
@@ -771,7 +839,7 @@ CDN:
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
# math # math
mathjax: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML mathjax: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css
@@ -787,7 +855,7 @@ CDN:
lazyload: https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js lazyload: https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js
instantpage: https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js instantpage: https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js
typed: https://cdn.jsdelivr.net/npm/typed.js typed: https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js
pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
# photo # photo
@@ -819,4 +887,9 @@ CDN:
# aplayer # aplayer
aplayer_css: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css aplayer_css: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
aplayer_js: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js aplayer_js: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js
meting_js: https://cdn.jsdelivr.net/npm/meting@1.2.0/dist/Meting.min.js meting_js: https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js
# Prism.js
prismjs_js: https://cdn.jsdelivr.net/npm/prismjs/prism.min.js
prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js

View File

@@ -3,7 +3,7 @@ sidebar:
have_read: You've read have_read: You've read
footer: footer:
driven: Driven framework: Framework
theme: Theme theme: Theme
copy: copy:
@@ -24,7 +24,8 @@ post:
created: Created created: Created
updated: Updated updated: Updated
wordcount: Word count wordcount: Word count
min2read: 'Reading time: %s min' min2read: Reading time
min2read_unit: min
page_pv: Post View page_pv: Post View
comments: Comments comments: Comments
copyright: copyright:
@@ -61,15 +62,28 @@ 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: Bookmark
card_webinfo: card_webinfo:
headline: Info headline: Info
article_name: Article article_name: Article
runtime_name: Run time runtime:
name: Run time
unit: days
last_push_date:
name: Last Push
site_wordcount: Total Count site_wordcount: Total Count
site_uv_name: UV site_uv_name: UV
site_pv_name: PV site_pv_name: PV
more_button: More more_button: More
card_newest_comments:
heading: Newest Comments
loading_text: loading...
zero_day: Today
day: days ago
date_suffix:
one_hour: Just
hours: hours ago
day: days ago
donate: Donate donate: Donate
share: Share share: Share
@@ -87,8 +101,6 @@ rightside:
scroll_to_comment: Scroll To Comments scroll_to_comment: Scroll To Comments
setting: Setting setting: Setting
runtime_unit: days
copy_copyright: copy_copyright:
author: Author author: Author
link: Link link: Link

View File

@@ -3,7 +3,7 @@ sidebar:
have_read: You've read have_read: You've read
footer: footer:
driven: Driven framework: Framework
theme: Theme theme: Theme
copy: copy:
@@ -24,7 +24,8 @@ post:
created: Created created: Created
updated: Updated updated: Updated
wordcount: Word count wordcount: Word count
min2read: 'Reading time: %s min' min2read: Reading time
min2read_unit: min
page_pv: Post View page_pv: Post View
comments: Comments comments: Comments
copyright: copyright:
@@ -61,15 +62,28 @@ 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: Bookmark
card_webinfo: card_webinfo:
headline: Info headline: Info
article_name: Article article_name: Article
runtime_name: Run time runtime:
name: Run time
unit: days
last_push_date:
name: Last Push
site_wordcount: Total Count site_wordcount: Total Count
site_uv_name: UV site_uv_name: UV
site_pv_name: PV site_pv_name: PV
more_button: More more_button: More
card_newest_comments:
heading: Newest Comments
loading_text: loading...
zero_day: Today
day: days ago
date_suffix:
one_hour: Just
hours: hours ago
day: days ago
donate: Donate donate: Donate
share: Share share: Share
@@ -87,8 +101,6 @@ rightside:
scroll_to_comment: Scroll To Comments scroll_to_comment: Scroll To Comments
setting: Setting setting: Setting
runtime_unit: days
copy_copyright: copy_copyright:
author: Author author: Author
link: Link link: Link

View File

@@ -3,7 +3,7 @@ sidebar:
have_read: 你已经读了 have_read: 你已经读了
footer: footer:
driven: 驱动 framework: 框架
theme: 主题 theme: 主题
copy: copy:
@@ -24,7 +24,8 @@ post:
created: 发表于 created: 发表于
updated: 更新于 updated: 更新于
wordcount: 字数总计 wordcount: 字数总计
min2read: '阅读时长: %s 分钟' min2read: 阅读时长
min2read_unit: 分钟
page_pv: 阅读量 page_pv: 阅读量
comments: 评论数 comments: 评论数
copyright: copyright:
@@ -38,13 +39,13 @@ post:
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:
@@ -63,15 +64,28 @@ aside:
card_tags: 标签 card_tags: 标签
card_archives: 归档 card_archives: 归档
card_recent_post: 最新文章 card_recent_post: 最新文章
card_bookmark: 加入书签
card_webinfo: card_webinfo:
headline: 网站资讯 headline: 网站资讯
article_name: 文章数目 article_name: 文章数目
runtime_name: 已运行时间 runtime:
name: 已运行时间
unit:
last_push_date:
name: 最后更新时间
site_wordcount: 本站总字数 site_wordcount: 本站总字数
site_uv_name: 本站访客数 site_uv_name: 本站访客数
site_pv_name: 本站总访问量 site_pv_name: 本站总访问量
more_button: 查看更多 more_button: 查看更多
card_newest_comments:
heading: 最新评论
loading_text: 正在加载中...
zero_day: 今天
day: 天前
date_suffix:
one_hour: 刚刚
hours: 小时前
day: 天前
donate: 打赏 donate: 打赏
share: 分享 share: 分享
@@ -89,8 +103,6 @@ rightside:
scroll_to_comment: 直达评论 scroll_to_comment: 直达评论
setting: 设置 setting: 设置
runtime_unit:
copy_copyright: copy_copyright:
author: 作者 author: 作者
link: 链接 link: 链接
@@ -106,7 +118,6 @@ Snackbar:
day_to_night: 你已切换为深色模式 day_to_night: 你已切换为深色模式
night_to_day: 你已切换为浅色模式 night_to_day: 你已切换为浅色模式
error_title: 页面没有找到
loading: 加载中... loading: 加载中...
error404: error404:

View File

@@ -3,8 +3,8 @@ sidebar:
have_read: 你已經讀了 have_read: 你已經讀了
footer: footer:
driven: Power by framework: 框架
theme: Theme theme: 主題
copy: copy:
success: 複製成功 success: 複製成功
@@ -24,7 +24,8 @@ post:
created: 發表於 created: 發表於
updated: 更新於 updated: 更新於
wordcount: 字數總計 wordcount: 字數總計
min2read: '閱讀時長: %s 分鐘' min2read: 閲讀時長
min2read_unit: 分鐘
page_pv: 閱讀量 page_pv: 閱讀量
comments: 評論數 comments: 評論數
copyright: copyright:
@@ -38,13 +39,13 @@ post:
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:
@@ -63,15 +64,28 @@ aside:
card_tags: 標籤 card_tags: 標籤
card_archives: 歸檔 card_archives: 歸檔
card_recent_post: 最新文章 card_recent_post: 最新文章
card_bookmark: 加入書籤
card_webinfo: card_webinfo:
headline: 網站資訊 headline: 網站資訊
article_name: 文章數目 article_name: 文章數目
runtime_name: 已執行時間 runtime:
name: 已運行時間
unit:
last_push_date:
name: 最後更新時間
site_wordcount: 本站總字數 site_wordcount: 本站總字數
site_uv_name: 本站訪客數 site_uv_name: 本站訪客數
site_pv_name: 本站總訪問量 site_pv_name: 本站總訪問量
more_button: 檢視更多 more_button: 檢視更多
card_newest_comments:
heading: 最新評論
loading_text: 正在加載中...
zero_day: 今天
day: 天前
date_suffix:
one_hour: 剛剛
hours: 小時前
day: 天前
donate: 打賞 donate: 打賞
share: 分享 share: 分享
@@ -89,8 +103,6 @@ rightside:
scroll_to_comment: 直達評論 scroll_to_comment: 直達評論
setting: 設定 setting: 設定
runtime_unit:
copy_copyright: copy_copyright:
author: 作者 author: 作者
link: 連結 link: 連結

View File

@@ -22,9 +22,9 @@ html(lang=config.language data-theme=theme.display_mode)
.error-info .error-info
h1.error_title= '404' h1.error_title= '404'
.error_subtitle= theme.error_404.subtitle .error_subtitle= theme.error_404.subtitle
a.button--animated(href=url_for(config.root)) a.button--animated(href=config.root)
i.fas.fa-rocket i.fas.fa-rocket
= _p('error404.back_button') = _p('error404.back_button')
!=partial('includes/search/index', {}, {cache:theme.fragment_cache}) !=partial('includes/third-party/search/index', {}, {cache:theme.fragment_cache})
include includes/additional-js.pug include includes/additional-js.pug

View File

@@ -11,13 +11,14 @@
.flink-list-item .flink-list-item
a(href=url_for(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(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) img(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
else else
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
.flink-item-name= item.name span.flink-item-name= item.name
.flink-item-desc= item.descr span.flink-item-desc(title=item.descr)= item.descr
!= page.content != page.content
if page.comments !== false if page.comments !== false && theme.comments && theme.comments.use
include includes/comments/index.pug - var commentsJsLoad = true
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})

View File

@@ -1,76 +1,68 @@
script(src=url_for(theme.CDN.jquery)) div
script(src=url_for(theme.CDN.utils)) script(src=url_for(theme.CDN.jquery))
script(src=url_for(theme.CDN.main)) script(src=url_for(theme.CDN.utils))
script(src=url_for(theme.CDN.main))
if theme.translate && theme.translate.enable if theme.translate && theme.translate.enable
script(src=url_for(theme.CDN.translate)) script(src=url_for(theme.CDN.translate))
if theme.medium_zoom if theme.medium_zoom
script(src=url_for(theme.CDN.medium_zoom)) script(src=url_for(theme.CDN.medium_zoom))
else if theme.fancybox
if theme.fancybox
script(src=url_for(theme.CDN.fancybox)) script(src=url_for(theme.CDN.fancybox))
include ./math/index.pug if theme.instantpage
if theme.fireworks && theme.fireworks.enable
script(src=url_for(theme.CDN.anime))
script(src=url_for(theme.CDN.fireworks))
if (theme.snackbar && theme.snackbar.enable)
script(src=url_for(theme.CDN.snackbar))
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
include ./third-party/canvas-ribbon.pug
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
include ./third-party/canvas-ribbon-piao.pug
if (theme.canvas_nest && theme.canvas_nest.enable)
include ./third-party/canvas-nest.pug
if theme.activate_power_mode.enable
script(src=url_for(theme.CDN.activate_power_mode))
script.
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
POWERMODE.shake = #{theme.activate_power_mode.shake};
document.body.addEventListener('input', POWERMODE);
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
script(async src=url_for(theme.CDN.busuanzi))
if theme.instantpage
script(src=url_for(theme.CDN.instantpage) type="module" defer) script(src=url_for(theme.CDN.instantpage) type="module" defer)
if theme.lazyload.enable if theme.lazyload.enable
script(src=url_for(theme.CDN.lazyload) async) script(src=url_for(theme.CDN.lazyload))
//- 鼠標特效 if (theme.snackbar && theme.snackbar.enable)
if theme.click_heart script(src=url_for(theme.CDN.snackbar))
script(src=url_for(theme.CDN.click_heart))
if theme.ClickShowText && theme.ClickShowText.enable if theme.pangu && theme.pangu.enable
script(src=url_for(theme.CDN.ClickShowText)) !=partial('includes/third-party/pangu.pug', {}, {cache:theme.fragment_cache})
if theme.pangu && theme.pangu.enable //- search
include ./third-party/pangu.pug if theme.algolia_search.enable
//- search
if theme.algolia_search && theme.algolia_search.enable
script(src=url_for(theme.CDN.algolia_js)) script(src=url_for(theme.CDN.algolia_js))
else if theme.local_search && theme.local_search.enable else if theme.local_search.enable
script(src=url_for(theme.CDN.local_search)) script(src=url_for(theme.CDN.local_search))
//- mermaid if theme.preloader
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/loading/loading-js', {}, {cache:theme.fragment_cache})
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache}) .js-pjax
if is_home() && theme.subtitle.enable
include ./third-party/subtitle.pug
include ./third-party/math/index.pug
if commentsJsLoad
include ./third-party/comments/js.pug
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
script(async src=url_for(theme.CDN.busuanzi))
!=partial('includes/third-party/prismjs', {}, {cache:theme.fragment_cache})
if theme.aside.enable && theme.newest_comments.enable
if theme.pjax.enable
!=partial('includes/third-party/newest-comments/index', {}, {cache:theme.fragment_cache})
else if (!is_post() && page.aside !== false)
!=partial('includes/third-party/newest-comments/index', {}, {cache:theme.fragment_cache})
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
!=partial('includes/third-party/effect', {}, {cache:theme.fragment_cache})
!=partial('includes/third-party/chat/index', {}, {cache:theme.fragment_cache})
if theme.aplayerInject && theme.aplayerInject.enable
if theme.pjax.enable || theme.aplayerInject.per_page
include ./head/aplayer.pug
else if page.aplayer
include ./head/aplayer.pug
if theme.pjax.enable
!=partial('includes/third-party/pjax', {}, {cache:theme.fragment_cache})

View File

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

View File

@@ -1,39 +0,0 @@
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'
}
}

View File

@@ -1,24 +0,0 @@
#disqus_thread
script.
var disqus_config = function () {
this.page.url = '!{ page.permalink }';
this.page.identifier = '!{ page.path }';
this.page.title = '!{ page.title }';
};
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(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);

View File

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

View File

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

View File

@@ -1,27 +0,0 @@
#gitalk-container
script.
var gitalk = new Gitalk({
clientID: '!{theme.gitalk.client_id}',
clientSecret: '!{theme.gitalk.client_secret}',
repo: '!{theme.gitalk.repo}',
owner: '!{theme.gitalk.owner}',
admin: ['!{theme.gitalk.admin}'],
id: md5(decodeURI(location.pathname)),
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')
function commentCount(n){
try {
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
} catch (e) {
return false
}
}

View File

@@ -1,29 +0,0 @@
- 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
#post-comment
.comment_headling
i.fas.fa-comments.fa-fw
span= ' ' + _p('comment')
if d
include ./disqus.pug
else if dj
include ./disqusjs.pug
else if l
include ./livere.pug
else if gt
include ./gitalk.pug
else if v
include ./valine.pug
else if u
include ./utterances.pug
else if fb
include ./facebook_comments.pug

View File

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

View File

@@ -1,21 +0,0 @@
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');
}

View File

@@ -1,35 +0,0 @@
- let emojiMaps = '""'
if site.data.valine
- emojiMaps = JSON.stringify(site.data.valine)
#vcomment.vcomment
script(src=url_for(theme.CDN.valine))
script.
var requestSetting = function (from,set) {
var from = from
var setting = set.split(',').filter(function(item){
return from.indexOf(item) > -1
});
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({
el:'#vcomment',
appId: '#{theme.valine.appId}',
appKey: '#{theme.valine.appKey}',
placeholder: '#{theme.valine.placeholder}',
avatar: '#{theme.valine.avatar}',
meta: guestInfo,
pageSize: '#{theme.valine.pageSize}',
lang: '#{theme.valine.lang}',
recordIP: #{theme.valine.recordIP},
serverURLs: '#{theme.valine.serverURLs}',
emojiCDN: '#{theme.valine.emojiCDN}',
emojiMaps: !{emojiMaps},
enableQQ: #{theme.valine.enableQQ},
requiredFields: requiredFields
});

View File

@@ -1,24 +1,23 @@
#footer-wrap #footer-wrap
if theme.footer.owner.enable
- var now = new Date() - var now = new Date()
- var nowYear = now.getFullYear() - var nowYear = now.getFullYear()
if theme.since && theme.since != nowYear if theme.footer.owner.since && theme.footer.owner.since != nowYear
.copyright!= `&copy;${theme.since} - ${nowYear} By ${config.author}` .copyright!= `&copy;${theme.footer.owner.since} - ${nowYear} By ${config.author}`
else else
.copyright!= `&copy;${nowYear} By ${config.author}` .copyright!= `&copy;${nowYear} By ${config.author}`
if theme.footer_copyright if theme.footer.copyright
.framework-info .framework-info
span= _p('footer.driven') + ' ' span= _p('footer.framework') + ' '
a(href='https://hexo.io') a(href='https://hexo.io')= 'Hexo'
span Hexo
span.footer-separator | span.footer-separator |
span= _p('footer.theme') + ' ' span= _p('footer.theme') + ' '
a(href='https://github.com/jerryc127/hexo-theme-butterfly') a(href='https://github.com/jerryc127/hexo-theme-butterfly')= 'Butterfly'
span Butterfly if theme.footer.custom_text
if theme.footer_custom_text .footer_custom_text!=`${theme.footer.custom_text}`
.footer_custom_text!=`${theme.footer_custom_text}` if theme.footer.ICP.enable
if theme.ICP.enable
.icp .icp
a(href=theme.ICP.url) a(href=theme.footer.ICP.url)
if theme.ICP.icon if theme.footer.ICP.icon
img.icp-icon(src=url_for(theme.ICP.icon)) img.icp-icon(src=url_for(theme.footer.ICP.icon))
span=theme.ICP.text span=theme.footer.ICP.text

View File

@@ -17,6 +17,7 @@
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords - else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author - var pageAuthor = config.email ? config.author + ',' + config.email : config.author
- var pageCopyright = config.copyright || config.author - var pageCopyright = config.copyright || config.author
- var themeColor = theme.display_mode === 'dark' ? '#0d0d0d' : '#ffffff'
meta(charset='UTF-8') meta(charset='UTF-8')
meta(http-equiv="X-UA-Compatible" content="IE=edge") meta(http-equiv="X-UA-Compatible" content="IE=edge")
@@ -28,16 +29,14 @@ if pageKeywords
meta(name="author" content=pageAuthor) meta(name="author" content=pageAuthor)
meta(name="copyright" content=pageCopyright) meta(name="copyright" content=pageCopyright)
meta(name ="format-detection" content="telephone=no") meta(name ="format-detection" content="telephone=no")
!=favicon_tag(theme.favicon || config.favicon) meta(name="theme-color" content=themeColor)
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 !=favicon_tag(theme.favicon || config.favicon)
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict])) link(rel="canonical" href=urlNoIndex())
meta(name="referrer" content="no-referrer")
//- 預解析 //- 預解析
!=partial('includes/head/preconnect', {}, {cache:theme.fragment_cache}) !=partial('includes/head/preconnect', {}, {cache:theme.fragment_cache})
@@ -48,13 +47,15 @@ if theme.douban
//- Open_Graph //- Open_Graph
include ./head/Open_Graph.pug include ./head/Open_Graph.pug
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)
//- PWA //- PWA
if (theme.pwa && theme.pwa.enable) if (theme.pwa && theme.pwa.enable)
!=partial('includes/head/pwa', {}, {cache:theme.fragment_cache}) !=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
if theme.darkmode.enable
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
//- main css //- main css
link(rel='stylesheet', href=url_for(theme.CDN.main_css)) link(rel='stylesheet', href=url_for(theme.CDN.main_css))
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome)) link(rel='stylesheet', href=url_for(theme.CDN.fontawesome))
@@ -65,19 +66,10 @@ if theme.fancybox
if (theme.snackbar && theme.snackbar.enable) if (theme.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css)) link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
if is_post()
if(page.prev)
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
if(page.next)
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="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css)) link(rel='stylesheet' href=url_for(theme.CDN.algolia_search_css))
script(src=url_for(theme.CDN.algolia_search) defer) script(src=url_for(theme.CDN.algolia_search) defer)
//- comment css
include ./head/comment.pug
//- google_adsense //- google_adsense
!=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache}) !=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache})
@@ -85,7 +77,7 @@ include ./head/comment.pug
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache}) !=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
//- font //- font
if theme.blog_title_font.font_link if theme.blog_title_font && 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 //- global config
@@ -94,7 +86,7 @@ if theme.blog_title_font.font_link
include ./head/config_site.pug include ./head/config_site.pug
include ./head/noscript.pug include ./head/noscript.pug
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)}) !=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
if page.aplayer
include ./head/aplayer.pug

View File

@@ -9,14 +9,24 @@ if theme.baidu_analytics
})(); })();
if theme.google_analytics if theme.google_analytics
script(async src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`)
script. script.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ window.dataLayer = window.dataLayer || [];
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), function gtag(){dataLayer.push(arguments);}
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) gtag('js', new Date());
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); gtag('config', '!{theme.google_analytics}');
ga('create', '!{theme.google_analytics}', 'auto');
ga('send', 'pageview');
if theme.tencent_analytics if theme.tencent_analytics
script(src=`https://tajs.qq.com/stats?sId=${theme.tencent_analytics}` charset="UTF-8") script.
var _mtac = {};
(function() {
var mta = document.createElement("script");
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
mta.setAttribute("name", "MTAH5");
mta.setAttribute("sid", "!{theme.tencent_analytics}");
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(mta, s);
})();
if theme.cnzz_analytics
script(async data-pjax src=`https://s4.cnzz.com/z_stat.php?id=${theme.cnzz_analytics}&web_id=${theme.cnzz_analytics}`)

View File

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

View File

@@ -1,6 +1,6 @@
- -
var algolia = 'undefined'; let algolia = 'undefined';
var env = process.env; let env = process.env;
if (theme.algolia_search.enable) { if (theme.algolia_search.enable) {
algolia = JSON.stringify({ algolia = JSON.stringify({
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID, appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
@@ -16,7 +16,7 @@
}) })
} }
var localSearch = 'undefined'; let localSearch = 'undefined';
if (theme.local_search && theme.local_search.enable) { if (theme.local_search && theme.local_search.enable) {
localSearch = JSON.stringify({ localSearch = JSON.stringify({
path: config.search.path, path: config.search.path,
@@ -26,7 +26,8 @@
} }
}) })
} }
var translate = 'undefined';
let translate = 'undefined';
if (theme.translate && theme.translate.enable){ if (theme.translate && theme.translate.enable){
translate = JSON.stringify({ translate = JSON.stringify({
defaultEncoding: theme.translate.defaultEncoding, defaultEncoding: theme.translate.defaultEncoding,
@@ -36,9 +37,10 @@
}) })
} }
var copyright = 'undefined' ; let copyright = 'undefined';
if (theme.copy.enable && theme.copy.copyright){ if (theme.copy.enable && theme.copy.copyright.enable){
copyright = JSON.stringify({ copyright = JSON.stringify({
limitCount: theme.copy.copyright.limit_count,
languages: { languages: {
author: _p("copy_copyright.author") + ': ' + config.author, author: _p("copy_copyright.author") + ': ' + config.author,
link: _p("copy_copyright.link") + ': ', link: _p("copy_copyright.link") + ': ',
@@ -48,7 +50,7 @@
}) })
} }
var ClickShowText = 'undefined'; let ClickShowText = 'undefined';
if (theme.ClickShowText && theme.ClickShowText.enable) { if (theme.ClickShowText && theme.ClickShowText.enable) {
ClickShowText = JSON.stringify({ ClickShowText = JSON.stringify({
text: theme.ClickShowText.text.join(","), text: theme.ClickShowText.text.join(","),
@@ -57,7 +59,7 @@
} }
var Snackbar = 'undefined'; let Snackbar = 'undefined';
if (theme.snackbar && theme.snackbar.enable) { if (theme.snackbar && theme.snackbar.enable) {
Snackbar = JSON.stringify({ Snackbar = JSON.stringify({
bookmark: { bookmark: {
@@ -74,12 +76,44 @@
}) })
} }
let noticeOutdate = 'undefined';
if (theme.noticeOutdate && theme.noticeOutdate.enable) {
noticeOutdate = JSON.stringify({
limitDay: theme.noticeOutdate.limit_day,
position: theme.noticeOutdate.position,
messagePrev: theme.noticeOutdate.message_prev,
messageNext: theme.noticeOutdate.message_next,
})
}
let highlight = 'undefined';
if ((config.highlight && config.highlight.enable) || (config.prismjs && config.prismjs.enable)) {
highlight = JSON.stringify({
plugin: config.highlight.enable ? 'highlighjs' : 'prismjs',
highlightCopy: theme.highlight_copy,
highlightLang: theme.highlight_lang
})
}
let date_suffix = 'undefined';
if (theme.aside.card_webinfo.last_push_date) {
date_suffix = JSON.stringify({
one_hour: _p("date_suffix.one_hour"),
hours: _p("date_suffix.hours"),
day: _p('date_suffix.day')
})
}
script. script.
var GLOBAL_CONFIG = { var GLOBAL_CONFIG = {
root: '!{config.root}', root: '!{config.root}',
hexoversion: '!{get_hexo_version()}',
algolia: !{algolia}, algolia: !{algolia},
localSearch: !{localSearch}, localSearch: !{localSearch},
translate: !{translate}, translate: !{translate},
noticeOutdate: !{noticeOutdate},
highlight: !{highlight},
copy: { copy: {
success: '!{_p("copy.success")}', success: '!{_p("copy.success")}',
error: '!{_p("copy.error")}', error: '!{_p("copy.error")}',
@@ -89,8 +123,8 @@ script.
message_prev: '!{_p("Snackbar.bookmark.message_prev")}', message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
message_next: '!{_p("Snackbar.bookmark.message_next")}' message_next: '!{_p("Snackbar.bookmark.message_next")}'
}, },
runtime_unit: '!{_p("runtime_unit")}', runtime: '!{theme.runtimeshow.enable ? _p("aside.card_webinfo.runtime.unit") : ""}',
runtime: !{theme.runtimeshow.enable}, date_suffix: !{date_suffix},
copyright: !{copyright}, copyright: !{copyright},
ClickShowText: !{ClickShowText}, ClickShowText: !{ClickShowText},
medium_zoom: !{theme.medium_zoom}, medium_zoom: !{theme.medium_zoom},
@@ -101,10 +135,38 @@ script.
css: '!{theme.CDN.justifiedGallery_css}' css: '!{theme.CDN.justifiedGallery_css}'
}, },
baiduPush: !{theme.baidu_push}, baiduPush: !{theme.baidu_push},
highlightCopy: !{theme.highlight_copy},
highlightLang: !{theme.highlight_lang},
isPhotoFigcaption: !{theme.photofigcaption}, isPhotoFigcaption: !{theme.photofigcaption},
islazyload: !{theme.lazyload.enable}, islazyload: !{theme.lazyload.enable},
isanchor: !{theme.anchor} isanchor: !{theme.anchor}
};
var saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
} }

View File

@@ -1,17 +1,19 @@
- -
let isHighlightShrink let isHighlightShrink
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined' if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
else if (page.highlight_shrink !== undefined) isHighlightShrink = page.highlight_shrink else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
else isHighlightShrink = theme.highlight_shrink else isHighlightShrink = theme.highlight_shrink
const pageToc = page.toc !== undefined ? page.toc : theme.toc.enable const pageToc = page.toc === true || page.toc === false ? page.toc : theme.toc.enable
const showToc = is_post() && pageToc && (toc(page.content) !== '' || page.encrypt == true ) const showToc = is_post() && pageToc && (toc(page.content) !== '' || page.encrypt == true )
- -
script. script#config_change
.
var GLOBAL_CONFIG_SITE = { var GLOBAL_CONFIG_SITE = {
isPost: !{is_post()}, isPost: !{is_post()},
isHome: !{is_home()}, isHome: !{is_home()},
isHighlightShrink: !{isHighlightShrink}, isHighlightShrink: !{isHighlightShrink},
isSidebar: !{showToc} isSidebar: !{showToc},
postUpdate: '!{full_date(page.updated)}'
} }

View File

@@ -1,25 +1,20 @@
script. if theme.darkmode.enable
script.
var activateDarkMode = function () { var activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark') document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) { if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#000') document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
} }
} }
var activateLightMode = function () { var activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light') document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) { if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#fff') document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
} }
} }
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 autoChangeMode = '#{theme.darkmode.autoChangeMode}'
var t = getCookies('theme') var t = saveToLocal.get('theme')
if (autoChangeMode === '1') { if (autoChangeMode === '1') {
var isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches var isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
var isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches var isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
@@ -30,14 +25,13 @@ script.
if (isLightMode) activateLightMode() if (isLightMode) activateLightMode()
else if (isDarkMode) activateDarkMode() else if (isDarkMode) activateDarkMode()
else if (isNotSpecified || hasNoSupport) { else if (isNotSpecified || hasNoSupport) {
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
var now = new Date() var now = new Date()
var hour = now.getHours() var hour = now.getHours()
var isNight = hour <= 6 || hour >= 18 var isNight = hour <= 6 || hour >= 18
isNight ? activateDarkMode() : activateLightMode() isNight ? activateDarkMode() : activateLightMode()
} }
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) { window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
if (Cookies.get('theme') === undefined) { if (saveToLocal.get('theme') === undefined) {
e.matches ? activateDarkMode() : activateLightMode() e.matches ? activateDarkMode() : activateLightMode()
} }
}) })

View File

@@ -1,5 +1,7 @@
if (theme.google_adsense && theme.google_adsense.enable) if (theme.google_adsense && theme.google_adsense.enable)
script(async src=theme.google_adsense.js) script(async src=theme.google_adsense.js)
if theme.google_adsense.auto_ads
script. script.
(adsbygoogle = window.adsbygoogle || []).push({ (adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: '!{theme.google_adsense.client}', google_ad_client: '!{theme.google_adsense.client}',

View File

@@ -1,9 +1,9 @@
noscript. noscript.
<style> <style type="text/css">
#nav { #nav {
opacity: 1 opacity: 1
} }
.justified-gallery img{ .justified-gallery img {
opacity: 1 opacity: 1
} }
</style> </style>

View File

@@ -7,9 +7,12 @@ if theme.baidu_analytics
link(rel="preconnect" href="//hm.baidu.com") link(rel="preconnect" href="//hm.baidu.com")
if theme.tencent_analytics if theme.tencent_analytics
link(rel="preconnect" href="//ta.qq.com") link(rel="preconnect" href="//pingjs.qq.com")
if theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1 if theme.cnzz_analytics
link(rel="preconnect" href="//s4.cnzz.com")
if theme.blog_title_font && 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) link(rel="preconnect" href="//fonts.googleapis.com" crossorigin)
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

View File

@@ -1,13 +1,11 @@
link(rel="manifest" href=theme.pwa.manifest) link(rel="manifest" href=url_for(theme.pwa.manifest))
if(theme.pwa.theme_color)
meta(name="theme-color" content=theme.pwa.theme_color)
if(theme.pwa.theme_color) if(theme.pwa.theme_color)
meta(name="msapplication-TileColor" content=theme.pwa.theme_color) meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
if(theme.pwa.apple_touch_icon) if(theme.pwa.apple_touch_icon)
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon) link(rel="apple-touch-icon" sizes="180x180" href=url_for(theme.pwa.apple_touch_icon))
if(theme.pwa.favicon_32_32) if(theme.pwa.favicon_32_32)
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32) link(rel="icon" type="image/png" sizes="32x32" href=url_for(theme.pwa.favicon_32_32))
if(theme.pwa.favicon_16_16) if(theme.pwa.favicon_16_16)
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16) link(rel="icon" type="image/png" sizes="16x16" href=url_for(theme.pwa.favicon_16_16))
if(theme.pwa.mask_icon) if(theme.pwa.mask_icon)
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5") link(rel="mask-icon" href=url_for(theme.pwa.mask_icon) color="#5bbad5")

View File

@@ -9,3 +9,6 @@ if theme.baidu_site_verification
if theme.qihu_site_verification if theme.qihu_site_verification
meta(name="360-site-verification" content=theme.qihu_site_verification) meta(name="360-site-verification" content=theme.qihu_site_verification)
if theme.yandex_site_verification
meta(name="yandex-verification" content=theme.yandex_site_verification)

View File

@@ -1,130 +0,0 @@
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]}'
}

View File

@@ -1,4 +1,8 @@
.menus_items if theme.menu
//- for mobile sidebar
- let sidebarChildHide = theme.hide_sidebar_menu_child ? 'hide' : ''
.menus_items
each value, label in theme.menu each value, label in theme.menu
if !Array.isArray(value) if !Array.isArray(value)
.menus_item .menus_item
@@ -8,11 +12,11 @@
span=' '+label span=' '+label
else else
.menus_item .menus_item
a.site-page a.site-page(href='javascript:void(0);')
if label.split('||')[1] if label.split('||')[1]
i.fa-fw(class=trim(label.split('||')[1]) ) i.fa-fw(class=trim(label.split('||')[1]))
span=' '+ trim(label.split('||')[0]) span=' '+ trim(label.split('||')[0])
i.fas.fa-chevron-down.menus-expand i.fas.fa-chevron-down.expand(class=sidebarChildHide)
ul.menus_item_child ul.menus_item_child
each i in value each i in value
li li

View File

@@ -1,16 +1,16 @@
nav#nav nav#nav
span#blog_name.pull-left span#blog_name
a#site-name.blog_title(href=url_for('/')) #[=config.title] a#site-name(href=url_for('/')) #[=config.title]
span.pull-right.menus span#menus
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable) if (theme.algolia_search.enable || theme.local_search.enable)
#search_button #search_button
a.site-page.social-icon.search a.site-page.social-icon.search
i.fas.fa-search.fa-fw i.fas.fa-search.fa-fw
span=' '+_p('search') span=' '+_p('search')
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')}) !=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
span.toggle-menu.close span#toggle-menu.close
a.site-page a.site-page
i.fas.fa-bars.fa-fw i.fas.fa-bars.fa-fw

View File

@@ -5,84 +5,79 @@
#post-meta #post-meta
.meta-firstline .meta-firstline
if (theme.post_meta.post.date_type) if (theme.post_meta.post.date_type)
span.post-meta-date
if (theme.post_meta.post.date_type === 'both') if (theme.post_meta.post.date_type === 'both')
time.post-meta__date i.far.fa-calendar-alt.fa-fw.post-meta-icon
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date)) span.post-meta-label= _p('post.created')
i.far.fa-calendar-alt.fa-fw time.post-meta-date-created(datetime=date_xml(page.date) title=_p('post.created') + ' ' + full_date(page.date))=date(page.date, config.date_format)
=' '+_p('post.created')+' '+date(page.date, config.date_format) span.post-meta-separator |
span.post-meta__separator | i.fas.fa-history.fa-fw.post-meta-icon
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated)) span.post-meta-label= _p('post.updated')
i.fas.fa-history.fa-fw time.post-meta-date-updated(datetime=date_xml(page.updated) title=_p('post.updated') + ' ' + full_date(page.updated))=date(page.updated, config.date_format)
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
else else
- var data_type_update = theme.post_meta.post.date_type === 'updated' - let data_type_update = theme.post_meta.post.date_type === 'updated'
- var date_type = data_type_update ? 'updated' : 'date' - let date_type = data_type_update ? 'updated' : 'date'
- var date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt' - let date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt'
- var data_info = data_type_update ? _p('post.updated') : _p('post.created') - let 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.post-meta-icon(class=date_icon)
i.fa-fw(class=date_icon) span.post-meta-label= data_info
=' ' + data_info + ' ' + date(page[date_type], config.date_format) time(datetime=date_xml(page[date_type]) title=date_title + ' ' + full_date(page[date_type]))=date(page[date_type], config.date_format)
if (theme.post_meta.post.categories && page.categories.data.length > 0) if (theme.post_meta.post.categories && page.categories.data.length > 0)
span.post-meta__categories span.post-meta-categories
if (theme.post_meta.post.date_type) if (theme.post_meta.post.date_type)
span.post-meta__separator | span.post-meta-separator |
each item, index in page.categories.data each item, index in page.categories.data
i.fas.fa-inbox.fa-fw.post-meta__icon i.fas.fa-inbox.fa-fw.post-meta-icon
a(href=url_for(item.path)).post-meta__categories #[=item.name] a(href=url_for(item.path)).post-meta-categories #[=item.name]
if (index < page.categories.data.length - 1) if (index < page.categories.data.length - 1)
i.fas.fa-angle-right.post-meta__separator i.fas.fa-angle-right.post-meta-separator
.meta-secondline .meta-secondline
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read) - let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
if (postWordcount) if (postWordcount)
span.post-meta-separator |
span.post-meta-wordcount span.post-meta-wordcount
if theme.wordcount.post_wordcount if theme.wordcount.post_wordcount
i.far.fa-file-word.fa-fw.post-meta__icon i.far.fa-file-word.fa-fw.post-meta-icon
span= _p('post.wordcount') + ':' span.post-meta-label= _p('post.wordcount') + ':'
span.word-count= wordcount(page.content) span.word-count= wordcount(page.content)
if theme.wordcount.min2read if theme.wordcount.min2read
span.post-meta__separator | span.post-meta-separator |
if theme.wordcount.min2read if theme.wordcount.min2read
i.far.fa-clock.fa-fw.post-meta__icon i.far.fa-clock.fa-fw.post-meta-icon
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160})) span.post-meta-label= _p('post.min2read') + ':'
span= min2read(page.content, {cn: 350, en: 160}) + _p('post.min2read_unit')
.meta-thirdline
span.post-meta-pv-cv
if (postWordcount && theme.busuanzi.page_pv)
span.post-meta__separator |
if theme.busuanzi.page_pv if theme.busuanzi.page_pv
i.far.fa-eye.fa-fw.post-meta__icon span.post-meta-separator |
span=_p('post.page_pv') + ':' span.post-meta-pv-cv
i.far.fa-eye.fa-fw.post-meta-icon
span.post-meta-label=_p('post.page_pv') + ':'
span#busuanzi_value_page_pv span#busuanzi_value_page_pv
if !theme.comments.lazyload && page.comments !== false && theme.comments.use && theme.comments.count
- var whichCount = theme.comments.use[0]
if whichCount !== 'Livere' && whichCount !== 'Utterances'
span.post-meta-separator |
span.post-meta-commentcount 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 whichCount === 'Disqus' || whichCount === 'Disqusjs'
if (postWordcount || theme.busuanzi.page_pv) i.far.fa-comments.fa-fw.post-meta-icon
span.post-meta__separator | span.post-meta-label= _p('post.comments') + ':'
i.far.fa-comments.fa-fw.post-meta__icon
span= _p('post.comments') + ':'
span.disqus-comment-count.comment-count span.disqus-comment-count.comment-count
a(href=full_url_for(page.path) + '#disqus_thread') a(href=full_url_for(page.path) + '#disqus_thread')
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false) else if whichCount === 'Valine'
if (postWordcount || theme.busuanzi.page_pv) i.far.fa-comments.fa-fw.post-meta-icon
span.post-meta__separator | span.post-meta-label= _p('post.comments') + ':'
i.far.fa-comments.fa-fw.post-meta__icon
span= _p('post.comments') + ':'
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl") a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount") 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) else if whichCount === 'Gitalk'
if (postWordcount || theme.busuanzi.page_pv) i.far.fa-comments.fa-fw.post-meta-icon
span.post-meta__separator | span.post-meta-label= _p('post.comments') + ':'
i.far.fa-comments.fa-fw.post-meta__icon
span= _p('post.comments') + ':'
a(href=url_for(page.path) + '#post-comment') a(href=url_for(page.path) + '#post-comment')
span.gitalk-comment-count.comment-count span.gitalk-comment-count.comment-count
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false else if whichCount === 'Facebook Comments'
if (postWordcount || theme.busuanzi.page_pv) i.far.fa-comments.fa-fw.post-meta-icon
span.post-meta__separator | span.post-meta-label= _p('post.comments') + ':'
i.far.fa-comments.fa-fw.post-meta__icon
span= _p('post.comments') + ':'
a.comment-count(href=url_for(page.path) + '#post-comment') a.comment-count(href=url_for(page.path) + '#post-comment')
span.fb-comments-count(data-href=urlNoIndex()) span.fb-comments-count(data-href=urlNoIndex())

View File

@@ -1,6 +1,4 @@
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : '' - var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
- var pageHighlightShrinkSet = page.highlight_shrink !== undefined ? page.highlight_shrink : theme.highlight_shrink
- var pageHighlightShrink = theme.highlight_shrink !== 'none' && pageHighlightShrinkSet ? 'code-close' : ''
doctype html doctype html
html(lang=config.language data-theme=theme.display_mode) html(lang=config.language data-theme=theme.display_mode)
@@ -10,18 +8,14 @@ html(lang=config.language data-theme=theme.display_mode)
if theme.preloader if theme.preloader
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache}) !=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
if theme.fireworks && theme.fireworks.enable
canvas.fireworks
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache}) !=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
include ./sidebar.pug #body-wrap
#body-wrap(class=pageHighlightShrink)
if theme.background if theme.background
- var is_photo = theme.background.startsWith('url') ? 'photo':'color' - var is_photo = theme.background.startsWith('url') ? 'photo':'color'
#web_bg(data-type=is_photo) #web_bg(data-type=is_photo)
include ./sidebar.pug
include ./header/index.pug include ./header/index.pug
if (!is_post()) if (!is_post())
@@ -30,7 +24,8 @@ html(lang=config.language data-theme=theme.display_mode)
div!= body div!= body
else else
block content block content
include widget/index.pug if theme.aside.enable && page.aside !== false
!=partial('includes/widget/index', {}, {cache:theme.fragment_cache})
else else
main#content-inner.layout_post main#content-inner.layout_post
if body if body
@@ -44,5 +39,5 @@ html(lang=config.language data-theme=theme.display_mode)
!=partial('includes/footer', {}, {cache:theme.fragment_cache}) !=partial('includes/footer', {}, {cache:theme.fragment_cache})
include ./rightside.pug include ./rightside.pug
!=partial('includes/search/index', {}, {cache:theme.fragment_cache}) !=partial('includes/third-party/search/index', {}, {cache:theme.fragment_cache})
include ./additional-js.pug include ./additional-js.pug

View File

@@ -1,27 +0,0 @@
script(type="text/x-mathjax-config").
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
CommonHTML: {
linebreaks: { automatic: true, width: "90% container" }
},
"HTML-CSS": {
linebreaks: { automatic: true, width: "90% container" }
},
"SVG": {
linebreaks: { automatic: true, width: "90% container" }
}
});
script(type="text/x-mathjax-config").
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for (i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
script(src=theme.CDN.mathjax)

View File

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

View File

@@ -2,19 +2,22 @@ mixin articleSort(posts)
.article-sort .article-sort
- var year - var year
- posts.each(function (article) { - posts.each(function (article) {
- var tempYear = date(article.date, 'YYYY') - let tempYear = date(article.date, 'YYYY')
- var no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : '' - let no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
- let title = article.title || _p('no_title')
if tempYear !== year if tempYear !== year
- year = tempYear - year = tempYear
.article-sort-item.year= year .article-sort-item.year= year
.article-sort-item(class=no_cover) .article-sort-item(class=no_cover)
if article.cover && theme.cover.archives_enable if article.cover && theme.cover.archives_enable
.article-sort-img a.article-sort-item-img(href=url_for(article.path) title=title)
a.article-sort-item__img(href=url_for(article.path)) if theme.lazyload.enable
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'`) img(data-lazy-src=url_for(article.cover) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
.article-sort-post else
a.article-sort-item__post(href=url_for(article.path)) img(src=url_for(article.cover) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
.article-sort-item-info
.article-sort-item-time
i.far.fa-calendar-alt i.far.fa-calendar-alt
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format) time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
.article-sort-item__title= article.title || 'No Title' a.article-sort-item-title(href=url_for(article.path) title=title)= title
- }) - })

View File

@@ -1,16 +1,16 @@
mixin postUI(posts) mixin postUI(posts)
each article , index in page.posts.data each article , index in page.posts.data
.recent-post-item .recent-post-item
- var link = article.link || article.path - let link = article.link || article.path
- var title = article.title || _p('no_title') - let title = article.title || _p('no_title')
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius' - let leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
- var post_cover = article.cover - let post_cover = article.cover
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : '' - let no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
if post_cover && theme.cover.index_enable if post_cover && theme.cover.index_enable
.post_cover(class=leftOrRight) .post_cover(class=leftOrRight)
a(href=url_for(link) title=title) a(href=url_for(link) title=title)
if theme.lazyload.enable 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) img.post_bg(data-lazy-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
else else
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title) 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) .recent-post-info(class=no_cover)
@@ -22,23 +22,23 @@ mixin postUI(posts)
span.sticky= _p('sticky') span.sticky= _p('sticky')
span.article-meta__separator | span.article-meta__separator |
if (theme.post_meta.page.date_type) if (theme.post_meta.page.date_type)
span.post-meta-date
if (theme.post_meta.page.date_type === 'both') 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 i.far.fa-calendar-alt
=date(article.date, config.date_format) span.article-meta-label=_p('post.created')
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))=date(article.date, config.date_format)
span.article-meta__separator | span.article-meta__separator |
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
i.fas.fa-history i.fas.fa-history
=date(article.updated, config.date_format) span.article-meta-label=_p('post.updated')
time.post-meta-date-updated(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated))=date(article.updated, config.date_format)
else else
- var data_type_updated = theme.post_meta.page.date_type === 'updated' - let data_type_updated = theme.post_meta.page.date_type === 'updated'
- var date_type = data_type_updated ? 'updated' : 'date' - let date_type = data_type_updated ? 'updated' : 'date'
- var date_icon = data_type_updated ? 'fas fa-history' :'far fa-calendar-alt' - let date_icon = data_type_updated ? 'fas fa-history' :'far fa-calendar-alt'
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created') - let 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) i(class=date_icon)
=date(article[date_type], config.date_format) span.article-meta-label=date_title
time(datetime=date_xml(article[date_type]) title=date_title + ' ' + full_date(article[date_type]))=date(article[date_type], config.date_format)
if (theme.post_meta.page.categories && article.categories.data.length > 0) if (theme.post_meta.page.categories && article.categories.data.length > 0)
span.article-meta span.article-meta
span.article-meta__separator | span.article-meta__separator |

View File

@@ -1,5 +1,8 @@
#mobile-sidebar-menus #mobile-sidebar-menus
.mobile_author_icon .mobile_author_icon
if theme.lazyload.enable
img.avatar-img(data-lazy-src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar")
else
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar") img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar")
.mobile_post_data .mobile_post_data
if site.posts.length if site.posts.length

View File

@@ -18,7 +18,7 @@ else
- var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover - var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
a(href=url_for(page.prev.path)) a(href=url_for(page.prev.path))
if theme.lazyload.enable if theme.lazyload.enable
img.prev-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` ) img.prev-cover(data-lazy-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` )
else else
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` ) img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` )
.pagination-info .pagination-info
@@ -31,7 +31,7 @@ else
.next-post(class=hasPagePrev) .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(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`) img.next-cover(data-lazy-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`)
else else
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`) img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`)
.pagination-info .pagination-info

View File

@@ -1,13 +1,17 @@
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false) if theme.post_copyright.enable && page.copyright !== false
- let author = page.copyright_author ? page.copyright_author : config.author
- let authorHref = page.copyright_author_href ? page.copyright_author_href : `mailto:${config.email}`
- let url = page.copyright_url ? page.copyright_url : page.permalink
- let info = page.copyright_info ? page.copyright_info : _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
.post-copyright .post-copyright
.post-copyright__author .post-copyright__author
span.post-copyright-meta= _p('post.copyright.author') + ": " span.post-copyright-meta= _p('post.copyright.author') + ": "
span.post-copyright-info span.post-copyright-info
a(href=`mailto:${config.email}`) #[=config.author] a(href=authorHref)=author
.post-copyright__type .post-copyright__type
span.post-copyright-meta= _p('post.copyright.link') + ": " span.post-copyright-meta= _p('post.copyright.link') + ": "
span.post-copyright-info span.post-copyright-info
a(href=url_for(page.permalink))= theme.post_copyright.decode ? decodeURI(page.permalink) : page.permalink a(href=url_for(url))= theme.post_copyright.decode ? decodeURI(url) : url
.post-copyright__notice .post-copyright__notice
span.post-copyright-meta= _p('post.copyright.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) span.post-copyright-info!= info

View File

@@ -1,5 +1,5 @@
.post-reward .post-reward
button.reward-button .reward-button
i.fas.fa-qrcode i.fas.fa-qrcode
= ' ' + _p('donate') = ' ' + _p('donate')
.reward-main .reward-main
@@ -7,6 +7,10 @@
each item in theme.reward.QR_code each item in theme.reward.QR_code
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img - var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
li.reward-item 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)}')`) a(href=clickTo target='_blank')
.post-qr-code__desc=(item.itemlist||item).text if theme.lazyload.enable
img.post-qr-code-img(data-lazy-src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
else
img.post-qr-code-img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
.post-qr-code-desc=(item.itemlist||item).text

View File

@@ -1,32 +1,28 @@
section#rightside.rightside section#rightside
#rightside-config-hide #rightside-config-hide
if is_post() if is_post()
if theme.readmode if theme.readmode
button#readmode(title=_p('rightside.readmode_title')) button#readmode(type="button" title=_p('rightside.readmode_title'))
i.fas.fa-book-open i.fas.fa-book-open
button#font_plus(title=_p('rightside.font_plus_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
button#translateLink.translate_chn_to_cht(title=_p('rightside.translate_title'))= theme.translate.default button#translateLink(type="button" title=_p('rightside.translate_title'))= theme.translate.default
if theme.darkmode.enable && theme.darkmode.button if theme.darkmode.enable && theme.darkmode.button
button#darkmode(title=_p('rightside.night_mode_title')) button#darkmode(type="button" title=_p('rightside.night_mode_title'))
i.fas.fa-adjust i.fas.fa-adjust
#rightside-config-show #rightside-config-show
button#rightside_config(title=_p("rightside.setting")) button#rightside_config(type="button" title=_p("rightside.setting"))
i.fas.fa-cog i.fas.fa-cog
if is_post() && page.comments !== false && isComment if is_post() && page.comments !== false && theme.comments.use
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment")) a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
i.scroll_to_comment.fas.fa-comments i.fas.fa-comments
if showToc if showToc
button#mobile-toc-button.close(title=_p("rightside.toc")) button#mobile-toc-button.close(type="button" title=_p("rightside.toc"))
i.fas.fa-list-ul i.fas.fa-list-ul
if theme.chat_btn && (theme.chatra.enable || theme.tidio.enable || theme.daovoice.enable || theme.gitter.enable) if theme.chat_btn
button#chat_btn(title=_p("rightside.chat_btn")) button#chat_btn(type="button" title=_p("rightside.chat_btn"))
i.fas.fa-sms i.fas.fa-sms
button#go-up(title=_p("rightside.back_to_top")) button#go-up(type="button" title=_p("rightside.back_to_top"))
i.fas.fa-arrow-up i.fas.fa-arrow-up

View File

@@ -1,5 +0,0 @@
if (theme.algolia_search.enable)
include ./algolia.pug
if (theme.local_search)
if (!theme.algolia_search.enable && theme.local_search.enable)
include ./local-search.pug

View File

@@ -1,7 +0,0 @@
.post_share
if theme.addThis.enable
include ./add-this.pug
else if theme.sharejs && theme.sharejs.enable
include ./share-js.pug
else if theme.addtoany.enable
include ./addtoany.pug

View File

@@ -1,4 +0,0 @@
if (theme.sharejs && theme.sharejs.enable)
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
script(src=url_for(theme.CDN.sharejs))

View File

@@ -5,8 +5,8 @@
- -
if(showToc) if(showToc)
i.fas.fa-arrow-right#toggle-sidebar(class=autoOpenSidebar)
#sidebar #sidebar
i.fas.fa-arrow-right#toggle-sidebar(class=autoOpenSidebar)
.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

View File

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

View File

@@ -1 +0,0 @@
script(id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))

View File

@@ -1,3 +0,0 @@
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)

View File

@@ -12,10 +12,13 @@ script.
})(document, window, 'Chatra'); })(document, window, 'Chatra');
if (!{theme.chat_btn}) { if (!{theme.chat_btn}) {
var chatBtnFn = () => {
var chatBtn = document.getElementById("chat_btn") var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){ chatBtn.addEventListener("click", function(){
Chatra('openChat') Chatra('openChat')
}); });
}
chatBtnFn()
} else { } else {
if (!{theme.chat_hide_show}) { if (!{theme.chat_hide_show}) {
function chatBtnHide () { function chatBtnHide () {

View File

@@ -0,0 +1,36 @@
script.
window.$crisp = [];
window.CRISP_WEBSITE_ID = "!{theme.crisp.website_id}";
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
$crisp.push(["safe", true])
if (!{theme.chat_btn}) {
$crisp.push(["do", "chat:hide"])
$crisp.push(["on", "chat:closed", function() {
$crisp.push(["do", "chat:hide"])
}])
var chatBtnFn = () => {
var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){
$crisp.push(["do", "chat:show"])
$crisp.push(["do", "chat:open"])
});
}
chatBtnFn()
} else {
if (!{theme.chat_hide_show}) {
function chatBtnHide () {
$crisp.push(["do", "chat:hide"])
}
function chatBtnShow () {
$crisp.push(["do", "chat:show"])
}
}
}

View File

@@ -13,10 +13,13 @@ script.
daovoice('update'); daovoice('update');
if (isChatBtn) { if (isChatBtn) {
var chatBtnFn = () => {
var chatBtn = document.getElementById("chat_btn") var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){ chatBtn.addEventListener("click", function(){
daovoice('show') daovoice('show')
}); });
}
chatBtnFn()
} else { } else {
if (!{theme.chat_hide_show}) { if (!{theme.chat_hide_show}) {
function chatBtnHide () { function chatBtnHide () {

View File

@@ -0,0 +1,43 @@
if theme.chat_btn
script.
((window.gitter = {}).chat = {}).options = {
disableDefaultChat: true,
};
document.addEventListener('gitter-sidecar-ready', (e) => {
const GitterChat = e.detail.Chat
let chat
function initGitter () {
chat = new GitterChat({
room: '#{theme.gitter.room}',
activationElement: '#chat_btn'
});
}
initGitter()
if (!{theme.pjax.enable}) {
document.addEventListener('pjax:complete', () => {
chat.destroy()
initGitter()
})
}
})
else
script.
((window.gitter = {}).chat = {}).options = {
room: '#{theme.gitter.room}',
};
if (!{theme.chat_hide_show}) {
function chatBtnHide () {
document.getElementsByClassName('gitter-open-chat-button')[0].style.display= 'none'
}
function chatBtnShow () {
document.getElementsByClassName('gitter-open-chat-button')[0].style.display= 'block'
}
}
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)

View File

@@ -6,3 +6,5 @@ else if theme.daovoice && theme.daovoice.enable
include ./daovoice.pug include ./daovoice.pug
else if theme.gitter && theme.gitter.enable else if theme.gitter && theme.gitter.enable
include ./gitter.pug include ./gitter.pug
else if theme.crisp && theme.crisp.enable
include ./crisp.pug

View File

@@ -0,0 +1,41 @@
script(src=`//code.tidio.co/${theme.tidio.public_key}.js` async)
if theme.chat_btn
script.
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);
}
var chatBtnFn = () => {
document.getElementById("chat_btn").addEventListener("click", function(){
window.tidioChatApi.show();
window.tidioChatApi.open();
});
}
chatBtnFn()
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'
}
}

View File

@@ -0,0 +1,45 @@
script.
function loadDisqus () {
var disqus_config = function () {
this.page.url = '!{ page.permalink }'
this.page.identifier = '!{ page.path }'
this.page.title = '!{ page.title }'
};
window.disqusReset = () => {
DISQUS.reset({
reload: true,
config: disqus_config
})
}
if (window.DISQUS) disqusReset()
else {
(function() {
var d = document, s = d.createElement('script');
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
}
}
if ('!{theme.comments.use[0]}' === 'Disqus' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('disqus_thread'), loadDisqus)
else loadDisqus()
} else {
function loadOtherComment () {
loadDisqus()
}
}
if is_post() && !theme.comments.lazyload && theme.comments.count && theme.comments.use[0] === 'Disqus'
script.
if (window.DISQUSWIDGETS === undefined) {
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);
} else {
DISQUSWIDGETS.getCount({reset: true});
}

View File

@@ -0,0 +1,57 @@
script.
function loadDisqusjs () {
function addDisqusjsCSS () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.disqusjs_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
}
function initDisqusjs () {
window.DISQUS = null
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}'
});
}
window.disqusReset = initDisqusjs
if (window.disqusJsLoad) initDisqusjs()
else {
addDisqusjsCSS()
$.getScript('!{url_for(theme.CDN.disqusjs)}', initDisqusjs)
window.disqusJsLoad = true
}
}
if ('!{theme.comments.use[0]}' === 'Disqusjs' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('disqus_thread'), loadDisqusjs)
else loadDisqusjs()
}
else {
function loadOtherComment () {
loadDisqusjs()
}
}
if is_post() && !theme.comments.lazyload && theme.comments.count && theme.comments.use[0] === 'Disqusjs'
script.
if (window.DISQUSWIDGETS === undefined) {
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);
} else {
DISQUSWIDGETS.getCount({reset: true});
}

View File

@@ -0,0 +1,26 @@
#fb-root
script.
function loadFBComment () {
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
if (typeof FB === 'object') FB.XFBML.parse()
else {
let ele = document.createElement('script')
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v7.0')
ele.setAttribute('async', 'true')
ele.setAttribute('defer', 'true')
ele.setAttribute('crossorigin', 'anonymous')
document.getElementById('fb-root').insertAdjacentElement('afterbegin',ele)
}
}
if ('!{theme.comments.use[0]}' === 'Facebook Comments' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.querySelector('#post-comment .fb-comments'), loadFBComment)
else loadFBComment()
} else {
function loadOtherComment () {
loadFBComment()
}
}

View File

@@ -0,0 +1,52 @@
script.
function addGitalkSource () {
const ele = document.createElement('link')
ele.rel = 'stylesheet'
ele.href= '!{url_for(theme.CDN.gitalk_css)}'
document.getElementsByTagName('head')[0].appendChild(ele)
}
function loadGitalk () {
function initGitalk () {
var gitalk = new Gitalk({
clientID: '!{theme.gitalk.client_id}',
clientSecret: '!{theme.gitalk.client_secret}',
repo: '!{theme.gitalk.repo}',
owner: '!{theme.gitalk.owner}',
admin: ['!{theme.gitalk.admin}'],
id: '!{md5(page.path)}',
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')
}
if (typeof Gitalk === 'function') initGitalk()
else {
addGitalkSource()
$.getScript('!{url_for(theme.CDN.gitalk)}', initGitalk)
}
}
function commentCount(n){
let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
if (isCommentCount) {
isCommentCount.innerHTML= n
}
}
if ('!{theme.comments.use[0]}' === 'Gitalk' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
else loadGitalk()
} else {
function loadOtherComment () {
loadGitalk()
}
}

View File

@@ -0,0 +1,38 @@
- let defaultComment = theme.comments.use[0]
hr
#post-comment
.comment-head
.comment-headline
i.fas.fa-comments.fa-fw
span= ' ' + _p('comment')
if theme.comments.use.length > 1
.comment-switch
span.first-comment=defaultComment
label
input#switch-comments-btn(type="checkbox")
span.slider
span.second-comment=theme.comments.use[1]
.comment-wrap
each name in theme.comments.use
div
case name
when 'Disqus'
#disqus_thread
when 'Valine'
#vcomment.vcomment
when 'Disqusjs'
#disqus_thread
when 'Livere'
#lv-container(data-id="city" data-uid=theme.livere.uid)
when 'Gitalk'
#gitalk-container
when 'Utterances'
#utterances-wrap
when 'Facebook Comments'
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
data-numposts= theme.facebook_comments.pageSize || 10
data-order-by= theme.facebook_comments.order_by || 'social'
data-width="100%")

View File

@@ -0,0 +1,16 @@
each name in theme.comments.use
case name
when 'Valine'
!=partial('includes/third-party/comments/valine', {}, {cache:theme.fragment_cache})
when 'Disqus'
include ./disqus.pug
when 'Disqusjs'
include ./disqusjs.pug
when 'Livere'
!=partial('includes/third-party/comments/livere', {}, {cache:theme.fragment_cache})
when 'Gitalk'
include ./gitalk.pug
when 'Utterances'
!=partial('includes/third-party/comments/utterances', {}, {cache:theme.fragment_cache})
when 'Facebook Comments'
!=partial('includes/third-party/comments/facebook_comments', {}, {cache:theme.fragment_cache})

View File

@@ -0,0 +1,26 @@
script.
function loadLivere () {
if (typeof LivereTower === 'object') {
window.LivereTower.init()
}
else {
(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');
}
}
if ('!{theme.comments.use[0]}' === 'Livere' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('lv-container'), loadLivere)
else loadLivere()
}
else {
function loadOtherComment () {
loadLivere()
}
}

View File

@@ -0,0 +1,34 @@
script.
function loadUtterances () {
let ele = document.createElement('script')
ele.setAttribute('id', 'utterances_comment')
ele.setAttribute('src', '!{url_for(theme.CDN.utterances)}')
ele.setAttribute('repo', '!{theme.utterances.repo}')
ele.setAttribute('issue-term', '!{theme.utterances.issue_term}')
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
ele.setAttribute('theme', nowTheme)
ele.setAttribute('crossorigin', 'anonymous')
ele.setAttribute('async', 'true')
document.getElementById('utterances-wrap').insertAdjacentElement('afterbegin',ele)
}
function utterancesTheme () {
if (document.querySelector('.utterances-frame')) {
const 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');
}
}
if ('!{theme.comments.use[0]}' === 'Utterances' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('utterances-wrap'), loadUtterances)
else loadUtterances()
} else {
function loadOtherComment () {
loadUtterances()
}
}

View File

@@ -0,0 +1,40 @@
- let emojiMaps = '""'
if site.data.valine
- emojiMaps = JSON.stringify(site.data.valine)
script.
function loadValine () {
function initValine () {
window.valine = new Valine({
el: '#vcomment',
appId: '#{theme.valine.appId}',
appKey: '#{theme.valine.appKey}',
placeholder: '#{theme.valine.placeholder}',
avatar: '#{theme.valine.avatar}',
meta: '#{theme.valine.guest_info }'.split(','),
pageSize: '#{theme.valine.pageSize}',
lang: '#{theme.valine.lang}',
recordIP: #{theme.valine.recordIP},
serverURLs: '#{theme.valine.serverURLs}',
emojiCDN: '#{theme.valine.emojiCDN}',
emojiMaps: !{emojiMaps},
enableQQ: #{theme.valine.enableQQ},
path: window.location.pathname,
});
if ('#{theme.valine.requiredFields}') { valine.config.requiredFields= '#{theme.valine.requiredFields}'.split(',') }
}
if (typeof Valine === 'function') initValine()
else $.getScript('!{url_for(theme.CDN.valine)}', initValine)
}
if ('!{theme.comments.use[0]}' === 'Valine' || !!{theme.comments.lazyload}) {
if (!{theme.comments.lazyload}) btf.loadComment(document.querySelector('#vcomment'),loadValine)
else setTimeout(() => loadValine(), 0)
} else {
function loadOtherComment () {
loadValine()
}
}

28
layout/includes/third-party/effect.pug vendored Normal file
View File

@@ -0,0 +1,28 @@
if theme.fireworks && theme.fireworks.enable
canvas.fireworks
script(src=url_for(theme.CDN.anime))
script(src=url_for(theme.CDN.fireworks))
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
script(defer id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
if (theme.canvas_nest && theme.canvas_nest.enable)
script#canvas_nest(defer 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))
if theme.activate_power_mode.enable
script(src=url_for(theme.CDN.activate_power_mode))
script.
POWERMODE.colorful = !{theme.activate_power_mode.colorful};
POWERMODE.shake = !{theme.activate_power_mode.shake};
document.body.addEventListener('input', POWERMODE);
//- 鼠標特效
if theme.click_heart
script(src=url_for(theme.CDN.click_heart) async)
if theme.ClickShowText && theme.ClickShowText.enable
script(src=url_for(theme.CDN.ClickShowText) async)

View File

@@ -13,3 +13,6 @@ if theme.katex && theme.katex.enable
else else
if page.katex if page.katex
include ./katex.pug include ./katex.pug
if theme.mermaid.enable
include ./mermaid.pug

View File

@@ -0,0 +1,53 @@
//- Mathjax 3
//- http://docs.mathjax.org/en/latest/upgrading/v2.html#changes-in-the-mathjax-api
//- https://github.com/mathjax/MathJax/issues/2209
//- http://docs.mathjax.org/en/latest/options/input/tex.html#the-configuration-block
//- http://docs.mathjax.org/en/latest/web/typeset.html#resetting-automatic-equation-numbering
script.
if (!window.MathJax) {
window.MathJax = {
loader: {
source: {
'[tex]/amsCd': '[tex]/amscd'
}
},
tex: {
inlineMath: [ ['$','$'], ["\\(","\\)"]],
tags: 'ams'
},
options: {
renderActions: {
findScript: [10, doc => {
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
const display = !!node.type.match(/; *mode=display/)
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
const text = document.createTextNode('')
node.parentNode.replaceChild(text, node)
math.start = {node: text, delim: '', n: 0}
math.end = {node: text, delim: '', n: 0}
doc.math.push(math)
}
}, ''],
addClass: [200,() => {
document.querySelectorAll('mjx-container:not([display=\'true\']').forEach( node => {
const target = node.parentNode
if (!target.classList.contains('has-jax')) {
target.classList.add('mathjax-overflow')
}
})
}, '', false]
}
}
}
var script = document.createElement('script')
script.src = '!{theme.CDN.mathjax}'
script.id = 'MathJax-script'
script.async = true
document.head.appendChild(script)
} else {
MathJax.startup.document.state(0)
MathJax.texReset()
MathJax.typeset()
}

View File

@@ -0,0 +1,15 @@
script.
if (document.getElementsByClassName('mermaid').length) {
if (window.mermaidJsLoad) mermaid.init()
else {
$.getScript('!{theme.CDN.mermaid}', function () {
window.mermaidJsLoad = true
mermaid.initialize({
theme: '!{theme.mermaid.theme}',
})
!{theme.pjax.enable} && mermaid.init()
})
}
}

View File

@@ -0,0 +1,71 @@
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<[^>]+>/g,"") // remove html tag
content = content.replace(/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|webp)/g, '') // remove image link
content = content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi, '') // remove url
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getDisqusComment = () => {
let disqusArray = []
$.getJSON('https://disqus.com/api/3.0/forums/listPosts.json?forum=!{theme.newest_comments.disqus.forum}&related=thread&limit=!{theme.newest_comments.limit}&api_key=!{theme.newest_comments.disqus.api_key}', function(data){
$.each(data.response, (i, item) => {
disqusArray.push({
'avatar': item.author.avatar.cache,
'content': changeContent(item.message),
'nick': item.author.name,
'url': item.url,
'date': item.createdAt
})
})
// set expiry to 10 min
saveToLocal.set('disqus-newest-comments', JSON.stringify(disqusArray), 10/(60*24))
generateHtml(disqusArray)
})
}
const generateHtml = array => {
let result = ''
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
result += `<a href='${array[i].url}' class="thumbnail"><img src='${array[i].avatar}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick}</span><time> / ${btf.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
let $dom = document.querySelector('.card-newest-comments .aside-list')
$dom.innerHTML= result
window.pjax && window.pjax.refresh($dom)
}
const newestCommentInit = () => {
if (document.querySelector('.card-newest-comments .aside-list')) {
const data = saveToLocal.get('disqus-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getDisqusComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,71 @@
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<[^>]+>/g,"") // remove html tag
content = content.replace(/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|webp)/g, '') // remove image link
content = content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi, '') // remove url
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getGithubIssues = () => {
let githubArray = []
$.getJSON('https://api.github.com/repos/!{theme.newest_comments.github_issues.repo}/issues/comments?sort=updated&direction=desc&per_page=!{theme.newest_comments.limit}&page=1', (data) => {
$.each(data, (index, item) => {
githubArray.push({
'avatar': item.user.avatar_url,
'content': changeContent(item.body),
'nick': item.user.login,
'url': item.html_url,
'date': item.updated_at
})
})
saveToLocal.set('github-newest-comments', JSON.stringify(githubArray), 10/(60*24))
generateHtml(githubArray)
})
}
const generateHtml = array => {
let result = ''
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
result += `<a href='${array[i].url}' class="thumbnail"><img src='${array[i].avatar}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick}</span><time> / ${btf.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
let $dom = document.querySelector('.card-newest-comments .aside-list')
$dom.innerHTML= result
window.pjax && window.pjax.refresh($dom)
}
const newestCommentInit = () => {
if (document.querySelector('.card-newest-comments .aside-list')) {
const data = saveToLocal.get('github-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getGithubIssues()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -0,0 +1,6 @@
if theme.newest_comments.leancloud.enable
include ./leancloud.pug
else if theme.newest_comments.github_issues.enable
include ./github-issues.pug
else if theme.newest_comments.disqus.enable
include ./disqus-comment.pug

View File

@@ -0,0 +1,98 @@
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js")
script.
window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<[^>]+>/g,"") // remove html tag
content = content.replace(/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|jpeg|gif|png|webp)/g, '') // remove image link
content = content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi, '') // remove url
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getIcon = (icon, mail) => {
if (icon) return icon
let defaultIcon = '!{ theme.newest_comments.leancloud.default_avatar ? `?d=${theme.newest_comments.leancloud.default_avatar}` : ''}'
let iconUrl = `https://gravatar.loli.net/avatar/${md5(mail.toLowerCase()) + defaultIcon}`
return iconUrl
}
const generateHtml = array => {
let result = ''
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (!{theme.newest_comments.avatar}) {
result += `<a href='${array[i].url}' class="thumbnail"><img src='${getIcon(array[i].avatar, array[i].mail)}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick}</span><time> / ${btf.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
let $dom = document.querySelector('.card-newest-comments .aside-list')
$dom.innerHTML= result
window.pjax && window.pjax.refresh($dom)
}
const getValineData = () => {
if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
const dataInit = {
appId: '!{theme.newest_comments.leancloud.appId}',
appKey: '!{theme.newest_comments.leancloud.appKey}'
}
if (!{theme.newest_comments.leancloud.serverURL ? true : false}) {
dataInit.serverURL= '!{theme.newest_comments.leancloud.serverURL}'
}
AV.init(dataInit)
}
const query = new AV.Query('Comment');
query.descending('createdAt').limit(!{theme.newest_comments.limit})
var valineArray = []
query.find().then(comments => {
comments.forEach(comment => {
valineArray.push({
'avatar': comment.get('QQAvatar'),
'content': changeContent(comment.get('comment')),
'mail': comment.get('mail'),
'nick': comment.get('nick'),
'url': comment.get('url'),
'date': comment.createdAt,
})
})
}).then(function() {
saveToLocal.set('leancloud-newest-comments', JSON.stringify(valineArray), 10/(60*24))
generateHtml(valineArray)
})
}
const newestCommentInit = () => {
if (document.querySelector('.card-newest-comments .aside-list')) {
const data = saveToLocal.get('leancloud-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
if (typeof window.AV === 'object') {
getValineData()
} else {
$.getScript('https://cdn.jsdelivr.net/npm/leancloud-storage@4.6.1/dist/av-min.js', getValineData)
}
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})

View File

@@ -1,12 +1,19 @@
script(src=url_for(theme.CDN.pangu)) script.
if theme.pangu.field === 'post' && is_post() function panguFn () {
script. if (typeof pangu === 'object') pangu.spacingElementById('content-inner')
document.addEventListener('DOMContentLoaded', function() { else {
pangu.autoSpacingPage() $.getScript('!{url_for(theme.CDN.pangu)}', () => {
}) pangu.spacingElementById('content-inner')
else if theme.pangu.field === 'site'
script.
document.addEventListener('DOMContentLoaded', function() {
pangu.autoSpacingPage()
}) })
}
}
function panguInit () {
if (!{theme.pangu.field === 'post'}){
GLOBAL_CONFIG_SITE.isPost && panguFn()
} else {
panguFn()
}
}
document.addEventListener('DOMContentLoaded', panguFn)

75
layout/includes/third-party/pjax.pug vendored Normal file
View File

@@ -0,0 +1,75 @@
- var pjaxExclude = 'a:not([target="_blank"])'
if theme.pjax.exclude
each val in theme.pjax.exclude
- pjaxExclude = pjaxExclude + `:not([href="${val}"])`
script(src=url_for(theme.CDN.pjax))
script.
let pjaxSelectors = [
'title',
'meta[name=description]',
'#config_change',
'#body-wrap',
'#rightside-config-hide',
'#rightside-config-show',
'.js-pjax'
]
if (!{Boolean(theme.Open_Graph_meta && theme.comments.use && theme.comments.use.includes('Livere'))}) {
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
}
var pjax = new Pjax({
elements: '!{pjaxExclude}',
selectors: pjaxSelectors,
cacheBust: false,
analytics: !{theme.google_analytics ? true : false},
scrollRestoration: false
})
document.addEventListener('pjax:complete', function () {
window.refreshFn()
$('script[data-pjax]').each(function () {
$(this).parent().append($(this).remove())
})
GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()
typeof chatBtnFn === 'function' && chatBtnFn()
typeof panguInit === 'function' && panguInit()
if (typeof gtag === 'function') {
gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname});
}
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
// Analytics
if (!{theme.tencent_analytics ? true : false}) {
MtaH5.pgv()
}
// prismjs
typeof Prism === 'object' && Prism.highlightAll()
})
document.addEventListener('pjax:send', function () {
if (window.aplayers) {
for (let i = 0; i < window.aplayers.length; i++) {
if (!window.aplayers[i].options.fixed) {
window.aplayers[i].destroy()
}
}
}
typeof typed === 'object' && typed.destroy()
$(window).off('scroll')
//reset readmode
$('body').hasClass('read-mode') && $('body').removeClass('read-mode')
})

View File

@@ -0,0 +1,5 @@
if config.prismjs && config.prismjs.enable && !config.prismjs.preprocess
script(src=url_for(theme.CDN.prismjs_js))
script(src=url_for(theme.CDN.prismjs_autoloader))
if config.prismjs.line_number
script(src=url_for(theme.CDN.prismjs_lineNumber_js))

View File

@@ -9,4 +9,4 @@
#algolia-stats #algolia-stats
span.search-close-button span.search-close-button
i.fas.fa-times i.fas.fa-times
.search-mask #search-mask

View File

@@ -0,0 +1,4 @@
if theme.algolia_search.enable
include ./algolia.pug
else if theme.local_search.enable
include ./local-search.pug

View File

@@ -20,4 +20,4 @@
| #[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.fas.fa-times i.fas.fa-times
.search-mask #search-mask

View File

@@ -1,6 +1,7 @@
.addtoany .addtoany
.a2a_kit.a2a_kit_size_32.a2a_default_style .a2a_kit.a2a_kit_size_32.a2a_default_style
each name in theme.addtoany.item - let addtoanyItem = theme.addtoany.item.split(',')
each name in addtoanyItem
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")

View File

@@ -0,0 +1,7 @@
.post_share
if theme.addThis.enable
!=partial('includes/third-party/share/add-this', {}, {cache:theme.fragment_cache})
else if theme.sharejs.enable
include ./share-js.pug
else if theme.addtoany.enable
!=partial('includes/third-party/share/addtoany', {}, {cache:theme.fragment_cache})

View File

@@ -0,0 +1,3 @@
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
script(src=url_for(theme.CDN.sharejs) defer)

137
layout/includes/third-party/subtitle.pug vendored Normal file
View File

@@ -0,0 +1,137 @@
- var source = theme.subtitle.source
if source == '1'
script.
function subtitleType () {
$.getJSON('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',function (data) {
if (!{theme.subtitle.effect}) {
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
var both = sub.unshift(data.text)
typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: !{theme.subtitle.loop},
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = data.text
}
})
}
if (!{theme.subtitle.effect}) {
if (typeof Typed === 'function') subtitleType()
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
} else {
subtitleType()
}
else if source == '2'
script.
function subtitleType () {
$.getJSON('https://v1.hitokoto.cn', function (data) {
if (!{theme.subtitle.effect}) {
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
}
})
}
if (!{theme.subtitle.effect}) {
if (typeof Typed === 'function') subtitleType()
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
} else {
subtitleType()
}
else if source == '3'
script.
function subtitleType () {
$.getScript('http://yijuzhan.com/api/word.php?m=js', function () {
var con = str[0]
if (!{theme.subtitle.effect}) {
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
}
})
}
if (!{theme.subtitle.effect}) {
if (typeof Typed === 'function') subtitleType()
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
} else {
subtitleType()
}
else if source == '4'
script.
function subtitleType () {
$.getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
jinrishici.load(function (result) {
if (!{theme.subtitle.effect}) {
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
}
})
})
}
if (!{theme.subtitle.effect}) {
if (typeof Typed === 'function') subtitleType()
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
} else {
subtitleType()
}
else
script.
function subtitleType () {
if (!{theme.subtitle.effect}) {
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]}'
}
}
if (!{theme.subtitle.effect}) {
if (typeof Typed === 'function') subtitleType()
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
} else {
subtitleType()
}

View File

@@ -1,6 +1,9 @@
.card-widget.card-info .card-widget.card-info
.card-content .card-content
.card-info-avatar.is-center .card-info-avatar.is-center
if theme.lazyload.enable
img.avatar-img(data-lazy-src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
else
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar") img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
.author-info__name= config.author .author-info__name= config.author
.author-info__description!= theme.aside.card_author.description || config.description .author-info__description!= theme.aside.card_author.description || config.description
@@ -8,26 +11,25 @@
.card-info-data .card-info-data
if site.posts.length if site.posts.length
.card-info-data-item.is-center .card-info-data-item.is-center
a(href=url_for(config.archive_dir)) a(href=url_for(config.archive_dir) + '/')
.headline= _p('aside.articles') .headline= _p('aside.articles')
.length_num= site.posts.length .length_num= site.posts.length
if site.tags.length if site.tags.length
.card-info-data-item.is-center .card-info-data-item.is-center
a(href=url_for(config.tag_dir)) a(href=url_for(config.tag_dir) + '/')
.headline= _p('aside.tags') .headline= _p('aside.tags')
.length_num= site.tags.length .length_num= site.tags.length
if site.categories.length if site.categories.length
.card-info-data-item.is-center .card-info-data-item.is-center
a(href=url_for(config.category_dir)) a(href=url_for(config.category_dir) + '/')
.headline= _p('aside.categories') .headline= _p('aside.categories')
.length_num= site.categories.length .length_num= site.categories.length
.card-info-bookmark.is-center a#card-info-btn.button--animated(href=theme.aside.card_author.button.link)
button#bookmark-it.button--animated(title= _p('aside.card_bookmark')) i(class=theme.aside.card_author.button.icon)
i.fas.fa-bookmark span=theme.aside.card_author.button.text
span= _p('aside.card_bookmark') || 'Follow Me'
if(theme.social) if(theme.social)
.card-info-social-icons.is-center .card-info-social-icons.is-center

View File

@@ -0,0 +1,7 @@
.card-widget.card-newest-comments
.card-content
.item-headline
i.fas.fa-bolt
span= _p('aside.card_newest_comments.heading')
.aside-list
span= _p('aside.card_newest_comments.loading_text')

View File

@@ -3,24 +3,25 @@
.item-headline .item-headline
i.fas.fa-history i.fas.fa-history
span= _p('aside.card_recent_post') span= _p('aside.card_recent_post')
.aside-recent-item .aside-list
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5 - let postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
- site.posts.sort('date', -1).limit(postLimit).each(function(article){ - let sort = theme.aside.card_recent_post.sort === 'updated' ? 'updated' : 'date'
.aside-recent-post - site.posts.sort(sort, -1).limit(postLimit).each(function(article){
- var link = article.link || article.path .aside-list-item
- var title = article.title || _p('no_title') - let link = article.link || article.path
- var no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : '' - let title = article.title || _p('no_title')
- var post_cover = article.cover - let no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : ''
- let post_cover = article.cover
a(href=url_for(link))
if post_cover && theme.cover.aside_enable if post_cover && theme.cover.aside_enable
.aside-post-cover a.thumbnail(href=url_for(link) title=title)
if theme.lazyload.enable if theme.lazyload.enable
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) img(data-lazy-src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
else else
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) img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
.aside-post-title(class=no_cover) .content(class=no_cover)
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title') a.title(href=url_for(link) title=title)= title
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)] if theme.aside.card_recent_post.sort === 'updated'
time(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated)) #[=date(article.updated, config.date_format)]
else
time(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
- }) - })

View File

@@ -7,6 +7,6 @@ if site.tags.length
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40 - let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
if theme.aside.card_tags.color if theme.aside.card_tags.color
.card-tag-cloud!=cloudTags({source: site.tags, minfontsize: 16, maxfontsize: 22, limit: tagLimit}) .card-tag-cloud!= cloudTags({source: site.tags, minfontsize: 1.1, maxfontsize: 1.5, limit: tagLimit, unit: 'em'})
else else
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 22, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf'}) .card-tag-cloud!= tagcloud({min_font: 1.1, max_font: 1.5, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf', unit: 'em'})

View File

@@ -4,23 +4,28 @@
i.fas.fa-chart-line i.fas.fa-chart-line
span= _p('aside.card_webinfo.headline') span= _p('aside.card_webinfo.headline')
.webinfo .webinfo
if theme.aside.card_webinfo.post_count
.webinfo-item .webinfo-item
.webinfo-article-name= _p('aside.card_webinfo.article_name') + " :" .item-name= _p('aside.card_webinfo.article_name') + " :"
.webinfo-article-count= site.posts.length .item-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') + " :" .item-name= _p('aside.card_webinfo.runtime.name') + " :"
#webinfo-runtime-count.webinfo-runtime-count(publish_date=theme.runtimeshow.publish_date) .item-count#runtimeshow(data-publishDate=date_xml(theme.runtimeshow.publish_date))
if theme.wordcount.enable && theme.wordcount.total_wordcount if theme.wordcount.enable && theme.wordcount.total_wordcount
.webinfo-item .webinfo-item
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :" .item-name=_p('aside.card_webinfo.site_wordcount') + " :"
.webinfo-site-wordcount=totalcount(site) .item-count=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') + " :" .item-name= _p('aside.card_webinfo.site_uv_name') + " :"
.webinfo-site-uv-count#busuanzi_value_site_uv .item-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') + " :" .item-name= _p('aside.card_webinfo.site_pv_name') + " :"
.webinfo-site-pv-count#busuanzi_value_site_pv .item-count#busuanzi_value_site_pv
if theme.aside.card_webinfo.last_push_date
.webinfo-item
.item-name= _p('aside.card_webinfo.last_push_date.name') + " :"
.item-count#last-push-date(data-lastPushDate=date_xml(Date.now()))

View File

@@ -1,19 +1,20 @@
if theme.aside.enable #aside_content.aside_content
if page.aside !== false
#aside_content.aside_content
if theme.aside.card_author.enable if theme.aside.card_author.enable
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache}) include ./card_author.pug
.sticky_layout
if theme.aside.card_announcement.enable if theme.aside.card_announcement.enable
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache}) include ./card_announcement.pug
if theme.aside.card_recent_post.enable if theme.aside.card_recent_post.enable
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache}) include ./card_recent_post.pug
if theme.newest_comments.enable
include ./card_newest_comment.pug
if theme.ad && theme.ad.aside if theme.ad && theme.ad.aside
!=partial('includes/widget/card_ad', {}, {cache:theme.fragment_cache}) include ./card_ad.pug
if theme.aside.card_categories.enable if theme.aside.card_categories.enable
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache}) include ./card_categories.pug
if theme.aside.card_tags.enable if theme.aside.card_tags.enable
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache}) include ./card_tags.pug
if theme.aside.card_archives.enable if theme.aside.card_archives.enable
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache}) include ./card_archives.pug
if theme.aside.card_webinfo if theme.aside.card_webinfo.enable
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache}) include ./card_webinfo.pug

View File

@@ -7,9 +7,10 @@ block content
| - | -
span.tag-cloud__amount= site.tags.length span.tag-cloud__amount= site.tags.length
.tag-cloud-tags .tag-cloud-tags
!=cloudTags({source: site.tags, minfontsize: 15, maxfontsize: 30, limit: 0}) !=cloudTags({source: site.tags, minfontsize: 1, maxfontsize: 2.1, limit: 0, unit: 'em'})
if page.comments !== false if page.comments !== false && theme.comments && theme.comments.use
include includes/comments/index.pug - var commentsJsLoad = true
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
else if page.type === 'link' else if page.type === 'link'
include flink.pug include flink.pug
else if page.type === 'categories' else if page.type === 'categories'
@@ -19,10 +20,15 @@ block content
| - | -
span.category__amount= site.categories.length span.category__amount= site.categories.length
div!= list_categories() div!= list_categories()
if page.comments !== false if page.comments !== false && theme.comments && theme.comments.use
include includes/comments/index.pug - var commentsJsLoad = true
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})
else else
#page #page
if theme.douban && theme.douban.meta
if (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
meta(name="referrer" content="no-referrer")
#article-container!= page.content #article-container!= page.content
if page.comments !== false if page.comments !== false && theme.comments && theme.comments.use
include includes/comments/index.pug - var commentsJsLoad = true
!=partial('includes/third-party/comments/index', {}, {cache:theme.fragment_cache})

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