mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
496234c8ad | ||
|
|
8d5ca45948 | ||
|
|
04e36c8d8a | ||
|
|
5c2894d3d5 | ||
|
|
63353566d2 | ||
|
|
f0588a3967 | ||
|
|
0834720d32 | ||
|
|
183d01b9eb | ||
|
|
7e8d666bf7 | ||
|
|
49b6c7436c | ||
|
|
1e24c62f70 | ||
|
|
5e30032a5f | ||
|
|
47214b5a7c | ||
|
|
d62f047073 | ||
|
|
5a13f01649 | ||
|
|
09b7342882 | ||
|
|
4c9395666d | ||
|
|
f4d0687750 | ||
|
|
e80ecb43ef | ||
|
|
93f7461d28 | ||
|
|
841fbb0c5e | ||
|
|
247e62a418 | ||
|
|
8199e25215 | ||
|
|
b34eeb0425 | ||
|
|
63dc605794 | ||
|
|
a7d6d0fb80 | ||
|
|
768d9e370b | ||
|
|
a3e46f757b | ||
|
|
431b5fa7ce | ||
|
|
8a50b80527 | ||
|
|
3694ee01df | ||
|
|
c579dad041 | ||
|
|
5baf759749 | ||
|
|
532b74edde | ||
|
|
08fabdc2d1 | ||
|
|
6a50b62869 | ||
|
|
396fb102da | ||
|
|
929a5608d3 | ||
|
|
9a3b41912a | ||
|
|
0f915f47ef | ||
|
|
e2565a9f39 | ||
|
|
4cd26d183c | ||
|
|
f218a0a14a | ||
|
|
6c7debfd24 | ||
|
|
eb88a5bb4a | ||
|
|
f07823903f | ||
|
|
4bd5edd955 | ||
|
|
ecf4d341e6 | ||
|
|
5c0d578e4c | ||
|
|
21f71cd0f2 | ||
|
|
f775e97548 | ||
|
|
54a4fa381d | ||
|
|
bf3a43e62a | ||
|
|
274a499aff | ||
|
|
48781800f3 | ||
|
|
449fe2f876 | ||
|
|
06ab48f607 | ||
|
|
e0382c80ae | ||
|
|
a1589c0212 | ||
|
|
ff6fc30743 | ||
|
|
fef6dcf6c6 | ||
|
|
5fd171bab0 | ||
|
|
0b0cb38b59 | ||
|
|
65b1ad32c8 | ||
|
|
13cf15c369 | ||
|
|
6b7d0d9806 | ||
|
|
c17b0cb553 | ||
|
|
c866315b87 | ||
|
|
2404eee5c1 | ||
|
|
5e656b7072 | ||
|
|
a405217462 | ||
|
|
8cfa1665b9 | ||
|
|
d12f5be271 | ||
|
|
26f2c1b4e3 | ||
|
|
bb7fc446fc | ||
|
|
49e4903b34 | ||
|
|
91641646a7 | ||
|
|
4b8492a377 | ||
|
|
a36c9ca6d2 | ||
|
|
6361f28328 | ||
|
|
dbb31dec99 | ||
|
|
fba180afaf | ||
|
|
b8b728898e | ||
|
|
91d49fe7a2 | ||
|
|
931a0ba82d | ||
|
|
9a33e23a9c | ||
|
|
945ea89685 | ||
|
|
b4d3ea86bb | ||
|
|
ecebacad37 | ||
|
|
e650f71086 | ||
|
|
6d387eadcc | ||
|
|
860f6c5ef9 | ||
|
|
e56757ac29 | ||
|
|
08b7cd9dbb | ||
|
|
9a86429484 | ||
|
|
4df78b1966 | ||
|
|
b1e40b33d7 | ||
|
|
cf38250fa9 | ||
|
|
e3bb904e87 | ||
|
|
cbf52c3053 | ||
|
|
9351413b63 | ||
|
|
1f3f2f471b | ||
|
|
c68e872f0e | ||
|
|
1bc54d6eb3 | ||
|
|
f768d6fce0 | ||
|
|
4dd146f787 | ||
|
|
7187a17896 | ||
|
|
41ac7f170c | ||
|
|
9479f8a704 | ||
|
|
793e004a3a | ||
|
|
b3e5b7c30d | ||
|
|
060defa475 | ||
|
|
c2c199bd16 | ||
|
|
3e30f301a0 | ||
|
|
5b1473c2c8 | ||
|
|
ec78f66470 | ||
|
|
a33602e023 | ||
|
|
ee3c143424 | ||
|
|
4461473aa6 | ||
|
|
3cb2120630 | ||
|
|
df678dfde2 | ||
|
|
34bb030345 | ||
|
|
0726c2263f | ||
|
|
7ebed025f0 | ||
|
|
4248103024 | ||
|
|
ab6672429f | ||
|
|
ca4c0e2a6b | ||
|
|
26e8c618d8 | ||
|
|
c1ac4a5e16 | ||
|
|
e0fd3c9f92 | ||
|
|
96e8d624dc | ||
|
|
84ad5c5dd6 | ||
|
|
18d9d652a0 | ||
|
|
850c825fcf | ||
|
|
36d85c4c23 | ||
|
|
002692886c | ||
|
|
444081846c | ||
|
|
ffeab5e20c | ||
|
|
f7c50586ce | ||
|
|
632cb37bc5 | ||
|
|
cb82bfb7b6 | ||
|
|
f5c3dcf327 | ||
|
|
312a766901 | ||
|
|
7e729cff79 | ||
|
|
3708fdf569 | ||
|
|
484f036adb | ||
|
|
7210f5b431 | ||
|
|
b5e3d2c2c3 | ||
|
|
f1d1ae6639 | ||
|
|
f1bf2413a0 | ||
|
|
45d6ced507 | ||
|
|
43790dec07 |
61
.github/ISSUE_TEMPLATE/bug_report.md
vendored
61
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,61 +0,0 @@
|
||||
---
|
||||
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.
|
||||
重要:請依照該模板來提交。
|
||||
|
||||
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
|
||||
如果你是由舊版本升級到新版,執行時出現報錯,請首先把config裡新的內容複製到舊的butterfly設定去(如有)
|
||||
|
||||
If you are a problem when 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是否有報錯,反饋時附上你的網站
|
||||
-->
|
||||
|
||||
|
||||
## I want to create a Bug report <!-- 我想要建立一個 Bug report -->
|
||||
|
||||
<!-- 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 [Butterfly Documentation](https://butterfly.js.org/posts/21cfbf15/).
|
||||
- [] And yes, I already searched for current [issues](https://github.com/jerryc127/hexo-theme-butterfly/issues?utf8=%E2%9C%93&q=is%3Aissue) and this did not help me.
|
||||
|
||||
## Butterfly Information
|
||||
|
||||
<!-- Butterfly的版本 -->
|
||||
<!-- 檢視主題的package.json -->
|
||||
**Butterfly Version:**
|
||||
|
||||
<!-- Windows/macOS/Linux/Android/iOS -->
|
||||
**Platform:**
|
||||
|
||||
<!-- Chrome/Safari/FireFox/.. -->
|
||||
**Browser:**
|
||||
|
||||
## Expected behavior <!-- (預期行為) -->
|
||||
|
||||
## Actual behavior <!-- (實際行為) -->
|
||||
|
||||
## Steps to reproduce the behavior <!-- (重現步驟) -->
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
<!-- If applicable, add screenshots to help explain your problem -->
|
||||
<!-- 請儘量提供截圖來定位問題 -->
|
||||
## Screenshots <!-- (截圖) -->
|
||||
|
||||
<!-- Provide your website to find the issues -->
|
||||
## Website
|
||||
|
||||
## Describe the bug
|
||||
73
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
73
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us improve
|
||||
title: '[Bug]: '
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
重要:請依照該模板來提交
|
||||
Please follow the template to create a new issue
|
||||
- type: input
|
||||
id: butterfly-ver
|
||||
attributes:
|
||||
label: 使用的 Butterfly 版本? | What version of Butterfly are you use?
|
||||
description: 檢視主題的 package.json | Check the theme's package.json
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: modify
|
||||
attributes:
|
||||
label: 是否修改过主题文件? || Has the theme files been modified?
|
||||
options:
|
||||
- 是 (Yes)
|
||||
- 不是 (No)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: browser
|
||||
attributes:
|
||||
label: 使用的瀏覽器? || What browse are you using?
|
||||
options:
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Opera
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: platform
|
||||
attributes:
|
||||
label: 使用的系統? || What operating system are you using?
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Linux
|
||||
- Android
|
||||
- iOS
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 問題描述 | Describe the bug
|
||||
description: 請描述你的問題現象 | A clear and concise description of what the bug is.
|
||||
placeholder: 請儘量提供截圖來定位問題 | If applicable, add screenshots to help explain your problem
|
||||
value:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: website
|
||||
attributes:
|
||||
label: 出現問題網站 | Website
|
||||
description: 請提供下可復現網站地址 | Please supply a website url which can reproduce problem.
|
||||
placeholder:
|
||||
validations:
|
||||
required: true
|
||||
22
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
22
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions about Butterfly
|
||||
url: https://github.com/jerryc127/hexo-theme-butterfly/discussions
|
||||
about: 一些使用問題請到 Discussion 詢問。 Please ask questions in Discussion.
|
||||
|
||||
- name: Butterfly Q&A
|
||||
url: https://butterfly.js.org/posts/98d20436/
|
||||
about: Butterfly Q&A
|
||||
|
||||
- name: Telegram
|
||||
url: https://t.me/bu2fly
|
||||
about: 'Official Telegram Group'
|
||||
|
||||
- name: QQ 1群
|
||||
url: https://jq.qq.com/?_wv=1027&k=KU9105XR
|
||||
about: '群號 1070540070,不要兩個Q群都添加'
|
||||
|
||||
- name: QQ 2群
|
||||
url: https://jq.qq.com/?_wv=1027&k=r1nK0DQz
|
||||
about: '群號 978221020,不要兩個Q群都添加'
|
||||
|
||||
9
.github/ISSUE_TEMPLATE/custom.md
vendored
9
.github/ISSUE_TEMPLATE/custom.md
vendored
@@ -1,9 +0,0 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Describe this issue template's purpose here.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +0,0 @@
|
||||
---
|
||||
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.
|
||||
14
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea for this project
|
||||
title: '[Feature]: '
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature-request
|
||||
attributes:
|
||||
label: 想要的功能 | What feature do you want?
|
||||
description: 請描述你需要的新功能 | A clear and concise description of what the feature is.
|
||||
placeholder:
|
||||
value:
|
||||
validations:
|
||||
require: true
|
||||
20
.github/stale.yml
vendored
20
.github/stale.yml
vendored
@@ -1,20 +0,0 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- bug
|
||||
- enhancement
|
||||
- documentation
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
19
.github/workflows/stale.yml
vendored
Normal file
19
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
days-before-issue-stale: 30
|
||||
days-before-pr-stale: -1
|
||||
days-before-close: 7
|
||||
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
close-pr-message: 'This issue has not seen any activity since it was marked stale. Closing.'
|
||||
stale-issue-label: 'Stale'
|
||||
exempt-issue-labels: 'pinned,bug,enhancement,documentation,Plan'
|
||||
operations-per-run: 1000
|
||||
26
README.md
26
README.md
@@ -9,22 +9,22 @@
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [MYW](https://immyw.com/)
|
||||
Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [CrazyWong](https://crazywong.com/)
|
||||
|
||||
Docs: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/)
|
||||
|
||||
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
||||
|
||||
## Installation
|
||||
## 💻 Installation
|
||||
|
||||
### GIT
|
||||
|
||||
> If you are in Mainland China, you can download in [Gitee](https://gitee.com/iamjerryw/hexo-theme-butterfly)
|
||||
> If you are in Mainland China, you can download in [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git)
|
||||
|
||||
Stable branch [recommend]:
|
||||
|
||||
@@ -48,7 +48,7 @@ In Hexo site root directory
|
||||
npm i hexo-theme-butterfly
|
||||
```
|
||||
|
||||
## Configuration
|
||||
## ⚙ Configuration
|
||||
|
||||
Set theme in the hexo work folder's root config file `_config.yml`:
|
||||
|
||||
@@ -58,7 +58,7 @@ npm i hexo-theme-butterfly
|
||||
|
||||
> npm install hexo-renderer-pug hexo-renderer-stylus
|
||||
|
||||
## Features
|
||||
## 🎉 Features
|
||||
|
||||
- [x] Card UI Design
|
||||
- [X] Support sub-menu
|
||||
@@ -79,9 +79,9 @@ npm i hexo-theme-butterfly
|
||||
- [x] Related articles
|
||||
- [x] Displays outdated notice for a post
|
||||
- [x] Share (AddThis/Sharejs/Addtoany)
|
||||
- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo)
|
||||
- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
|
||||
- [x] Multiple Comment System Support
|
||||
- [x] Online Chats (Chatra/Tidio/Daovoice/Gitter/Crisp)
|
||||
- [x] Online Chats (Chatra/Tidio/Daovoice/Crisp/messenger)
|
||||
- [x] Web analytics
|
||||
- [x] Google AdSense
|
||||
- [x] Webmaster Verification
|
||||
@@ -89,7 +89,7 @@ npm i hexo-theme-butterfly
|
||||
- [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] Preloader/Loading Animation/pace.js
|
||||
- [x] Busuanzi visitor counter
|
||||
- [x] Medium Zoom/Fancybox
|
||||
- [x] Mermaid
|
||||
@@ -97,7 +97,13 @@ npm i hexo-theme-butterfly
|
||||
- [x] Lazyload images
|
||||
- [x] Instantpage/Pangu/Snackbar notification toast/PWA......
|
||||
|
||||
## Screenshots
|
||||
## ✨ Contributors
|
||||
|
||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly" />
|
||||
</a>
|
||||
|
||||
## 📷 Screenshots
|
||||
|
||||

|
||||

|
||||
|
||||
29
README_CN.md
29
README_CN.md
@@ -9,22 +9,22 @@
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
預覽: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [MYW](https://immyw.com/)
|
||||
預覽: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [CrazyWong](https://crazywong.com/)
|
||||
|
||||
文檔: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/)
|
||||
|
||||
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
||||
|
||||
## 安裝
|
||||
## 💻 安裝
|
||||
|
||||
### Git 安裝
|
||||
|
||||
> 本倉庫同時上傳到 [Gitee](https://gitee.com/iamjerryw/hexo-theme-butterfly),如果你訪問 Github 緩慢,可從 Gitee 中下載。
|
||||
> 本倉庫同時上傳到 [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git),如果你訪問 Github 緩慢,可從 Gitee 中下載。
|
||||
|
||||
在博客根目錄裡安裝穩定版【推薦】
|
||||
|
||||
@@ -48,7 +48,8 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
|
||||
npm i hexo-theme-butterfly
|
||||
```
|
||||
|
||||
## 應用主題
|
||||
## ⚙ 應用主題
|
||||
|
||||
修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
|
||||
|
||||
```
|
||||
@@ -57,7 +58,7 @@ theme: butterfly
|
||||
|
||||
>如果你沒有pug以及stylus的渲染器,請下載安裝: npm install hexo-renderer-pug hexo-renderer-stylus --save
|
||||
|
||||
## 特色
|
||||
## 🎉 特色
|
||||
|
||||
- [x] 卡片化設計
|
||||
- [X] 支持二級目錄
|
||||
@@ -78,9 +79,9 @@ theme: butterfly
|
||||
- [x] 顯示相關文章
|
||||
- [x] 過期文章提醒
|
||||
- [x] 多種分享系統(AddThis/Sharejs/Addtoany)
|
||||
- [X] 多種評論系統(Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo)
|
||||
- [X] 多種評論系統(Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
|
||||
- [x] 支持雙評論部署
|
||||
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Gitter/Crisp)
|
||||
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Crisp/messenger)
|
||||
- [x] 多種分析系統
|
||||
- [x] 谷歌廣告/手動廣告位置
|
||||
- [x] 各種站長驗證(Google/Bing/Baidu/360/Yandex)
|
||||
@@ -88,7 +89,7 @@ theme: butterfly
|
||||
- [x] 打字特效 activate_power_mode
|
||||
- [x] 多種背景特效(靜止彩帶/動態彩帶/Canvas Nest)
|
||||
- [x] 多種鼠標點擊特效(煙花/文字/愛心)
|
||||
- [x] 內置一種 Preloader 加載動畫
|
||||
- [x] 內置一種 Preloader 加載動畫和 pace.js 加載動畫條
|
||||
- [x] 不蒜子訪問統計
|
||||
- [x] 兩種大圖模式(Medium Zoom/Fancybox)
|
||||
- [x] Mermaid 圖表顯示
|
||||
@@ -96,11 +97,17 @@ theme: butterfly
|
||||
- [x] 圖片懶加載
|
||||
- [x] Instantpage/Pangu/Snackbar彈窗/PWA......
|
||||
|
||||
## 截圖
|
||||
## ✨ 貢獻者
|
||||
|
||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly" />
|
||||
</a>
|
||||
|
||||
## 📷 截圖
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
699
_config.yml
699
_config.yml
@@ -1,11 +1,13 @@
|
||||
# Main menu navigation (導航目錄)
|
||||
# Navigation bar settings (導航欄設置)
|
||||
# see https://butterfly.js.org/posts/4aa8abbe/##導航欄設置-Navigation-bar-settings
|
||||
# --------------------------------------
|
||||
|
||||
# format: name: link || icon
|
||||
# sub-menu
|
||||
# name || icon:
|
||||
# name: link || icon
|
||||
nav:
|
||||
logo: # image
|
||||
display_title: true
|
||||
fixed: false # fixed navigation bar
|
||||
|
||||
# Menu 目錄
|
||||
menu:
|
||||
# Home: / || fas fa-home
|
||||
# Archives: /archives/ || fas fa-archive
|
||||
@@ -17,9 +19,6 @@ menu:
|
||||
# Link: /link/ || fas fa-link
|
||||
# About: /about/ || fas fa-heart
|
||||
|
||||
# Hide the child menu items in mobile sidebar
|
||||
hide_sidebar_menu_child: false
|
||||
|
||||
# Code Blocks (代碼相關)
|
||||
# --------------------------------------
|
||||
|
||||
@@ -30,51 +29,12 @@ highlight_shrink: false # true: shrink the code blocks / false: expand the code
|
||||
highlight_height_limit: false # unit: px
|
||||
code_word_wrap: false
|
||||
|
||||
# copy settings
|
||||
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
|
||||
copy:
|
||||
enable: true
|
||||
copyright:
|
||||
enable: false
|
||||
limit_count: 50
|
||||
|
||||
# social settings (社交圖標設置)
|
||||
# Social Settings (社交圖標設置)
|
||||
# formal:
|
||||
# icon: link || the description
|
||||
# icon: link || the description || color
|
||||
social:
|
||||
# fab fa-github: https://github.com/xxxxx || Github
|
||||
# fas fa-envelope: mailto:xxxxxx@gmail.com || Email
|
||||
|
||||
# search (搜索)
|
||||
# --------------------------------------
|
||||
|
||||
# Algolia search
|
||||
algolia_search:
|
||||
enable: false
|
||||
hits:
|
||||
per_page: 6
|
||||
|
||||
# Local search
|
||||
local_search:
|
||||
enable: false
|
||||
|
||||
# Math (數學)
|
||||
# --------------------------------------
|
||||
# About the per_page
|
||||
# if you set it to true, it will load mathjax/katex script in each page (true 表示每一頁都加載js)
|
||||
# if you set it to false, it will load mathjax/katex script according to your setting (add the 'mathjax: true' in page's front-matter)
|
||||
# (false 需要時加載,須在使用的 Markdown Front-matter 加上 mathjax: true)
|
||||
|
||||
# MathJax
|
||||
mathjax:
|
||||
enable: false
|
||||
per_page: false
|
||||
|
||||
# KaTeX
|
||||
katex:
|
||||
enable: false
|
||||
per_page: false
|
||||
hide_scrollbar: true
|
||||
# fab fa-github: https://github.com/xxxxx || Github || '#24292e'
|
||||
# fas fa-envelope: mailto:xxxxxx@gmail.com || Email || '#4a7dbe'
|
||||
|
||||
# Image (圖片設置)
|
||||
# --------------------------------------
|
||||
@@ -154,13 +114,6 @@ post_meta:
|
||||
tags: true # true or false 文章頁是否顯示標籤
|
||||
label: true # true or false 顯示描述性文字
|
||||
|
||||
# wordcount (字數統計)
|
||||
wordcount:
|
||||
enable: false
|
||||
post_wordcount: true
|
||||
min2read: true
|
||||
total_wordcount: true
|
||||
|
||||
# Display the article introduction on homepage
|
||||
# 1: description
|
||||
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
|
||||
@@ -170,18 +123,41 @@ index_post_content:
|
||||
method: 3
|
||||
length: 500 # if you set method to 2 or 3, the length need to config
|
||||
|
||||
# anchor
|
||||
anchor:
|
||||
button:
|
||||
enable: false
|
||||
always_show: false
|
||||
icon: # the unicode value of Font Awesome icon, such as '\3423'
|
||||
auto_update: false # when you scroll in post, the URL will update according to header id.
|
||||
|
||||
# figcaption (圖片描述文字)
|
||||
photofigcaption: false
|
||||
|
||||
# copy settings
|
||||
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
|
||||
copy:
|
||||
enable: true
|
||||
copyright:
|
||||
enable: false
|
||||
limit_count: 50
|
||||
|
||||
# Post
|
||||
# --------------------------------------
|
||||
|
||||
# toc (目錄)
|
||||
toc:
|
||||
enable: true
|
||||
post: true
|
||||
page: false
|
||||
number: true
|
||||
style_simple: false
|
||||
expand: false
|
||||
style_simple: false # for post
|
||||
scroll_percent: true
|
||||
|
||||
post_copyright:
|
||||
enable: true
|
||||
decode: false
|
||||
author_href:
|
||||
license: CC BY-NC-SA 4.0
|
||||
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
|
||||
@@ -210,9 +186,6 @@ related_post:
|
||||
limit: 6 # Number of posts displayed
|
||||
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||
|
||||
# figcaption (圖片描述文字)
|
||||
photofigcaption: false
|
||||
|
||||
# post_pagination (分頁)
|
||||
# value: 1 || 2 || false
|
||||
# 1: The 'next post' will link to old post
|
||||
@@ -220,10 +193,6 @@ photofigcaption: false
|
||||
# false: disable pagination
|
||||
post_pagination: 1
|
||||
|
||||
# anchor
|
||||
# when you scroll in post, the URL will update according to header id.
|
||||
anchor: false
|
||||
|
||||
# Displays outdated notice for a post (文章過期提醒)
|
||||
noticeOutdate:
|
||||
enable: false
|
||||
@@ -233,7 +202,183 @@ noticeOutdate:
|
||||
message_prev: It has been
|
||||
message_next: days since the last update, the content of the article may be outdated.
|
||||
|
||||
# Share System (分享功能)
|
||||
# Footer Settings
|
||||
# --------------------------------------
|
||||
footer:
|
||||
owner:
|
||||
enable: true
|
||||
since: 2020
|
||||
custom_text:
|
||||
copyright: true # Copyright of theme and framework
|
||||
|
||||
# aside (側邊欄)
|
||||
# --------------------------------------
|
||||
|
||||
aside:
|
||||
enable: true
|
||||
hide: false
|
||||
button: true
|
||||
mobile: true # display on mobile
|
||||
position: right # left or right
|
||||
display:
|
||||
archive: true
|
||||
tag: true
|
||||
category: true
|
||||
card_author:
|
||||
enable: true
|
||||
description:
|
||||
button:
|
||||
enable: true
|
||||
icon: fab fa-github
|
||||
text: Follow Me
|
||||
link: https://github.com/xxxxxx
|
||||
card_announcement:
|
||||
enable: true
|
||||
content: This is my Blog
|
||||
card_recent_post:
|
||||
enable: true
|
||||
limit: 5 # if set 0 will show all
|
||||
sort: date # date or updated
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_categories:
|
||||
enable: true
|
||||
limit: 8 # if set 0 will show all
|
||||
expand: none # none/true/false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_tags:
|
||||
enable: true
|
||||
limit: 40 # if set 0 will show all
|
||||
color: false
|
||||
orderby: random # Order of tags, random/name/length
|
||||
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_archives:
|
||||
enable: true
|
||||
type: monthly # yearly or monthly
|
||||
format: MMMM YYYY # eg: YYYY年MM月
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
limit: 8 # if set 0 will show all
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_webinfo:
|
||||
enable: true
|
||||
post_count: true
|
||||
last_push_date: true
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
# 訪問人數
|
||||
busuanzi:
|
||||
site_uv: true
|
||||
site_pv: true
|
||||
page_pv: true
|
||||
|
||||
# Time difference between publish date and now (網頁運行時間)
|
||||
# Formal: Month/Day/Year Time or Year/Month/Day Time
|
||||
runtimeshow:
|
||||
enable: false
|
||||
publish_date:
|
||||
|
||||
# Aside widget - Newest Comments
|
||||
newest_comments:
|
||||
enable: false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
limit: 6
|
||||
storage: 10 # unit: mins, save data to localStorage
|
||||
avatar: true
|
||||
|
||||
# Bottom right button (右下角按鈕)
|
||||
# --------------------------------------
|
||||
|
||||
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
||||
translate:
|
||||
enable: false
|
||||
# The text of a button
|
||||
default: 繁
|
||||
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
|
||||
defaultEncoding: 2
|
||||
# Time delay
|
||||
translateDelay: 0
|
||||
# The text of the button when the language is Simplified Chinese
|
||||
msgToTraditionalChinese: '繁'
|
||||
# The text of the button when the language is Traditional Chinese
|
||||
msgToSimplifiedChinese: '簡'
|
||||
|
||||
# Read Mode (閲讀模式)
|
||||
readmode: true
|
||||
|
||||
# dark mode
|
||||
darkmode:
|
||||
enable: true
|
||||
# Toggle Button to switch dark/light mode
|
||||
button: true
|
||||
# Switch dark/light mode automatically (自動切換 dark mode和 light mode)
|
||||
# autoChangeMode: 1 Following System Settings, if the system doesn't support dark mode, it will switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: 2 Switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: false
|
||||
autoChangeMode: false
|
||||
# Set the light mode time. The value is between 0 and 24. If not set, the default value is 6 and 18
|
||||
start: # 8
|
||||
end: # 22
|
||||
|
||||
# show scroll percent in scroll-to-top button
|
||||
rightside_scroll_percent: false
|
||||
|
||||
# Don't modify the following settings unless you know how they work (非必要請不要修改 )
|
||||
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
|
||||
# Don't repeat 不要重複
|
||||
rightside_item_order:
|
||||
enable: false
|
||||
hide: # readmode,translate,darkmode,hideAside
|
||||
show: # toc,chat,comment
|
||||
|
||||
# Math (數學)
|
||||
# --------------------------------------
|
||||
# About the per_page
|
||||
# if you set it to true, it will load mathjax/katex script in each page (true 表示每一頁都加載js)
|
||||
# if you set it to false, it will load mathjax/katex script according to your setting (add the 'mathjax: true' in page's front-matter)
|
||||
# (false 需要時加載,須在使用的 Markdown Front-matter 加上 mathjax: true)
|
||||
|
||||
# MathJax
|
||||
mathjax:
|
||||
enable: false
|
||||
per_page: false
|
||||
|
||||
# KaTeX
|
||||
katex:
|
||||
enable: false
|
||||
per_page: false
|
||||
hide_scrollbar: true
|
||||
|
||||
# search (搜索)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#搜索系統
|
||||
# --------------------------------------
|
||||
|
||||
# Algolia search
|
||||
algolia_search:
|
||||
enable: false
|
||||
hits:
|
||||
per_page: 6
|
||||
|
||||
# Local search
|
||||
local_search:
|
||||
enable: false
|
||||
# Preload the search data when the page loads.
|
||||
preload: false
|
||||
# Show top n results per article, show all results by setting to -1
|
||||
top_n_per_article: 1
|
||||
# Unescape html strings to the readable one.
|
||||
unescape: false
|
||||
CDN:
|
||||
|
||||
# Docsearch
|
||||
docsearch:
|
||||
enable: false
|
||||
appId:
|
||||
apiKey:
|
||||
indexName:
|
||||
option:
|
||||
|
||||
# Share System (分享)
|
||||
# --------------------------------------
|
||||
|
||||
# AddThis
|
||||
@@ -259,10 +404,8 @@ addtoany:
|
||||
|
||||
comments:
|
||||
# Up to two comments system, the first will be shown as default
|
||||
# Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo
|
||||
use:
|
||||
# - Valine
|
||||
# - Disqus
|
||||
# Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk
|
||||
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
|
||||
@@ -281,12 +424,8 @@ disqus:
|
||||
# https://github.com/SukkaW/DisqusJS
|
||||
disqusjs:
|
||||
shortname:
|
||||
siteName:
|
||||
apikey:
|
||||
api:
|
||||
nocomment: # display when a blog post or an article has no comment attached
|
||||
admin:
|
||||
adminLabel:
|
||||
option:
|
||||
|
||||
# livere (來必力)
|
||||
# https://www.livere.com/
|
||||
@@ -301,11 +440,6 @@ gitalk:
|
||||
repo:
|
||||
owner:
|
||||
admin:
|
||||
language: en # en, zh-CN, zh-TW, es-ES, fr, ru
|
||||
perPage: 10 # Pagination size, with maximum 100.
|
||||
distractionFreeMode: false # Facebook-like distraction free mode.
|
||||
pagerDirection: last # Comment sorting direction, available values are last and first.
|
||||
createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
|
||||
option:
|
||||
|
||||
# valine
|
||||
@@ -313,17 +447,9 @@ gitalk:
|
||||
valine:
|
||||
appId: # leancloud application app id
|
||||
appKey: # leancloud application app key
|
||||
pageSize: 10 # comment list page size
|
||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||
lang: en # i18n: zh-CN/zh-TW/en/ja
|
||||
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)
|
||||
recordIP: false # Record reviewer IP
|
||||
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
|
||||
bg: # valine background
|
||||
emojiCDN: # emoji CDN
|
||||
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
|
||||
requiredFields: nick,mail # required fields (nick/mail)
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
@@ -331,10 +457,8 @@ valine:
|
||||
# https://waline.js.org/
|
||||
waline:
|
||||
serverURL: # Waline server address url
|
||||
avatar: monsterid # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image
|
||||
avatarCDN: # Gravatar CDN baseURL
|
||||
bg: # waline background
|
||||
visitor: false
|
||||
pageview: false
|
||||
option:
|
||||
|
||||
# utterances
|
||||
@@ -354,7 +478,7 @@ facebook_comments:
|
||||
user_id: # optional
|
||||
pageSize: 10 # The number of comments to show
|
||||
order_by: social # social/time/reverse_time
|
||||
lang: en_US # Language en_US/zh_CN/zh_TW and so on
|
||||
lang: zh_TW # Language en_US/zh_CN/zh_TW and so on
|
||||
|
||||
# Twikoo
|
||||
# https://github.com/imaegoo/twikoo
|
||||
@@ -364,6 +488,32 @@ twikoo:
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# Giscus
|
||||
# https://giscus.app/
|
||||
giscus:
|
||||
repo:
|
||||
repo_id:
|
||||
category_id:
|
||||
theme:
|
||||
light: light
|
||||
dark: dark
|
||||
option:
|
||||
|
||||
# Remark42
|
||||
# https://remark42.com/docs/configuration/frontend/
|
||||
remark42:
|
||||
host: # Your Host URL
|
||||
siteId: # Your Site ID
|
||||
option:
|
||||
|
||||
# Artalk
|
||||
# https://artalk.js.org/guide/frontend/config.html
|
||||
artalk:
|
||||
server:
|
||||
site:
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# Chat Services
|
||||
# --------------------------------------
|
||||
|
||||
@@ -387,31 +537,23 @@ tidio:
|
||||
public_key:
|
||||
|
||||
# daovoice
|
||||
# http://daovoice.io/
|
||||
# http://dashboard.daovoice.io/app
|
||||
daovoice:
|
||||
enable: false
|
||||
app_id:
|
||||
|
||||
# gitter
|
||||
# https://gitter.im/
|
||||
gitter:
|
||||
enable: false
|
||||
room:
|
||||
|
||||
# crisp
|
||||
# https://crisp.chat/en/
|
||||
crisp:
|
||||
enable: false
|
||||
website_id:
|
||||
|
||||
# Footer Settings
|
||||
# --------------------------------------
|
||||
footer:
|
||||
owner:
|
||||
enable: true
|
||||
since: 2020
|
||||
custom_text:
|
||||
copyright: true # Copyright of theme and framework
|
||||
# messenger
|
||||
# https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin/
|
||||
messenger:
|
||||
enable: false
|
||||
pageID:
|
||||
lang: zh_TW # Language en_US/zh_CN/zh_TW and so on
|
||||
|
||||
# Analysis
|
||||
# --------------------------------------
|
||||
@@ -424,14 +566,6 @@ baidu_analytics:
|
||||
# https://analytics.google.com/analytics/web/
|
||||
google_analytics:
|
||||
|
||||
# Tencent Analytics ID
|
||||
# https://mta.qq.com
|
||||
tencent_analytics:
|
||||
|
||||
# CNZZ Analytics
|
||||
# https://www.umeng.com/
|
||||
cnzz_analytics:
|
||||
|
||||
# Cloudflare Analytics
|
||||
# https://www.cloudflare.com/zh-tw/web-analytics/
|
||||
cloudflare_analytics:
|
||||
@@ -486,6 +620,9 @@ site_verification:
|
||||
# toc_color: "#00c4b6"
|
||||
# blockquote_padding_color: "#49b1f5"
|
||||
# blockquote_background_color: "#49b1f5"
|
||||
# scrollbar_color: "#49b1f5"
|
||||
# meta_theme_color_light: "ffffff"
|
||||
# meta_theme_color_dark: "#0d0d0d"
|
||||
|
||||
# The top_img settings of home page
|
||||
# default: top img - full screen, site info - middle (默認top_img全屏,site_info在中間)
|
||||
@@ -514,6 +651,14 @@ rightside-bottom:
|
||||
# Enter transitions (開啓網頁進入效果)
|
||||
enter_transitions: true
|
||||
|
||||
# Typewriter Effect (打字效果)
|
||||
# https://github.com/disjukr/activate-power-mode
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
colorful: true # open particle animation (冒光特效)
|
||||
shake: true # open shake (抖動特效)
|
||||
mobile: false
|
||||
|
||||
# Background effects (背景特效)
|
||||
# --------------------------------------
|
||||
|
||||
@@ -542,14 +687,6 @@ canvas_nest:
|
||||
count: 99 # the number of lines, default: 99.
|
||||
mobile: false
|
||||
|
||||
# Typewriter Effect (打字效果)
|
||||
# https://github.com/disjukr/activate-power-mode
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
colorful: true # open particle animation (冒光特效)
|
||||
shake: true # open shake (抖動特效)
|
||||
mobile: false
|
||||
|
||||
# Mouse click effects: fireworks (鼠標點擊效果: 煙火特效)
|
||||
fireworks:
|
||||
enable: false
|
||||
@@ -580,8 +717,8 @@ display_mode: light
|
||||
beautify:
|
||||
enable: false
|
||||
field: post # site/post
|
||||
title-prefix-icon: '\f0c1'
|
||||
title-prefix-icon-color: '#F47466'
|
||||
title-prefix-icon: # '\f0c1'
|
||||
title-prefix-icon-color: # '#F47466'
|
||||
|
||||
# Global font settings
|
||||
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
||||
@@ -608,127 +745,36 @@ subtitle:
|
||||
enable: false
|
||||
# Typewriter Effect (打字效果)
|
||||
effect: true
|
||||
# loop (循環打字)
|
||||
loop: true
|
||||
# source調用第三方服務
|
||||
# Customize typed.js (配置typed.js)
|
||||
# https://github.com/mattboldt/typed.js/#customization
|
||||
typed_option:
|
||||
# source 調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用搏天api的隨機語錄(簡體)
|
||||
# source: 2 調用一言網的一句話(簡體)
|
||||
# source: 3 調用一句網(簡體)
|
||||
# source: 4 調用今日詩詞(簡體)
|
||||
# source: 1 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 2 調用一句網(簡體) https://yijuzhan.com/
|
||||
# source: 3 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
source: false
|
||||
# 如果有英文逗號' , ',請使用轉義字元 ,
|
||||
# 如果有英文雙引號' " ',請使用轉義字元 "
|
||||
# 開頭不允許轉義字元,如需要,請把整個句子用雙引號包住
|
||||
# 如果關閉打字效果,subtitle只會顯示sub的第一行文字
|
||||
# 如果關閉打字效果,subtitle 只會顯示 sub 的第一行文字
|
||||
sub:
|
||||
|
||||
# Loading Animation (加載動畫)
|
||||
preloader: false
|
||||
|
||||
# aside (側邊欄)
|
||||
# --------------------------------------
|
||||
|
||||
aside:
|
||||
enable: true
|
||||
hide: false
|
||||
button: true
|
||||
mobile: true # display on mobile
|
||||
position: right # left or right
|
||||
card_author:
|
||||
enable: true
|
||||
description:
|
||||
button:
|
||||
enable: true
|
||||
icon: fab fa-github
|
||||
text: Follow Me
|
||||
link: https://github.com/xxxxxx
|
||||
card_announcement:
|
||||
enable: true
|
||||
content: This is my Blog
|
||||
card_recent_post:
|
||||
enable: true
|
||||
limit: 5 # if set 0 will show all
|
||||
sort: date # date or updated
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_categories:
|
||||
enable: true
|
||||
limit: 8 # if set 0 will show all
|
||||
expand: none # none/true/false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_tags:
|
||||
enable: true
|
||||
limit: 40 # if set 0 will show all
|
||||
color: false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_archives:
|
||||
enable: true
|
||||
type: monthly # yearly or monthly
|
||||
format: MMMM YYYY # eg: YYYY年MM月
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
limit: 8 # if set 0 will show all
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_webinfo:
|
||||
enable: true
|
||||
post_count: true
|
||||
last_push_date: true
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
# 訪問人數
|
||||
busuanzi:
|
||||
site_uv: true
|
||||
site_pv: true
|
||||
page_pv: true
|
||||
|
||||
# Time difference between publish date and now (網頁運行時間)
|
||||
# Formal: Month/Day/Year Time or Year/Month/Day Time
|
||||
runtimeshow:
|
||||
preloader:
|
||||
enable: false
|
||||
publish_date:
|
||||
# source
|
||||
# 1. fullpage-loading
|
||||
# 2. pace (progress bar)
|
||||
source: 1
|
||||
# pace theme (see https://codebyzach.github.io/pace/)
|
||||
pace_css_url:
|
||||
|
||||
# Aside widget - Newest Comments
|
||||
newest_comments:
|
||||
# wordcount (字數統計)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#字數統計
|
||||
wordcount:
|
||||
enable: false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
limit: 6
|
||||
storage: 10 # unit: mins, save data to localStorage
|
||||
avatar: true
|
||||
|
||||
# Bottom right button (右下角按鈕)
|
||||
# --------------------------------------
|
||||
|
||||
# Change font size
|
||||
change_font_size: false
|
||||
|
||||
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
||||
translate:
|
||||
enable: false
|
||||
# The text of a button
|
||||
default: 繁
|
||||
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
|
||||
defaultEncoding: 2
|
||||
# Time delay
|
||||
translateDelay: 0
|
||||
# The text of the button when the language is Simplified Chinese
|
||||
msgToTraditionalChinese: '繁'
|
||||
# The text of the button when the language is Traditional Chinese
|
||||
msgToSimplifiedChinese: '簡'
|
||||
|
||||
# Read Mode (閲讀模式)
|
||||
readmode: true
|
||||
|
||||
# dark mode
|
||||
darkmode:
|
||||
enable: true
|
||||
# Toggle Button to switch dark/light mode
|
||||
button: true
|
||||
# Switch dark/light mode automatically (自動切換 dark mode和 light mode)
|
||||
# autoChangeMode: 1 Following System Settings, if the system doesn't support dark mode, it will switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: 2 Switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: false
|
||||
autoChangeMode: false
|
||||
post_wordcount: true
|
||||
min2read: true
|
||||
total_wordcount: true
|
||||
|
||||
# Lightbox (圖片大圖查看模式)
|
||||
# --------------------------------------
|
||||
@@ -739,18 +785,26 @@ darkmode:
|
||||
medium_zoom: false
|
||||
|
||||
# fancybox
|
||||
# http://fancyapps.com/fancybox/3/
|
||||
# https://fancyapps.com/fancybox/
|
||||
fancybox: true
|
||||
|
||||
# Tag Plugins settings (標籤外掛)
|
||||
# --------------------------------------
|
||||
|
||||
# abcjs (樂譜渲染)
|
||||
# See https://github.com/paulrosen/abcjs
|
||||
abcjs:
|
||||
enable: false
|
||||
per_page: true
|
||||
|
||||
# mermaid
|
||||
# see https://github.com/mermaid-js/mermaid
|
||||
mermaid:
|
||||
enable: false
|
||||
# built-in themes: default/forest/dark/neutral
|
||||
theme: default
|
||||
theme:
|
||||
light: default
|
||||
dark: dark
|
||||
|
||||
# Note (Bootstrap Callout)
|
||||
note:
|
||||
@@ -791,7 +845,7 @@ snackbar:
|
||||
enable: false
|
||||
position: bottom-left
|
||||
bg_light: '#49b1f5' # The background color of Toast Notification in light mode
|
||||
bg_dark: '#121212' # The background color of Toast Notification in dark mode
|
||||
bg_dark: '#1f1f1f' # The background color of Toast Notification in dark mode
|
||||
|
||||
# https://instant.page/
|
||||
# prefetch (預加載)
|
||||
@@ -824,7 +878,16 @@ lazyload:
|
||||
|
||||
# Open graph meta tags
|
||||
# https://developers.facebook.com/docs/sharing/webmasters/
|
||||
Open_Graph_meta: true
|
||||
Open_Graph_meta:
|
||||
enable: true
|
||||
option:
|
||||
# twitter_card:
|
||||
# twitter_image:
|
||||
# twitter_id:
|
||||
# twitter_site:
|
||||
# google_plus:
|
||||
# fb_admins:
|
||||
# fb_app_id:
|
||||
|
||||
# Add the vendor prefixes to ensure compatibility
|
||||
css_prefix: true
|
||||
@@ -842,87 +905,77 @@ inject:
|
||||
# Don't modify the following settings unless you know how they work
|
||||
# 非必要請不要修改
|
||||
CDN:
|
||||
# main
|
||||
main_css: /css/index.css
|
||||
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
||||
main: /js/main.js
|
||||
utils: /js/utils.js
|
||||
# The CDN provider of internal scripts (主題內部 js 的 cdn 配置)
|
||||
# option: local/jsdelivr/unpkg/cdnjs/custom
|
||||
# Dev version can only choose. ( dev版的主題只能設置為 local )
|
||||
internal_provider: local
|
||||
|
||||
# pjax
|
||||
pjax: https://cdn.jsdelivr.net/npm/pjax/pjax.min.js
|
||||
# The CDN provider of third party scripts (第三方 js 的 cdn 配置)
|
||||
# option: local/jsdelivr/unpkg/cdnjs/custom
|
||||
# when set it to local, you need to install hexo-butterfly-extjs
|
||||
third_party_provider: jsdelivr
|
||||
|
||||
# comments
|
||||
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
|
||||
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
|
||||
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
|
||||
disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js
|
||||
disqusjs_css: https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css
|
||||
utterances: https://utteranc.es/client.js
|
||||
twikoo: https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js
|
||||
waline: https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js
|
||||
# Add version number to url, true or false
|
||||
version: false
|
||||
|
||||
# share
|
||||
addtoany: https://static.addtoany.com/menu/page.js
|
||||
sharejs: https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js
|
||||
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css
|
||||
# Custom format
|
||||
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
|
||||
custom_format:
|
||||
|
||||
# search
|
||||
local_search: /js/search/local-search.js
|
||||
algolia_js: /js/search/algolia.js
|
||||
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js
|
||||
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
|
||||
|
||||
# math
|
||||
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_copytex: https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.min.js
|
||||
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.css
|
||||
mermaid: https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
|
||||
|
||||
# count
|
||||
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
|
||||
|
||||
# background effect
|
||||
canvas_ribbon: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js
|
||||
canvas_fluttering_ribbon: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js
|
||||
canvas_nest: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.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
|
||||
typed: https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js
|
||||
pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
|
||||
|
||||
# photo
|
||||
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
|
||||
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
|
||||
|
||||
# snackbar
|
||||
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css
|
||||
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js
|
||||
|
||||
# effect
|
||||
activate_power_mode: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js
|
||||
fireworks: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js
|
||||
click_heart: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js
|
||||
ClickShowText: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js
|
||||
|
||||
# fontawesome
|
||||
fontawesome: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
|
||||
|
||||
# Conversion between Traditional and Simplified Chinese
|
||||
translate: /js/tw_cn.js
|
||||
|
||||
# justifiedGallery
|
||||
justifiedGallery_js: https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js
|
||||
justifiedGallery_css: https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css
|
||||
|
||||
# aplayer
|
||||
aplayer_css: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
|
||||
aplayer_js: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.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
|
||||
option:
|
||||
# main_css:
|
||||
# main:
|
||||
# utils:
|
||||
# translate:
|
||||
# local_search:
|
||||
# algolia_js:
|
||||
# algolia_search:
|
||||
# instantsearch:
|
||||
# docsearch_js:
|
||||
# docsearch_css:
|
||||
# pjax:
|
||||
# gitalk:
|
||||
# gitalk_css:
|
||||
# blueimp_md5:
|
||||
# valine:
|
||||
# disqusjs:
|
||||
# disqusjs_css:
|
||||
# twikoo:
|
||||
# waline_js:
|
||||
# waline_css:
|
||||
# giscus:
|
||||
# sharejs:
|
||||
# sharejs_css:
|
||||
# mathjax:
|
||||
# katex:
|
||||
# katex_copytex:
|
||||
# mermaid:
|
||||
# canvas_ribbon:
|
||||
# canvas_fluttering_ribbon:
|
||||
# canvas_nest:
|
||||
# lazyload:
|
||||
# instantpage:
|
||||
# typed:
|
||||
# pangu:
|
||||
# fancybox_css:
|
||||
# fancybox:
|
||||
# medium_zoom:
|
||||
# snackbar_css:
|
||||
# snackbar:
|
||||
# activate_power_mode:
|
||||
# fireworks:
|
||||
# click_heart:
|
||||
# ClickShowText:
|
||||
# fontawesome:
|
||||
# flickr_justified_gallery_js:
|
||||
# flickr_justified_gallery_css:
|
||||
# aplayer_css:
|
||||
# aplayer_js:
|
||||
# meting_js:
|
||||
# prismjs_js:
|
||||
# prismjs_lineNumber_js:
|
||||
# prismjs_autoloader:
|
||||
# artalk_js:
|
||||
# artalk_css:
|
||||
# busuanzi:
|
||||
# abcjs_basic_js:
|
||||
|
||||
@@ -34,16 +34,18 @@ post:
|
||||
recommend: Related Articles
|
||||
edit: Edited on
|
||||
|
||||
search: Search
|
||||
algolia_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}."
|
||||
hits_stats: '${hits} results found in ${time} ms'
|
||||
search:
|
||||
title: Search
|
||||
load_data: Loading the Database
|
||||
algolia_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}."
|
||||
hits_stats: '${hits} results found in ${time} ms'
|
||||
|
||||
local_search:
|
||||
label: Local search
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}"
|
||||
local_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}"
|
||||
hits_stats: '${hits} results found'
|
||||
|
||||
pagination:
|
||||
prev: Previous Post
|
||||
@@ -94,8 +96,6 @@ share: Share
|
||||
|
||||
rightside:
|
||||
readmode_title: Read Mode
|
||||
font_plus_title: Increase font size
|
||||
font_minus_title: Decrease font size
|
||||
translate_title: Toggle Between Traditional Chinese And Simplified Chinese
|
||||
night_mode_title: Toggle Between Light And Dark Mode
|
||||
back_to_top: Back To Top
|
||||
@@ -103,6 +103,7 @@ rightside:
|
||||
scroll_to_comment: Scroll To Comments
|
||||
setting: Setting
|
||||
aside: Toggle between single-column and double-column
|
||||
chat: Chat
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
@@ -117,7 +118,6 @@ Snackbar:
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
loading: Loading...
|
||||
load_more: Load More
|
||||
|
||||
error404:
|
||||
error_title: Page not found
|
||||
back_button: Go back home
|
||||
error404: Page not found
|
||||
|
||||
@@ -34,16 +34,18 @@ post:
|
||||
recommend: Related Articles
|
||||
edit: Edited on
|
||||
|
||||
search: Search
|
||||
algolia_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}."
|
||||
hits_stats: '${hits} results found in ${time} ms'
|
||||
search:
|
||||
title: Search
|
||||
load_data: Loading the Database
|
||||
algolia_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}."
|
||||
hits_stats: '${hits} results found in ${time} ms'
|
||||
|
||||
local_search:
|
||||
label: Local search
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}"
|
||||
local_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}"
|
||||
hits_stats: '${hits} results found'
|
||||
|
||||
pagination:
|
||||
prev: Previous Post
|
||||
@@ -94,8 +96,6 @@ share: Share
|
||||
|
||||
rightside:
|
||||
readmode_title: Read Mode
|
||||
font_plus_title: Increase font size
|
||||
font_minus_title: Decrease font size
|
||||
translate_title: Switch Between Traditional Chinese And Simplified Chinese
|
||||
night_mode_title: Switch Between Light And Dark Mode
|
||||
back_to_top: Back To Top
|
||||
@@ -103,6 +103,7 @@ rightside:
|
||||
scroll_to_comment: Scroll To Comments
|
||||
setting: Setting
|
||||
aside: Toggle between single-column and double-column
|
||||
chat: Chat
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
@@ -117,7 +118,6 @@ Snackbar:
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
loading: Loading...
|
||||
load_more: Load More
|
||||
|
||||
error404:
|
||||
error_title: Page not found
|
||||
back_button: Go back home
|
||||
error404: Page not found
|
||||
|
||||
@@ -35,16 +35,18 @@ post:
|
||||
recommend: 相关推荐
|
||||
edit: 编辑
|
||||
|
||||
search: 搜索
|
||||
algolia_search:
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: '找不到您查询的内容:${query}'
|
||||
hits_stats: '找到 ${hits} 条结果,用时 ${time} 毫秒'
|
||||
search:
|
||||
title: 搜索
|
||||
load_data: 数据库加载中
|
||||
algolia_search:
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: '找不到您查询的内容:${query}'
|
||||
hits_stats: '找到 ${hits} 条结果,用时 ${time} 毫秒'
|
||||
|
||||
local_search:
|
||||
label: 本地搜索
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: '找不到您查询的内容:${query}'
|
||||
local_search:
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: '找不到您查询的内容:${query}'
|
||||
hits_stats: '共找到 ${hits} 篇文章'
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
@@ -95,8 +97,6 @@ share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 阅读模式
|
||||
font_plus_title: 放大字体
|
||||
font_minus_title: 缩小字体
|
||||
translate_title: 简繁转换
|
||||
night_mode_title: 浅色和深色模式转换
|
||||
back_to_top: 回到顶部
|
||||
@@ -104,6 +104,7 @@ rightside:
|
||||
scroll_to_comment: 直达评论
|
||||
setting: 设置
|
||||
aside: 单栏和双栏切换
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
@@ -118,7 +119,6 @@ Snackbar:
|
||||
night_to_day: 你已切换为浅色模式
|
||||
|
||||
loading: 加载中...
|
||||
load_more: 加载更多
|
||||
|
||||
error404:
|
||||
error_title: 页面没有找到
|
||||
back_button: 回到主页
|
||||
error404: 页面没有找到
|
||||
|
||||
@@ -35,17 +35,19 @@ post:
|
||||
recommend: 相關推薦
|
||||
edit: 編輯
|
||||
|
||||
search: 搜尋
|
||||
algolia_search:
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: '找不到您查詢的內容:${query}'
|
||||
hits_stats: '找到 ${hits} 條結果,用時 ${time} 毫秒'
|
||||
|
||||
local_search:
|
||||
label: 本地搜尋
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: '找不到您查詢的內容:${query}'
|
||||
search:
|
||||
title: 搜尋
|
||||
load_data: 資料庫載入中
|
||||
algolia_search:
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: '找不到您查詢的內容:${query}'
|
||||
hits_stats: '找到 ${hits} 條結果,用時 ${time} 毫秒'
|
||||
|
||||
local_search:
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: '找不到您查詢的內容:${query}'
|
||||
hits_stats: '共找到 ${hits} 篇文章'
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
next: 下一篇
|
||||
@@ -65,7 +67,7 @@ aside:
|
||||
headline: 網站資訊
|
||||
article_name: 文章數目
|
||||
runtime:
|
||||
name: 已運行時間
|
||||
name: 已執行時間
|
||||
unit: 天
|
||||
last_push_date:
|
||||
name: 最後更新時間
|
||||
@@ -80,7 +82,7 @@ aside:
|
||||
zero: 沒有評論
|
||||
image: 圖片
|
||||
link: 連結
|
||||
code: 代碼
|
||||
code: 程式碼
|
||||
card_toc: 目錄
|
||||
|
||||
date_suffix:
|
||||
@@ -95,8 +97,6 @@ share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 閱讀模式
|
||||
font_plus_title: 放大字型
|
||||
font_minus_title: 縮小字型
|
||||
translate_title: 簡繁轉換
|
||||
night_mode_title: 淺色和深色模式轉換
|
||||
back_to_top: 回到頂部
|
||||
@@ -104,6 +104,7 @@ rightside:
|
||||
scroll_to_comment: 直達評論
|
||||
setting: 設定
|
||||
aside: 單欄和雙欄切換
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
@@ -118,7 +119,6 @@ Snackbar:
|
||||
night_to_day: 你已切換為淺色模式
|
||||
|
||||
loading: 載入中...
|
||||
load_more: 載入更多
|
||||
|
||||
error404:
|
||||
error_title: 頁面沒有找到
|
||||
back_button: 回到主頁
|
||||
error404: 頁面沒有找到
|
||||
|
||||
@@ -3,6 +3,7 @@ extends includes/layout.pug
|
||||
block content
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#archive
|
||||
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
||||
- const archiveLength = findArchiveLength(fragment_cache)
|
||||
.article-sort-title= _p('page.articles') + ' - ' + archiveLength
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
@@ -3,9 +3,9 @@ extends includes/layout.pug
|
||||
block content
|
||||
if theme.category_ui == 'index'
|
||||
include ./includes/mixins/post-ui.pug
|
||||
#recent-posts.recent-posts.category_ui
|
||||
#recent-posts.recent-posts.category_ui
|
||||
+postUI
|
||||
include includes/pagination.pug
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#category
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
- var top_img = theme.error_404.background || theme.default_top_img
|
||||
- var bg_img = `background-image: url('${url_for(top_img)}')`
|
||||
- var top_img_404 = theme.error_404.background || theme.default_top_img
|
||||
|
||||
#body-wrap.error404
|
||||
div(style='display: none')
|
||||
include ./header/index.pug
|
||||
include ./header/index.pug
|
||||
|
||||
#error-wrap
|
||||
.error-content
|
||||
.error-img(style=bg_img)
|
||||
.error-img
|
||||
img(src=url_for(top_img_404) alt='Page not found')
|
||||
.error-info
|
||||
h1.error_title= '404'
|
||||
.error_subtitle= theme.error_404.subtitle
|
||||
a.button--animated(href=config.root)
|
||||
i.fas.fa-rocket
|
||||
= _p('error404.back_button')
|
||||
|
||||
.error_subtitle= theme.error_404.subtitle || _p('error404')
|
||||
|
||||
@@ -1,60 +1,55 @@
|
||||
div
|
||||
script(src=url_for(theme.CDN.utils))
|
||||
script(src=url_for(theme.CDN.main))
|
||||
script(src=url_for(theme.asset.utils))
|
||||
script(src=url_for(theme.asset.main))
|
||||
|
||||
if theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
script(src=url_for(theme.asset.translate))
|
||||
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
script(src=url_for(theme.asset.medium_zoom))
|
||||
else if theme.fancybox
|
||||
script(src=url_for(theme.asset.fancybox))
|
||||
|
||||
if theme.instantpage
|
||||
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||
script(src=url_for(theme.asset.instantpage), type='module')
|
||||
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload))
|
||||
script(src=url_for(theme.asset.lazyload))
|
||||
|
||||
if theme.snackbar.enable
|
||||
script(src=url_for(theme.CDN.snackbar))
|
||||
script(src=url_for(theme.asset.snackbar))
|
||||
|
||||
if theme.pangu.enable
|
||||
!=partial('includes/third-party/pangu.pug', {}, {cache: true})
|
||||
|
||||
//- search
|
||||
if theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
else if theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache: true})
|
||||
!= partial("includes/third-party/pangu.pug", {}, { cache: true })
|
||||
|
||||
.js-pjax
|
||||
if needLoadCountJs
|
||||
!=partial('includes/third-party/card-post-count/index', {}, {cache: true})
|
||||
|
||||
!= partial("includes/third-party/card-post-count/index", {}, { cache: true })
|
||||
|
||||
if loadSubJs
|
||||
include ./third-party/subtitle.pug
|
||||
|
||||
include ./third-party/math/index.pug
|
||||
|
||||
include ./third-party/abcjs/index.pug
|
||||
|
||||
if commentsJsLoad
|
||||
include ./third-party/comments/js.pug
|
||||
|
||||
!=partial('includes/third-party/prismjs', {}, {cache: true})
|
||||
!= partial("includes/third-party/prismjs", {}, { cache: true })
|
||||
|
||||
if theme.aside.enable && theme.newest_comments.enable
|
||||
if theme.pjax.enable
|
||||
!=partial('includes/third-party/newest-comments/index', {}, {cache: true})
|
||||
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
||||
else if (!is_post() && page.aside !== false)
|
||||
!=partial('includes/third-party/newest-comments/index', {}, {cache: true})
|
||||
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
||||
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
!= fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
|
||||
!=partial('includes/third-party/effect', {}, {cache: true})
|
||||
!= partial("includes/third-party/effect", {}, { cache: true })
|
||||
|
||||
!= partial("includes/third-party/chat/index", {}, { cache: true })
|
||||
|
||||
!=partial('includes/third-party/chat/index', {}, {cache: true})
|
||||
|
||||
if theme.aplayerInject && theme.aplayerInject.enable
|
||||
if theme.pjax.enable || theme.aplayerInject.per_page
|
||||
include ./third-party/aplayer.pug
|
||||
@@ -62,7 +57,9 @@ div
|
||||
include ./third-party/aplayer.pug
|
||||
|
||||
if theme.pjax.enable
|
||||
!=partial('includes/third-party/pjax', {}, {cache: true})
|
||||
|
||||
!= partial("includes/third-party/pjax", {}, { cache: true })
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async data-pjax src=url_for(theme.CDN.busuanzi))
|
||||
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||
|
||||
!=partial('includes/third-party/search/index', {}, {cache: true})
|
||||
@@ -1,29 +1,22 @@
|
||||
- var pageTitle
|
||||
- if (is_archive()) pageTitle = fragment_cache('findArchivesTitle', function(){return findArchivesTitle(theme.menu);})
|
||||
- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : ''
|
||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||
- else if (is_year()) pageTitle += ': ' + page.year
|
||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404.error_title')
|
||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404')
|
||||
- else pageTitle = page.title || config.title || ''
|
||||
|
||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||
|
||||
- var pageKeywords
|
||||
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||||
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var themeColor = theme.display_mode === 'dark' ? '#0d0d0d' : '#ffffff'
|
||||
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
|
||||
- var themeColorDark = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_dark || '#0d0d0d'
|
||||
- var themeColor = theme.display_mode === 'dark' ? themeColorDark : themeColorLight
|
||||
|
||||
meta(charset='UTF-8')
|
||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||
meta(name="viewport" content="width=device-width,initial-scale=1")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover")
|
||||
title= tabTitle
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
@@ -33,7 +26,7 @@ meta(name="theme-color" content=themeColor)
|
||||
include ./head/Open_Graph.pug
|
||||
|
||||
!=favicon_tag(theme.favicon || config.favicon)
|
||||
link(rel="canonical" href=urlNoIndex())
|
||||
link(rel="canonical" href=urlNoIndex(null,config.pretty_urls.trailing_index,config.pretty_urls.trailing_html))
|
||||
|
||||
//- 預解析
|
||||
!=partial('includes/head/preconnect', {}, {cache: true})
|
||||
@@ -46,15 +39,14 @@ if (theme.pwa && theme.pwa.enable)
|
||||
!=partial('includes/head/pwa', {}, {cache: true})
|
||||
|
||||
//- main css
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome) media="print" onload="this.media='all'")
|
||||
link(rel='stylesheet', href=url_for(theme.asset.main_css))
|
||||
link(rel='stylesheet', href=url_for(theme.asset.fontawesome) media="print" onload="this.media='all'")
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css) media="print" onload="this.media='all'")
|
||||
link(rel='stylesheet', href=url_for(theme.asset.snackbar_css) media="print" onload="this.media='all'")
|
||||
|
||||
if theme.algolia_search.enable
|
||||
link(rel='stylesheet' href=url_for(theme.CDN.algolia_search_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.CDN.algolia_search) defer)
|
||||
if theme.fancybox
|
||||
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
|
||||
|
||||
//- google_adsense
|
||||
!=partial('includes/head/google_adsense', {}, {cache: true})
|
||||
@@ -74,4 +66,4 @@ include ./head/noscript.pug
|
||||
|
||||
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
|
||||
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
if theme.Open_Graph_meta
|
||||
- let contentType = is_post() ? 'article' : 'website'
|
||||
- let metaImage = (page.cover || theme.avatar.img) ? full_url_for(page.cover || theme.avatar.img) : ''
|
||||
- let fb_appId = theme.facebook_comments.app_id || ''
|
||||
- let fb_admins = theme.facebook_comments.user_id || ''
|
||||
|
||||
!= open_graph({type: contentType, image: metaImage, fb_admins: fb_admins, fb_app_id: fb_appId})
|
||||
|
||||
if theme.Open_Graph_meta.enable
|
||||
-
|
||||
const coverVal = page.cover_type === 'img' ? page.cover : theme.avatar.img
|
||||
let ogOption = Object.assign({
|
||||
type: is_post() ? 'article' : 'website',
|
||||
image: coverVal ? full_url_for(coverVal) : '',
|
||||
fb_admins: theme.facebook_comments.user_id || '',
|
||||
fb_app_id: theme.facebook_comments.app_id || '',
|
||||
}, theme.Open_Graph_meta.option)
|
||||
-
|
||||
!= open_graph(ogOption)
|
||||
else
|
||||
meta(name="description" content=page_description())
|
||||
|
||||
|
||||
@@ -16,21 +16,6 @@ if theme.google_analytics
|
||||
gtag('js', new Date());
|
||||
gtag('config', '!{theme.google_analytics}');
|
||||
|
||||
if theme.tencent_analytics
|
||||
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}`)
|
||||
|
||||
if theme.cloudflare_analytics
|
||||
script(defer data-pjax src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon=`{"token": "${theme.cloudflare_analytics}"}`)
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
hits: theme.algolia_search.hits,
|
||||
// search languages
|
||||
languages: {
|
||||
input_placeholder: _p("algolia_search.input_placeholder"),
|
||||
hits_empty: _p("algolia_search.hits_empty"),
|
||||
hits_stats: _p("algolia_search.hits_stats")
|
||||
input_placeholder: _p("search.algolia_search.input_placeholder"),
|
||||
hits_empty: _p("search.algolia_search.hits_empty"),
|
||||
hits_stats: _p("search.algolia_search.hits_stats"),
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -19,10 +19,14 @@
|
||||
let localSearch = 'undefined';
|
||||
if (theme.local_search && theme.local_search.enable) {
|
||||
localSearch = JSON.stringify({
|
||||
path: config.search.path,
|
||||
path: theme.local_search.CDN ? theme.local_search.CDN : config.root + config.search.path,
|
||||
preload: theme.local_search.preload,
|
||||
top_n_per_article: theme.local_search.top_n_per_article,
|
||||
unescape: theme.local_search.unescape,
|
||||
languages: {
|
||||
// search languages
|
||||
hits_empty: _p("local_search.hits_empty")
|
||||
hits_empty: _p("search.local_search.hits_empty"),
|
||||
hits_stats: _p("search.local_search.hits_stats"),
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -101,7 +105,7 @@ script.
|
||||
post: !{theme.post_meta.post.date_format === 'relative'}
|
||||
},
|
||||
runtime: '!{theme.runtimeshow.enable ? _p("aside.card_webinfo.runtime.unit") : ""}',
|
||||
date_suffix: {
|
||||
dateSuffix: {
|
||||
just: '!{_p("date_suffix.just")}',
|
||||
min: '!{_p("date_suffix.min")}',
|
||||
hour: '!{_p("date_suffix.hour")}',
|
||||
@@ -112,17 +116,16 @@ script.
|
||||
lightbox: '!{ theme.medium_zoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null" )}',
|
||||
Snackbar: !{Snackbar},
|
||||
source: {
|
||||
jQuery: '!{url_for(theme.CDN.jquery)}',
|
||||
justifiedGallery: {
|
||||
js: '!{url_for(theme.CDN.justifiedGallery_js)}',
|
||||
css: '!{url_for(theme.CDN.justifiedGallery_css)}'
|
||||
},
|
||||
fancybox: {
|
||||
js: '!{url_for(theme.CDN.fancybox)}',
|
||||
css: '!{url_for(theme.CDN.fancybox_css)}'
|
||||
js: '!{url_for(theme.asset.flickr_justified_gallery_js)}',
|
||||
css: '!{url_for(theme.asset.flickr_justified_gallery_css)}'
|
||||
}
|
||||
},
|
||||
isPhotoFigcaption: !{theme.photofigcaption},
|
||||
islazyload: !{theme.lazyload.enable},
|
||||
isanchor: !{theme.anchor}
|
||||
isAnchor: !{theme.anchor.auto_update || false},
|
||||
percent: {
|
||||
toc: !{theme.toc.scroll_percent},
|
||||
rightside: !{theme.rightside_scroll_percent},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
-
|
||||
const titleVal = pageTitle.replace(/'/ig,"\\'")
|
||||
|
||||
let isHighlightShrink
|
||||
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
||||
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
|
||||
else isHighlightShrink = theme.highlight_shrink
|
||||
|
||||
var pageToc = page.toc === true || page.toc === false ? page.toc : theme.toc.enable
|
||||
var showToc = is_post() && theme.aside.enable && pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
||||
|
||||
let titleVal = pageTitle.replace(/'/ig,"\\'")
|
||||
var showToc = false
|
||||
if (theme.aside.enable && page.aside !== false) {
|
||||
let tocEnable = false
|
||||
if (is_post()) {
|
||||
if (theme.toc.post) tocEnable = true
|
||||
} else if (is_page()) {
|
||||
if (theme.toc.page) tocEnable = true
|
||||
}
|
||||
const pageToc = page.toc === true || page.toc === false ? page.toc : tocEnable
|
||||
showToc = pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
||||
}
|
||||
-
|
||||
|
||||
script#config-diff.
|
||||
|
||||
@@ -6,12 +6,6 @@ if theme.google_analytics
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="//hm.baidu.com")
|
||||
|
||||
if theme.tencent_analytics
|
||||
link(rel="preconnect" href="//pingjs.qq.com")
|
||||
|
||||
if theme.cnzz_analytics
|
||||
link(rel="preconnect" href="//s4.cnzz.com")
|
||||
|
||||
if theme.cloudflare_analytics
|
||||
link(rel="preconnect" href="//static.cloudflareinsights.com")
|
||||
|
||||
@@ -21,5 +15,5 @@ if theme.microsoft_clarity
|
||||
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='')
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
if !theme.asset.busuanzi && (theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv)
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
@@ -1,6 +1,6 @@
|
||||
if !theme.disable_top_img && page.top_img !== false
|
||||
if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover
|
||||
- var top_img = page.top_img || page.cover || theme.default_top_img
|
||||
else if is_page()
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
else if is_tag()
|
||||
@@ -17,9 +17,9 @@ if !theme.disable_top_img && page.top_img !== false
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
|
||||
if top_img !== false
|
||||
- var imgSource = top_img && top_img.indexOf('/') !== -1 ? `background-image: url('${url_for(top_img)}')` : `background: ${top_img}`
|
||||
- var imgSource = top_img && isImgOrUrl(top_img) ? `background-image: url('${url_for(top_img)}')` : `background: ${top_img}`
|
||||
- var bg_img = top_img ? imgSource : ''
|
||||
- var site_title = is_archive() ? fragment_cache('findArchivesTitle', function(){return findArchivesTitle(theme.menu);}) : page.title || page.tag || page.category || config.title
|
||||
- var site_title = page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-home-page'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
else
|
||||
@@ -28,7 +28,9 @@ else
|
||||
- var top_img = false
|
||||
- var isHomeClass = 'not-top-img'
|
||||
|
||||
header#page-header(class=isHomeClass style=bg_img)
|
||||
- const isFixedClass = theme.nav.fixed ? ' fixed' : ''
|
||||
|
||||
header#page-header(class=`${isHomeClass+isFixedClass}` style=bg_img)
|
||||
!=partial('includes/header/nav', {}, {cache: true})
|
||||
if top_img !== false
|
||||
if is_post()
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
if theme.menu
|
||||
//- for mobile sidebar
|
||||
- let sidebarChildHide = theme.hide_sidebar_menu_child ? 'hide' : ''
|
||||
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if typeof value !== 'object'
|
||||
.menus_item
|
||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
i.fa-fw(class=trim(value.split('||')[1]))
|
||||
- const valueArray = value.split('||')
|
||||
a.site-page(href=url_for(trim(valueArray[0])))
|
||||
if valueArray[1]
|
||||
i.fa-fw(class=trim(valueArray[1]))
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page(href='javascript:void(0);')
|
||||
if label.split('||')[1]
|
||||
i.fa-fw(class=trim(label.split('||')[1]))
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
i.fas.fa-chevron-down.expand(class=sidebarChildHide)
|
||||
- const labelArray = label.split('||')
|
||||
- const hideClass = labelArray[2] && trim(labelArray[2]) === 'hide' ? 'hide' : ''
|
||||
a.site-page.group(class=`${hideClass}` href='javascript:void(0);')
|
||||
if labelArray[1]
|
||||
i.fa-fw(class=trim(labelArray[1]))
|
||||
span=' '+ trim(labelArray[0])
|
||||
i.fas.fa-chevron-down
|
||||
ul.menus_item_child
|
||||
each val,lab in value
|
||||
- const valArray = val.split('||')
|
||||
li
|
||||
a.site-page.child(href=url_for(trim(val.split('||')[0])))
|
||||
if val.split('||')[1]
|
||||
i.fa-fw(class=trim(val.split('||')[1]))
|
||||
a.site-page.child(href=url_for(trim(valArray[0])))
|
||||
if valArray[1]
|
||||
i.fa-fw(class=trim(valArray[1]))
|
||||
span=' '+ lab
|
||||
@@ -1,17 +1,21 @@
|
||||
nav#nav
|
||||
span#blog_name
|
||||
a#site-name(href=url_for('/')) #[=config.title]
|
||||
span#blog-info
|
||||
a(href=url_for('/') title=config.title)
|
||||
if theme.nav.logo
|
||||
img.site-icon(src=url_for(theme.nav.logo))
|
||||
if theme.nav.display_title
|
||||
span.site-name=config.title
|
||||
|
||||
#menus
|
||||
if (theme.algolia_search.enable || theme.local_search.enable)
|
||||
if (theme.algolia_search.enable || theme.local_search.enable || theme.docsearch.enable)
|
||||
#search-button
|
||||
a.site-page.social-icon.search
|
||||
a.site-page.social-icon.search(href="javascript:void(0);")
|
||||
i.fas.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
span=' '+_p('search.title')
|
||||
!=partial('includes/header/menu_item', {}, {cache: true})
|
||||
|
||||
#toggle-menu
|
||||
a.site-page
|
||||
a.site-page(href="javascript:void(0);")
|
||||
i.fas.fa-bars.fa-fw
|
||||
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
- let data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- let date_type = data_type_update ? 'updated' : 'date'
|
||||
- let date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt'
|
||||
- let data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
- let date_title = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
i.fa-fw.post-meta-icon(class=date_icon)
|
||||
span.post-meta-label= data_info
|
||||
span.post-meta-label= date_title
|
||||
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)
|
||||
span.post-meta-categories
|
||||
@@ -61,16 +61,32 @@
|
||||
if block
|
||||
block
|
||||
|
||||
if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
else if comments.use && !comments.lazyload
|
||||
if (comments.use.includes('Valine') && theme.valine.visitor) || (comments.use.includes('Waline') && theme.waline.visitor)
|
||||
- const commentUse = comments.use
|
||||
if page.comments !== false && commentUse && !comments.lazyload
|
||||
if commentUse[0] === 'Valine' && theme.valine.visitor
|
||||
+pvBlock(url_for(page.path),'leancloud_visitors',page.title)
|
||||
span.leancloud-visitors-count
|
||||
else if (comments.use.includes('Twikoo') && theme.twikoo.visitor)
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if commentUse[0] === 'Waline' && theme.waline.pageview
|
||||
+pvBlock('','','')
|
||||
span.waline-pageview-count(data-path=url_for(page.path))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if commentUse[0] === 'Twikoo' && theme.twikoo.visitor
|
||||
+pvBlock('','','')
|
||||
span#twikoo_visitors
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if commentUse[0] === 'Artalk' && theme.artalk.visitor
|
||||
+pvBlock('','','')
|
||||
span#ArtalkPV
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
|
||||
if comments.count && !comments.lazyload && page.comments !== false && comments.use
|
||||
- var whichCount = comments.use[0]
|
||||
@@ -85,27 +101,46 @@
|
||||
|
||||
case whichCount
|
||||
when 'Disqus'
|
||||
when 'Disqusjs'
|
||||
+countBlock
|
||||
span.disqus-comment-count
|
||||
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Disqusjs'
|
||||
+countBlock
|
||||
a(href=full_url_for(page.path) + '#disqusjs')
|
||||
span.disqus-comment-count(data-disqus-url=full_url_for(page.path))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Valine'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Waline'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.waline-comment-count(id=url_for(page.path))
|
||||
span.waline-comment-count(data-path=url_for(page.path))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Gitalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-comment-count
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Twikoo'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span#twikoo-count
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Facebook Comments'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.fb-comments-count(data-href=urlNoIndex())
|
||||
span.fb-comments-count(data-href=urlNoIndex())
|
||||
when 'Remark42'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.remark42__counter(data-url=urlNoIndex())
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Artalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.artalk-count
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
@@ -1,4 +1,4 @@
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=url_for(trim(url.split('||')[0])) target="_blank"
|
||||
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
|
||||
i(class=icon)
|
||||
i(class=icon style=url.split('||')[2] === undefined ? '' : `color: ${trim(url.split('||')[2]).replace(/[\'\"]/g, '')};`)
|
||||
@@ -1,4 +1,5 @@
|
||||
- var htmlClassHideAside = theme.aside.enable && theme.aside.hide ? 'hide-aside' : ''
|
||||
- page.aside = is_archive() ? theme.aside.display.archive: is_category() ? theme.aside.display.category : is_tag() ? theme.aside.display.tag : page.aside
|
||||
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||
- var pageType = is_post() ? 'post' : 'page'
|
||||
|
||||
@@ -7,8 +8,8 @@ html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside
|
||||
head
|
||||
include ./head.pug
|
||||
body
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading', {}, {cache: true})
|
||||
if theme.preloader.enable
|
||||
!=partial('includes/loading/index', {}, {cache: true})
|
||||
|
||||
if theme.background
|
||||
#web_bg
|
||||
@@ -32,7 +33,7 @@ html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside
|
||||
if (footerBg === true)
|
||||
- var footer_bg = bg_img
|
||||
else
|
||||
- var footer_bg = theme.footer_bg.indexOf('/') !== -1 ? `background-image: url('${url_for(footerBg)}')` : `background: ${footerBg}`
|
||||
- var footer_bg = isImgOrUrl(theme.footer_bg) ? `background-image: url('${url_for(footerBg)}')` : `background: ${footerBg}`
|
||||
else
|
||||
- var footer_bg = ''
|
||||
|
||||
@@ -43,5 +44,4 @@ html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside
|
||||
include ./404.pug
|
||||
|
||||
include ./rightside.pug
|
||||
!=partial('includes/third-party/search/index', {}, {cache: true})
|
||||
include ./additional-js.pug
|
||||
29
layout/includes/loading/fullpage-loading.pug
Normal file
29
layout/includes/loading/fullpage-loading.pug
Normal file
@@ -0,0 +1,29 @@
|
||||
#loading-box
|
||||
.loading-left-bg
|
||||
.loading-right-bg
|
||||
.spinner-box
|
||||
.configure-border-1
|
||||
.configure-core
|
||||
.configure-border-2
|
||||
.configure-core
|
||||
.loading-word= _p('loading')
|
||||
|
||||
script.
|
||||
const preloader = {
|
||||
endLoading: () => {
|
||||
document.body.style.overflow = '';
|
||||
document.getElementById('loading-box').classList.add("loaded")
|
||||
},
|
||||
initLoading: () => {
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.getElementById('loading-box').classList.remove("loaded")
|
||||
}
|
||||
}
|
||||
|
||||
preloader.initLoading()
|
||||
window.addEventListener('load',()=> { preloader.endLoading() })
|
||||
|
||||
if (!{theme.pjax && theme.pjax.enable}) {
|
||||
document.addEventListener('pjax:send', () => { preloader.initLoading() })
|
||||
document.addEventListener('pjax:complete', () => { preloader.endLoading() })
|
||||
}
|
||||
4
layout/includes/loading/index.pug
Normal file
4
layout/includes/loading/index.pug
Normal file
@@ -0,0 +1,4 @@
|
||||
if theme.preloader.source === 1
|
||||
include ./fullpage-loading.pug
|
||||
else
|
||||
include ./pace.pug
|
||||
@@ -1,13 +0,0 @@
|
||||
script.
|
||||
var preloader = {
|
||||
endLoading: () => {
|
||||
document.body.style.overflow = 'auto';
|
||||
document.getElementById('loading-box').classList.add("loaded")
|
||||
},
|
||||
initLoading: () => {
|
||||
document.body.style.overflow = '';
|
||||
document.getElementById('loading-box').classList.remove("loaded")
|
||||
|
||||
}
|
||||
}
|
||||
window.addEventListener('load',preloader.endLoading())
|
||||
@@ -1,9 +0,0 @@
|
||||
#loading-box
|
||||
.loading-left-bg
|
||||
.loading-right-bg
|
||||
.spinner-box
|
||||
.configure-border-1
|
||||
.configure-core
|
||||
.configure-border-2
|
||||
.configure-core
|
||||
.loading-word= _p('loading')
|
||||
11
layout/includes/loading/pace.pug
Normal file
11
layout/includes/loading/pace.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
script.
|
||||
window.paceOptions = {
|
||||
restartOnPushState: false
|
||||
}
|
||||
|
||||
document.addEventListener('pjax:send', () => {
|
||||
Pace.restart()
|
||||
})
|
||||
|
||||
link(rel="stylesheet", href=url_for(theme.preloader.pace_css_url || theme.asset.pace_default_css))
|
||||
script(src=url_for(theme.asset.pace_js))
|
||||
@@ -11,7 +11,10 @@ mixin articleSort(posts)
|
||||
.article-sort-item(class=no_cover)
|
||||
if article.cover && theme.cover.archives_enable
|
||||
a.article-sort-item-img(href=url_for(article.path) title=title)
|
||||
img(src=url_for(article.cover) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
|
||||
if article.cover_type === 'img'
|
||||
img(src=url_for(article.cover) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
|
||||
else
|
||||
div(style=`background: ${article.cover}`)
|
||||
.article-sort-item-info
|
||||
.article-sort-item-time
|
||||
i.far.fa-calendar-alt
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
mixin postUI(posts)
|
||||
each article , index in page.posts.data
|
||||
.recent-post-item
|
||||
- let link = article.link || article.path
|
||||
- let title = article.title || _p('no_title')
|
||||
- let leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||
- let post_cover = article.cover
|
||||
- let no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
-
|
||||
let link = article.link || article.path
|
||||
let title = article.title || _p('no_title')
|
||||
const position = theme.cover.position
|
||||
let leftOrRight = position === 'both'
|
||||
? index%2 == 0 ? 'left' : 'right'
|
||||
: position === 'left' ? 'left' : 'right'
|
||||
let post_cover = article.cover
|
||||
let no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
-
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title)
|
||||
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
|
||||
a(href=url_for(link) title=title)
|
||||
if article.cover_type === 'img'
|
||||
img.post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
else
|
||||
div.post-bg(style=`background: ${post_cover}`)
|
||||
.recent-post-info(class=no_cover)
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
.article-meta-wrap
|
||||
@@ -17,14 +25,14 @@ mixin postUI(posts)
|
||||
span.article-meta
|
||||
i.fas.fa-thumbtack.sticky
|
||||
span.sticky= _p('sticky')
|
||||
span.article-meta__separator |
|
||||
span.article-meta-separator |
|
||||
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')
|
||||
i.far.fa-calendar-alt
|
||||
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 |
|
||||
i.fas.fa-history
|
||||
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)
|
||||
@@ -38,25 +46,25 @@ mixin postUI(posts)
|
||||
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)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
span.article-meta-separator |
|
||||
i.fas.fa-inbox
|
||||
each item, index in article.categories.data
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fas.fa-angle-right
|
||||
i.fas.fa-angle-right.article-meta-link
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
span.article-meta__separator |
|
||||
span.article-meta-separator |
|
||||
i.fas.fa-tag
|
||||
each item, index in article.tags.data
|
||||
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
if (index < article.tags.data.length - 1)
|
||||
span.article-meta__link #[='•']
|
||||
span.article-meta-link #[='•']
|
||||
|
||||
mixin countBlockInIndex
|
||||
- needLoadCountJs = true
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
span.article-meta-separator |
|
||||
i.fas.fa-comments
|
||||
if block
|
||||
block
|
||||
@@ -65,24 +73,42 @@ mixin postUI(posts)
|
||||
if theme.comments.card_post_count
|
||||
case theme.comments.use[0]
|
||||
when 'Disqus'
|
||||
when 'Disqusjs'
|
||||
+countBlockInIndex
|
||||
a(href=full_url_for(link) + '#disqus_thread')
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Disqusjs'
|
||||
+countBlockInIndex
|
||||
a(href=full_url_for(link) + '#disqusjs')
|
||||
span.disqus-comment-count(data-disqus-url=full_url_for(link))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Valine'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count(data-xid=url_for(link) itemprop="commentCount")
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.valine-comment-count(data-xid=url_for(link))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Waline'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.waline-comment-count(id=url_for(link))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Twikoo'
|
||||
+countBlockInIndex
|
||||
a.twikoo-count(href=url_for(link) + '#post-comment')
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Facebook Comments'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.fb-comments-count(data-href=urlNoIndex(article.permalink))
|
||||
when 'Remark42'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.remark42__counter(data-url=urlNoIndex(article.permalink))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
when 'Artalk'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.artalk-count(data-page-key=url_for(link))
|
||||
i.fa-solid.fa-spinner.fa-spin
|
||||
|
||||
//- Display the article introduction on homepage
|
||||
case theme.index_post_content.method
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
.category-lists
|
||||
.category-title.is-center= _p('page.category')
|
||||
| -
|
||||
span.category-amount= site.categories.length
|
||||
div!= list_categories()
|
||||
.category-lists!= list_categories()
|
||||
@@ -1,4 +1,2 @@
|
||||
#article-container
|
||||
if top_img === false
|
||||
h1.page-title= page.title
|
||||
!= page.content
|
||||
@@ -1,21 +1,70 @@
|
||||
#article-container
|
||||
if top_img === false
|
||||
h1.page-title= page.title
|
||||
|
||||
.flink
|
||||
if site.data.link
|
||||
each i in site.data.link
|
||||
if i.class_name
|
||||
h2!= i.class_name
|
||||
if i.class_desc
|
||||
.flink-desc!=i.class_desc
|
||||
.flink-list
|
||||
each item in i.link_list
|
||||
.flink-list-item
|
||||
a(href=url_for(item.link) title=item.name target="_blank")
|
||||
.flink-item-icon
|
||||
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
|
||||
.flink-item-desc(title=item.descr)= item.descr
|
||||
!= page.content
|
||||
- let pageContent = page.content
|
||||
if page.flink_url
|
||||
script.
|
||||
(()=>{
|
||||
const replaceSymbol = (str) => {
|
||||
return str.replace(/[\p{P}\p{S}]/gu, "-")
|
||||
}
|
||||
|
||||
let result = ""
|
||||
fetch("!{url_for(page.flink_url)}")
|
||||
.then(response => response.json())
|
||||
.then(str => {
|
||||
for(let i = 0; i < str.length; i++){
|
||||
const replaceClassName = replaceSymbol(str[i].class_name)
|
||||
const className = str[i].class_name ? `<h2 id="${replaceClassName}"><a href="#${replaceClassName}" class="headerlink" title="${str[i].class_name}"></a>${str[i].class_name}</h2>` : ""
|
||||
const classDesc = str[i].class_desc ? `<div class="flink-desc">${str[i].class_desc}</div>` : ""
|
||||
|
||||
let listResult = ""
|
||||
const lists = str[i].link_list
|
||||
for(let j = 0; j < lists.length; j++){
|
||||
listResult += `
|
||||
<div class="flink-list-item">
|
||||
<a href="${lists[j].link}" title="${lists[j].name}" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="${lists[j].avatar}" onerror='this.onerror=null;this.src="!{url_for(theme.error_img.flink)}"' alt="${lists[j].name}" />
|
||||
</div>
|
||||
<div class="flink-item-name">${lists[j].name}</div>
|
||||
<div class="flink-item-desc" title="${lists[j].descr}">${lists[j].descr}</div>
|
||||
</a>
|
||||
</div>`
|
||||
}
|
||||
|
||||
result += `${className}${classDesc} <div class="flink-list">${listResult}</div>`
|
||||
}
|
||||
|
||||
document.querySelector(".flink").insertAdjacentHTML("afterbegin", result)
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
})
|
||||
})()
|
||||
|
||||
else
|
||||
if site.data.link
|
||||
- let result = ""
|
||||
each i in site.data.link
|
||||
- let className = i.class_name ? markdown(`## ${i.class_name}`) : ""
|
||||
- let classDesc = i.class_desc ? `<div class="flink-desc">${i.class_desc}</div>` : ""
|
||||
|
||||
- let listResult = ""
|
||||
|
||||
each j in i.link_list
|
||||
-
|
||||
listResult += `
|
||||
<div class="flink-list-item">
|
||||
<a href="${j.link}" title="${j.name}" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="${j.avatar}" onerror='this.onerror=null;this.src="${url_for(theme.error_img.flink)}"' alt="${j.name}" />
|
||||
</div>
|
||||
<div class="flink-item-name">${j.name}</div>
|
||||
<div class="flink-item-desc" title="${j.descr}">${j.descr}</div>
|
||||
</a>
|
||||
</div>`
|
||||
-
|
||||
|
||||
- result += `${className}${classDesc} <div class="flink-list">${listResult}</div>`
|
||||
|
||||
- pageContent = result + pageContent
|
||||
!= pageContent
|
||||
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
.tag-cloud-title.is-center= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud-amount= site.tags.length
|
||||
.tag-cloud-list.is-center
|
||||
!=cloudTags({source: site.tags, minfontsize: 1.2, maxfontsize: 2.1, limit: 0, unit: 'em'})
|
||||
!=cloudTags({source: site.tags, orderby: page.orderby || 'random', order: page.order || 1, minfontsize: 1.2, maxfontsize: 2.1, limit: 0, unit: 'em'})
|
||||
@@ -13,19 +13,23 @@ if is_post()
|
||||
if(prev)
|
||||
- var hasPageNext = next ? 'pull-left' : 'pull-full'
|
||||
.prev-post(class=hasPageNext)
|
||||
- var pagination_cover = prev.cover === false ? prev.randomcover : prev.cover
|
||||
a(href=url_for(prev.path))
|
||||
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of previous post')
|
||||
a(href=url_for(prev.path) title=prev.title)
|
||||
if prev.cover_type === 'img'
|
||||
img.cover(src=url_for(prev.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of previous post')
|
||||
else
|
||||
.cover(style=`background: ${prev.cover || 'var(--default-bg-color)'}`)
|
||||
.pagination-info
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info=prev.title
|
||||
|
||||
if(next)
|
||||
- var hasPagePrev = prev ? 'pull-right' : 'pull-full'
|
||||
- var pagination_cover = next.cover == false ? next.randomcover : next.cover
|
||||
.next-post(class=hasPagePrev)
|
||||
a(href=url_for(next.path))
|
||||
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of next post')
|
||||
a(href=url_for(next.path) title=next.title)
|
||||
if next.cover_type === 'img'
|
||||
img.cover(src=url_for(next.cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` alt='cover of next post')
|
||||
else
|
||||
.cover(style=`background: ${next.cover || 'var(--default-bg-color)'}`)
|
||||
.pagination-info
|
||||
.label=_p('pagination.next')
|
||||
.next_info=next.title
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
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)
|
||||
- let author = page.copyright_author || config.author
|
||||
- let authorHref = page.copyright_author_href || theme.post_copyright.author_href || config.url
|
||||
- let url = page.copyright_url || page.permalink
|
||||
- let 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__author
|
||||
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.post-reward
|
||||
.reward-button.button--animated
|
||||
.reward-button
|
||||
i.fas.fa-qrcode
|
||||
= ' ' + _p('donate')
|
||||
.reward-main
|
||||
|
||||
@@ -1,38 +1,61 @@
|
||||
- const { readmode, translate, darkmode, aside, chat_btn } = theme
|
||||
mixin rightsideItem(array)
|
||||
each item in array
|
||||
case item
|
||||
when 'readmode'
|
||||
if is_post() && readmode
|
||||
button#readmode(type="button" title=_p('rightside.readmode_title'))
|
||||
i.fas.fa-book-open
|
||||
when 'translate'
|
||||
if translate.enable
|
||||
button#translateLink(type="button" title=_p('rightside.translate_title'))= translate.default
|
||||
when 'darkmode'
|
||||
if darkmode.enable && darkmode.button
|
||||
button#darkmode(type="button" title=_p('rightside.night_mode_title'))
|
||||
i.fas.fa-adjust
|
||||
when 'hideAside'
|
||||
if aside.enable && aside.button && page.aside !== false
|
||||
button#hide-aside-btn(type="button" title=_p('rightside.aside'))
|
||||
i.fas.fa-arrows-alt-h
|
||||
when 'toc'
|
||||
if showToc
|
||||
button#mobile-toc-button.close(type="button" title=_p("rightside.toc"))
|
||||
i.fas.fa-list-ul
|
||||
when 'chat'
|
||||
if chat_btn
|
||||
button#chat_btn(type="button" title=_p("rightside.chat"))
|
||||
i.fas.fa-sms
|
||||
when 'comment'
|
||||
if commentsJsLoad
|
||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||
i.fas.fa-comments
|
||||
|
||||
#rightside
|
||||
- const { enable, hide, show } = theme.rightside_item_order
|
||||
- const hideArray = enable ? hide && hide.split(',') : ['readmode','translate','darkmode','hideAside']
|
||||
- const showArray = enable ? show && show.split(',') : ['toc','chat','comment']
|
||||
|
||||
|
||||
#rightside-config-hide
|
||||
if is_post() && theme.readmode
|
||||
button#readmode(type="button" title=_p('rightside.readmode_title'))
|
||||
i.fas.fa-book-open
|
||||
if theme.change_font_size
|
||||
button#font-plus(type="button" title=_p('rightside.font_plus_title'))
|
||||
i.fas.fa-plus
|
||||
button#font-minus(type="button" title=_p('rightside.font_minus_title'))
|
||||
i.fas.fa-minus
|
||||
if theme.translate.enable
|
||||
button#translateLink(type="button" title=_p('rightside.translate_title'))= theme.translate.default
|
||||
if theme.darkmode.enable && theme.darkmode.button
|
||||
button#darkmode(type="button" title=_p('rightside.night_mode_title'))
|
||||
i.fas.fa-adjust
|
||||
if theme.aside.enable && theme.aside.button && page.aside !== false
|
||||
button#hide-aside-btn(type="button" title=_p('rightside.aside'))
|
||||
i.fas.fa-arrows-alt-h
|
||||
if hideArray
|
||||
+rightsideItem(hideArray)
|
||||
#rightside-config-show
|
||||
if is_post()
|
||||
if (theme.readmode || theme.translate.enable || (theme.darkmode.enable && theme.darkmode.button) || theme.change_font_size)
|
||||
if enable
|
||||
if hide
|
||||
button#rightside_config(type="button" title=_p("rightside.setting"))
|
||||
i.fas.fa-cog.fa-spin
|
||||
else
|
||||
if is_post()
|
||||
if (readmode || translate.enable || (darkmode.enable && darkmode.button))
|
||||
button#rightside_config(type="button" title=_p("rightside.setting"))
|
||||
i.fas.fa-cog.fa-spin
|
||||
else if translate.enable || (darkmode.enable && darkmode.button)
|
||||
button#rightside_config(type="button" title=_p("rightside.setting"))
|
||||
i.fas.fa-cog.fa-spin
|
||||
if showToc
|
||||
button#mobile-toc-button.close(type="button" title=_p("rightside.toc"))
|
||||
i.fas.fa-list-ul
|
||||
else if theme.translate.enable || (theme.darkmode.enable && theme.darkmode.button) || theme.change_font_size
|
||||
button#rightside_config(type="button" title=_p("rightside.setting"))
|
||||
i.fas.fa-cog.fa-spin
|
||||
|
||||
if theme.chat_btn
|
||||
button#chat_btn(type="button" title=_p("rightside.chat_btn"))
|
||||
i.fas.fa-sms
|
||||
if commentsJsLoad
|
||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||
i.fas.fa-comments
|
||||
if showArray
|
||||
+rightsideItem(showArray)
|
||||
|
||||
button#go-up(type="button" title=_p("rightside.back_to_top"))
|
||||
span.scroll-percent
|
||||
i.fas.fa-arrow-up
|
||||
@@ -3,26 +3,16 @@
|
||||
#sidebar-menus
|
||||
.avatar-img.is-center
|
||||
img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar")
|
||||
.site-data
|
||||
if site.posts.length
|
||||
.data-item.is-center
|
||||
.data-item-link
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length-num= site.posts.length
|
||||
.sidebar-site-data.site-data.is-center
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length-num= site.posts.length
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
.headline= _p('aside.tags')
|
||||
.length-num= site.tags.length
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length-num= site.categories.length
|
||||
|
||||
if site.tags.length
|
||||
.data-item.is-center
|
||||
.data-item-link
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
.headline= _p('aside.tags')
|
||||
.length-num= site.tags.length
|
||||
|
||||
if site.categories.length
|
||||
.data-item.is-center
|
||||
.data-item-link
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length-num= site.categories.length
|
||||
hr
|
||||
!=partial('includes/header/menu_item', {}, {cache: true})
|
||||
|
||||
15
layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
15
layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
script.
|
||||
(() => {
|
||||
function abcjsInit() {
|
||||
function abcjsFn() {
|
||||
for (let abcContainer of document.getElementsByClassName("abc-music-sheet")) {
|
||||
ABCJS.renderAbc(abcContainer, abcContainer.innerHTML, {responsive: 'resize'})
|
||||
}
|
||||
}
|
||||
|
||||
typeof ABCJS === 'object' ? abcjsFn()
|
||||
: getScript('!{url_for(theme.asset.abcjs_basic_js)}').then(abcjsFn)
|
||||
}
|
||||
|
||||
window.pjax ? abcjsInit() : document.addEventListener('DOMContentLoaded', abcjsInit)
|
||||
})()
|
||||
6
layout/includes/third-party/abcjs/index.pug
vendored
Normal file
6
layout/includes/third-party/abcjs/index.pug
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
if theme.abcjs.enable
|
||||
if theme.abcjs.per_page
|
||||
if is_post() || is_page()
|
||||
include ./abcjs.pug
|
||||
else if page.abcjs
|
||||
include ./abcjs.pug
|
||||
6
layout/includes/third-party/aplayer.pug
vendored
6
layout/includes/third-party/aplayer.pug
vendored
@@ -1,3 +1,3 @@
|
||||
link(rel='stylesheet' href=url_for(theme.CDN.aplayer_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.CDN.aplayer_js))
|
||||
script(src=url_for(theme.CDN.meting_js))
|
||||
link(rel='stylesheet' href=url_for(theme.asset.aplayer_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.asset.aplayer_js))
|
||||
script(src=url_for(theme.asset.meting_js))
|
||||
20
layout/includes/third-party/card-post-count/artalk.pug
vendored
Normal file
20
layout/includes/third-party/card-post-count/artalk.pug
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
- const { server, site } = theme.artalk
|
||||
|
||||
script.
|
||||
(() => {
|
||||
const getArtalkCount = () => {
|
||||
const runWidget = () => {
|
||||
Artalk.LoadCountWidget({
|
||||
server: '!{server}',
|
||||
site: '!{site}',
|
||||
countEl: '.artalk-count'
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof Artalk === 'function') runWidget()
|
||||
else getScript('!{theme.asset.artalk_js}').then(runWidget)
|
||||
}
|
||||
|
||||
|
||||
window.pjax ? getArtalkCount() : window.addEventListener('load', getArtalkCount)
|
||||
})()
|
||||
@@ -1,10 +1,13 @@
|
||||
- const fbSDKVer = 'v16.0'
|
||||
- const fbSDK = theme.messenger.enable ? `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk/xfbml.customerchat.js#xfbml=1&version=${fbSDKVer}` : `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=${fbSDKVer}`
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
function loadFBComment () {
|
||||
if (typeof FB === 'object') FB.XFBML.parse()
|
||||
if (typeof FB === 'object') FB.XFBML.parse(document.getElementById('recent-posts'))
|
||||
else {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v9.0')
|
||||
ele.setAttribute('src','!{fbSDK}')
|
||||
ele.setAttribute('async', 'true')
|
||||
ele.setAttribute('defer', 'true')
|
||||
ele.setAttribute('crossorigin', 'anonymous')
|
||||
|
||||
@@ -9,4 +9,8 @@ case theme.comments.use[0]
|
||||
when 'Waline'
|
||||
include ./waline.pug
|
||||
when 'Facebook Comments'
|
||||
include ./fb.pug
|
||||
include ./fb.pug
|
||||
when 'Remark42'
|
||||
include ./remark42.pug
|
||||
when 'Artalk'
|
||||
include ./artalk.pug
|
||||
18
layout/includes/third-party/card-post-count/remark42.pug
vendored
Normal file
18
layout/includes/third-party/card-post-count/remark42.pug
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
- const { host, siteId, option } = theme.remark42
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
window.remark_config = Object.assign({
|
||||
host: '!{host}',
|
||||
site_id: '!{siteId}',
|
||||
},!{JSON.stringify(option)})
|
||||
|
||||
function getCount () {
|
||||
const s = document.createElement('script')
|
||||
s.src = remark_config.host + '/web/counter.js'
|
||||
s.defer = true
|
||||
document.head.appendChild(s)
|
||||
}
|
||||
|
||||
window.pjax ? getCount() : window.addEventListener('load', getCount)
|
||||
})()
|
||||
@@ -28,7 +28,7 @@ script.
|
||||
if (typeof twikoo === 'object') {
|
||||
runTwikoo()
|
||||
} else {
|
||||
getScript('!{theme.CDN.twikoo}').then(runTwikoo)
|
||||
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,13 +6,14 @@ script.
|
||||
el: '#vcomment',
|
||||
appId: '#{theme.valine.appId}',
|
||||
appKey: '#{theme.valine.appKey}',
|
||||
serverURLs: '#{theme.valine.serverURLs}'
|
||||
}
|
||||
|
||||
const valine = new Valine(initData)
|
||||
}
|
||||
|
||||
if (typeof Valine === 'function') initValine()
|
||||
else getScript('!{url_for(theme.CDN.valine)}').then(initValine)
|
||||
else getScript('!{url_for(theme.asset.valine)}').then(initValine)
|
||||
}
|
||||
|
||||
window.pjax ? loadValine() : window.addEventListener('load', loadValine)
|
||||
|
||||
@@ -5,12 +5,13 @@ script.
|
||||
let initData = {
|
||||
el: null,
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
comment: true
|
||||
}
|
||||
const waline = new Waline(initData)
|
||||
const waline = Waline.init(initData)
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') initWaline()
|
||||
else getScript('!{url_for(theme.CDN.waline)}').then(initWaline)
|
||||
if (typeof Waline === 'object') initWaline()
|
||||
else getScript('!{url_for(theme.asset.waline_js)}').then(initWaline)
|
||||
}
|
||||
|
||||
window.pjax ? loadWaline() : window.addEventListener('load', loadWaline)
|
||||
|
||||
43
layout/includes/third-party/chat/gitter.pug
vendored
43
layout/includes/third-party/chat/gitter.pug
vendored
@@ -1,43 +0,0 @@
|
||||
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)
|
||||
6
layout/includes/third-party/chat/index.pug
vendored
6
layout/includes/third-party/chat/index.pug
vendored
@@ -4,7 +4,7 @@ else if theme.tidio && theme.tidio.enable
|
||||
include ./tidio.pug
|
||||
else if theme.daovoice && theme.daovoice.enable
|
||||
include ./daovoice.pug
|
||||
else if theme.gitter && theme.gitter.enable
|
||||
include ./gitter.pug
|
||||
else if theme.crisp && theme.crisp.enable
|
||||
include ./crisp.pug
|
||||
include ./crisp.pug
|
||||
else if theme.messenger && theme.messenger.enable
|
||||
include ./messenger.pug
|
||||
42
layout/includes/third-party/chat/messenger.pug
vendored
Normal file
42
layout/includes/third-party/chat/messenger.pug
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
- let { pageID, lang } = theme.messenger
|
||||
- lang = theme.comments.use && theme.comments.use.includes('Facebook Comments') ? theme.facebook_comments.lang : lang
|
||||
|
||||
#fb-customer-chat.fb-customerchat(page_id=pageID attribution='biz_inbox')
|
||||
|
||||
script.
|
||||
document.getElementById('fb-root') ? '' : document.body.insertAdjacentHTML('afterend', '<div id="fb-root"></div>')
|
||||
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
xfbml: true,
|
||||
version: 'v16.0'
|
||||
});
|
||||
};
|
||||
|
||||
(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = 'https://connect.facebook.net/!{lang}/sdk/xfbml.customerchat.js';
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
|
||||
if (!{theme.chat_btn}) {
|
||||
var chatBtnFn = () => {
|
||||
var chatBtn = document.getElementById("chat_btn")
|
||||
chatBtn.addEventListener("click", function(){
|
||||
FB.CustomerChat.show();
|
||||
});
|
||||
}
|
||||
chatBtnFn()
|
||||
} else {
|
||||
if (!{theme.chat_hide_show}) {
|
||||
function chatBtnHide () {
|
||||
FB.CustomerChat.hide()
|
||||
}
|
||||
function chatBtnShow () {
|
||||
FB.CustomerChat.show(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
38
layout/includes/third-party/comments/artalk.pug
vendored
Normal file
38
layout/includes/third-party/comments/artalk.pug
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
- const { server, site, option } = theme.artalk
|
||||
|
||||
script.
|
||||
function loadArtalk () {
|
||||
function initArtalk () {
|
||||
window.artalkItem = new Artalk(Object.assign({
|
||||
el: '#artalk-wrap',
|
||||
server: '!{server}',
|
||||
site: '!{site}',
|
||||
pageKey: location.pathname,
|
||||
darkMode: document.documentElement.getAttribute('data-theme') === 'dark',
|
||||
countEl: '.artalk-count'
|
||||
},!{JSON.stringify(option)}))
|
||||
}
|
||||
|
||||
if (typeof window.artalkItem === 'object') setTimeout(()=>{initArtalk()},200)
|
||||
else {
|
||||
getCSS('!{theme.asset.artalk_css}')
|
||||
typeof Artalk !== 'function' ? getScript('!{theme.asset.artalk_js}').then(initArtalk)
|
||||
: setTimeout(()=>{initArtalk()},200)
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('darkmode').addEventListener('click',()=> {
|
||||
if (typeof window.artalkItem !== 'object') return
|
||||
let isDark = document.documentElement.getAttribute('data-theme') === 'dark'
|
||||
window.artalkItem.setDarkMode(!isDark)
|
||||
})
|
||||
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Artalk' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('artalk-wrap'), loadArtalk)
|
||||
else loadArtalk()
|
||||
} else {
|
||||
function loadOtherComment () {
|
||||
loadArtalk()
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ script.
|
||||
function loadDisqus () {
|
||||
var disqus_config = function () {
|
||||
this.page.url = '!{ page.permalink }'
|
||||
this.page.identifier = '!{ page.path }'
|
||||
this.page.identifier = '!{ url_for(page.path) }'
|
||||
this.page.title = '!{ disqusPageTitle }'
|
||||
};
|
||||
|
||||
@@ -24,6 +24,10 @@ script.
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
}
|
||||
|
||||
document.getElementById('darkmode').addEventListener('click', () => {
|
||||
setTimeout(() => window.disqusReset(), 200)
|
||||
})
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Disqus' || !!{theme.comments.lazyload}) {
|
||||
|
||||
@@ -1,43 +1,40 @@
|
||||
- let disqusjsApi = theme.disqusjs.api || 'https://disqus.skk.moe/disqus/'
|
||||
- let disqusjsPageTitle = page.title.replace(/'/ig,"\\'")
|
||||
|
||||
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({
|
||||
window.disqusjs = null
|
||||
disqusjs = new DisqusJS(Object.assign({
|
||||
shortname: '!{theme.disqusjs.shortname}',
|
||||
siteName: '!{theme.disqusjs.siteName}',
|
||||
identifier: '!{ page.path }',
|
||||
identifier: '!{ url_for(page.path) }',
|
||||
url: '!{ page.permalink }',
|
||||
title: '!{ disqusjsPageTitle }',
|
||||
api: '!{disqusjsApi}',
|
||||
apikey: '!{theme.disqusjs.apikey}',
|
||||
nocomment: '!{theme.disqusjs.nocomment}',
|
||||
admin: '!{theme.disqusjs.admin}',
|
||||
adminLabel: '!{theme.disqusjs.adminLabel}'
|
||||
});
|
||||
},!{JSON.stringify(theme.disqusjs.option)}))
|
||||
|
||||
disqusjs.render(document.getElementById('disqusjs'))
|
||||
}
|
||||
|
||||
window.disqusReset = initDisqusjs
|
||||
const themeChange = () => {
|
||||
const ele = document.getElementById('disqus_thread')
|
||||
if(!ele) return
|
||||
disqusjs.destroy()
|
||||
initDisqusjs()
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('darkmode').addEventListener('click', themeChange)
|
||||
|
||||
if (window.disqusJsLoad) initDisqusjs()
|
||||
else {
|
||||
addDisqusjsCSS()
|
||||
getScript('!{url_for(theme.CDN.disqusjs)}').then(initDisqusjs)
|
||||
getCSS('!{url_for(theme.asset.disqusjs_css)}')
|
||||
getScript('!{url_for(theme.asset.disqusjs)}').then(initDisqusjs)
|
||||
window.disqusJsLoad = true
|
||||
}
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Disqusjs' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('disqus_thread'), loadDisqusjs)
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('disqusjs'), loadDisqusjs)
|
||||
else loadDisqusjs()
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
#fb-root
|
||||
- const fbSDKVer = 'v16.0'
|
||||
- const fbSDK = theme.messenger.enable ? `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk/xfbml.customerchat.js#xfbml=1&version=${fbSDKVer}` : `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=${fbSDKVer}`
|
||||
|
||||
script.
|
||||
function loadFBComment () {
|
||||
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
|
||||
document.getElementById('fb-root') ? '' : document.body.insertAdjacentHTML('afterend', '<div id="fb-root"></div>')
|
||||
|
||||
if (typeof FB === 'object') FB.XFBML.parse()
|
||||
const themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||
const $fbComment = document.getElementsByClassName('fb-comments')[0]
|
||||
$fbComment.setAttribute('data-colorscheme',themeNow)
|
||||
$fbComment.setAttribute('data-href', '!{urlNoIndex(page.permalink)}')
|
||||
|
||||
if (typeof FB === 'object') {
|
||||
FB.XFBML.parse(document.getElementsByClassName('post-meta-commentcount')[0])
|
||||
FB.XFBML.parse(document.getElementById('post-comment'))
|
||||
}
|
||||
else {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v10.0')
|
||||
ele.setAttribute('src','!{fbSDK}')
|
||||
ele.setAttribute('async', 'true')
|
||||
ele.setAttribute('defer', 'true')
|
||||
ele.setAttribute('crossorigin', 'anonymous')
|
||||
ele.setAttribute('id', 'facebook-jssdk')
|
||||
document.getElementById('fb-root').insertAdjacentElement('afterbegin',ele)
|
||||
}
|
||||
}
|
||||
|
||||
51
layout/includes/third-party/comments/giscus.pug
vendored
Normal file
51
layout/includes/third-party/comments/giscus.pug
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
- const { repo, repo_id, category_id, theme:themes, option } = theme.giscus
|
||||
- const giscusUrl = theme.asset.giscus || 'https://giscus.app/client.js'
|
||||
- const giscusOriginUrl = new URL(giscusUrl).origin
|
||||
|
||||
script.
|
||||
function getGiscusTheme () {
|
||||
return document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
||||
}
|
||||
|
||||
function loadGiscus () {
|
||||
const config = Object.assign({
|
||||
src: '!{giscusUrl}',
|
||||
'data-repo': '!{repo}',
|
||||
'data-repo-id': '!{repo_id}',
|
||||
'data-category-id': '!{category_id}',
|
||||
'data-mapping': 'pathname',
|
||||
'data-theme': getGiscusTheme(),
|
||||
'data-reactions-enabled': '1',
|
||||
crossorigin: 'anonymous',
|
||||
async: true
|
||||
},!{JSON.stringify(option)})
|
||||
|
||||
let ele = document.createElement('script')
|
||||
for (let key in config) {
|
||||
ele.setAttribute(key, config[key])
|
||||
}
|
||||
document.getElementById('giscus-wrap').insertAdjacentElement('afterbegin',ele)
|
||||
}
|
||||
|
||||
function changeGiscusTheme () {
|
||||
function sendMessage(message) {
|
||||
const iframe = document.querySelector('iframe.giscus-frame')
|
||||
if (!iframe) return
|
||||
iframe.contentWindow.postMessage({ giscus: message }, '!{giscusOriginUrl}')
|
||||
}
|
||||
|
||||
sendMessage({
|
||||
setConfig: {
|
||||
theme: getGiscusTheme()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Giscus' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('giscus-wrap'), loadGiscus)
|
||||
else loadGiscus()
|
||||
} else {
|
||||
function loadOtherComment () {
|
||||
loadGiscus()
|
||||
}
|
||||
}
|
||||
16
layout/includes/third-party/comments/gitalk.pug
vendored
16
layout/includes/third-party/comments/gitalk.pug
vendored
@@ -1,11 +1,4 @@
|
||||
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(Object.assign({
|
||||
@@ -15,11 +8,6 @@ script.
|
||||
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
|
||||
},!{JSON.stringify(theme.gitalk.option)}))
|
||||
|
||||
@@ -28,8 +16,8 @@ script.
|
||||
|
||||
if (typeof Gitalk === 'function') initGitalk()
|
||||
else {
|
||||
addGitalkSource()
|
||||
getScript('!{url_for(theme.CDN.gitalk)}').then(initGitalk)
|
||||
getCSS('!{url_for(theme.asset.gitalk_css)}')
|
||||
getScript('!{url_for(theme.asset.gitalk)}').then(initGitalk)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ hr
|
||||
when 'Valine'
|
||||
#vcomment.vcomment
|
||||
when 'Disqusjs'
|
||||
#disqus_thread
|
||||
#disqusjs
|
||||
when 'Livere'
|
||||
#lv-container(data-id="city" data-uid=theme.livere.uid)
|
||||
when 'Gitalk'
|
||||
@@ -33,8 +33,14 @@ hr
|
||||
#twikoo-wrap
|
||||
when 'Waline'
|
||||
#waline-wrap
|
||||
when 'Giscus'
|
||||
#giscus-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%")
|
||||
when 'Remark42'
|
||||
#remark42
|
||||
when 'Artalk'
|
||||
#artalk-wrap
|
||||
|
||||
8
layout/includes/third-party/comments/js.pug
vendored
8
layout/includes/third-party/comments/js.pug
vendored
@@ -16,5 +16,11 @@ each name in theme.comments.use
|
||||
!=partial('includes/third-party/comments/twikoo', {}, {cache: true})
|
||||
when 'Waline'
|
||||
!=partial('includes/third-party/comments/waline', {}, {cache: true})
|
||||
when 'Giscus'
|
||||
!=partial('includes/third-party/comments/giscus', {}, {cache: true})
|
||||
when 'Facebook Comments'
|
||||
!=partial('includes/third-party/comments/facebook_comments', {}, {cache: true})
|
||||
include ./facebook_comments.pug
|
||||
when 'Remark42'
|
||||
!=partial('includes/third-party/comments/remark42', {}, {cache: true})
|
||||
when 'Artalk'
|
||||
!=partial('includes/third-party/comments/artalk', {}, {cache: true})
|
||||
67
layout/includes/third-party/comments/remark42.pug
vendored
Normal file
67
layout/includes/third-party/comments/remark42.pug
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
- const { host, siteId, option } = theme.remark42
|
||||
script.
|
||||
var remark_config = Object.assign({
|
||||
host: '!{host}',
|
||||
site_id: '!{siteId}',
|
||||
components: ['embed'],
|
||||
theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||
},!{JSON.stringify(option)})
|
||||
|
||||
function addRemark42(){
|
||||
for (let i = 0; i < remark_config.components.length; i++) {
|
||||
const s = document.createElement('script')
|
||||
s.src = remark_config.host + '/web/' + remark_config.components[i] + '.js'
|
||||
s.defer = true
|
||||
document.head.appendChild(s)
|
||||
}
|
||||
}
|
||||
|
||||
function initRemark42() {
|
||||
if (window.REMARK42) {
|
||||
if (this.remark42Instance) {
|
||||
this.remark42Instance.destroy()
|
||||
}
|
||||
|
||||
this.remark42Instance = window.REMARK42.createInstance({
|
||||
...remark_config
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function getCount () {
|
||||
const ele = document.querySelector('.remark42__counter')
|
||||
if (ele) {
|
||||
const s = document.createElement('script')
|
||||
s.src = remark_config.host + '/web/counter.js'
|
||||
s.defer = true
|
||||
document.head.appendChild(s)
|
||||
}
|
||||
}
|
||||
|
||||
function loadRemark42 () {
|
||||
if (window.REMARK42) {
|
||||
this.initRemark42()
|
||||
getCount()
|
||||
} else {
|
||||
addRemark42()
|
||||
window.addEventListener('REMARK42::ready', () => {
|
||||
this.initRemark42()
|
||||
getCount()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('darkmode').addEventListener('click',()=>{
|
||||
if (!window.REMARK42) return
|
||||
let theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'
|
||||
window.REMARK42.changeTheme(theme)
|
||||
})
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Remark42' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('remark42'), loadRemark42)
|
||||
else loadRemark42()
|
||||
} else {
|
||||
function loadOtherComment () {
|
||||
loadRemark42()
|
||||
}
|
||||
}
|
||||
48
layout/includes/third-party/comments/twikoo.pug
vendored
48
layout/includes/third-party/comments/twikoo.pug
vendored
@@ -1,42 +1,50 @@
|
||||
- const { envId, region, option } = theme.twikoo
|
||||
- const { use, lazyload, count } = theme.comments
|
||||
|
||||
script.
|
||||
(()=>{
|
||||
const $countDom = document.getElementById('twikoo-count')
|
||||
const init = () => {
|
||||
twikoo.init(Object.assign({
|
||||
el: '#twikoo-wrap',
|
||||
envId: '!{theme.twikoo.envId}',
|
||||
region: '!{theme.twikoo.region}'
|
||||
}, !{JSON.stringify(theme.twikoo.option)}))
|
||||
envId: '!{envId}',
|
||||
region: '!{region}',
|
||||
onCommentLoaded: function () {
|
||||
btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
|
||||
}
|
||||
}, !{JSON.stringify(option)}))
|
||||
}
|
||||
|
||||
const getCount = () => {
|
||||
const countELement = document.getElementById('twikoo-count')
|
||||
if(!countELement) return
|
||||
twikoo.getCommentsCount({
|
||||
envId: '!{theme.twikoo.envId}',
|
||||
region: '!{theme.twikoo.region}',
|
||||
envId: '!{envId}',
|
||||
region: '!{region}',
|
||||
urls: [window.location.pathname],
|
||||
includeReply: false
|
||||
}).then(function (res) {
|
||||
$countDom.innerText = res[0].count
|
||||
countELement.innerText = res[0].count
|
||||
}).catch(function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
const loadTwikoo = (bool = false) => {
|
||||
if (typeof twikoo === 'object') {
|
||||
init()
|
||||
bool && $countDom && setTimeout(getCount,0)
|
||||
} else {
|
||||
getScript('!{theme.CDN.twikoo}').then(()=> {
|
||||
init()
|
||||
bool && $countDom && setTimeout(getCount,0)
|
||||
})
|
||||
}
|
||||
const runFn = () => {
|
||||
init()
|
||||
!{count ? 'GLOBAL_CONFIG_SITE.isPost && getCount()' : ''}
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Twikoo' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
|
||||
else loadTwikoo(true)
|
||||
const loadTwikoo = () => {
|
||||
if (typeof twikoo === 'object') {
|
||||
setTimeout(runFn,0)
|
||||
return
|
||||
}
|
||||
getScript('!{url_for(theme.asset.twikoo)}').then(runFn)
|
||||
}
|
||||
|
||||
if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
|
||||
if (!{lazyload}) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
|
||||
else loadTwikoo()
|
||||
} else {
|
||||
window.loadOtherComment = () => {
|
||||
loadTwikoo()
|
||||
|
||||
@@ -2,7 +2,7 @@ script.
|
||||
function loadUtterances () {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('id', 'utterances_comment')
|
||||
ele.setAttribute('src', '!{url_for(theme.CDN.utterances)}')
|
||||
ele.setAttribute('src', 'https://utteranc.es/client.js')
|
||||
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}'
|
||||
@@ -13,13 +13,13 @@ script.
|
||||
}
|
||||
|
||||
function utterancesTheme () {
|
||||
if (document.querySelector('.utterances-frame')) {
|
||||
const iframe = document.querySelector('.utterances-frame')
|
||||
if (iframe) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
10
layout/includes/third-party/comments/valine.pug
vendored
10
layout/includes/third-party/comments/valine.pug
vendored
@@ -9,24 +9,16 @@ script.
|
||||
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,
|
||||
requiredFields: [!{theme.valine.requiredFields ? JSON.stringify(theme.valine.requiredFields).split(',') : ''}],
|
||||
visitor: #{theme.valine.visitor}
|
||||
}, !{JSON.stringify(theme.valine.option)}))
|
||||
}
|
||||
|
||||
if (typeof Valine === 'function') initValine()
|
||||
else getScript('!{url_for(theme.CDN.valine)}').then(initValine)
|
||||
else getScript('!{url_for(theme.asset.valine)}').then(initValine)
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Valine' || !!{theme.comments.lazyload}) {
|
||||
|
||||
30
layout/includes/third-party/comments/waline.pug
vendored
30
layout/includes/third-party/comments/waline.pug
vendored
@@ -1,25 +1,33 @@
|
||||
- const { serverURL, avatar, avatarCDN, visitor, option } = theme.waline
|
||||
- const { serverURL, option, pageview } = theme.waline
|
||||
- const { lazyload, count, use } = theme.comments
|
||||
|
||||
script.
|
||||
function loadWaline () {
|
||||
function initWaline () {
|
||||
const waline = new Waline(Object.assign({
|
||||
const waline = Waline.init(Object.assign({
|
||||
el: '#waline-wrap',
|
||||
serverURL: '!{serverURL}',
|
||||
avatar: '#{avatar}',
|
||||
avatarCDN: '!{avatarCDN || "https://sdn.geekzu.org/avatar/"}',
|
||||
path: location.pathname,
|
||||
visitor: !{visitor},
|
||||
dark: 'html[data-theme="dark"]'
|
||||
pageview: !{lazyload ? false : pageview},
|
||||
dark: 'html[data-theme="dark"]',
|
||||
path: window.location.pathname,
|
||||
comment: !{lazyload ? false : count},
|
||||
}, !{JSON.stringify(option)}))
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') initWaline()
|
||||
else getScript('!{url_for(theme.CDN.waline)}').then(initWaline)
|
||||
const walineCSSLoad = document.getElementById('waline-css')
|
||||
|
||||
if (typeof Waline === 'object') {
|
||||
walineCSSLoad ? initWaline() : getCSS('!{url_for(theme.asset.waline_css)}','waline-css').then(initWaline)
|
||||
}
|
||||
else {
|
||||
getCSS('!{url_for(theme.asset.waline_css)}','waline-css').then(() => {
|
||||
getScript('!{url_for(theme.asset.waline_js)}').then(initWaline)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if ('!{theme.comments.use[0]}' === 'Waline' || !!{theme.comments.lazyload}) {
|
||||
if (!{theme.comments.lazyload}) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
|
||||
if ('!{use[0]}' === 'Waline' || !!{lazyload}) {
|
||||
if (!{lazyload}) btf.loadComment(document.getElementById('waline-wrap'),loadWaline)
|
||||
else setTimeout(loadWaline, 0)
|
||||
} else {
|
||||
function loadOtherComment () {
|
||||
|
||||
14
layout/includes/third-party/effect.pug
vendored
14
layout/includes/third-party/effect.pug
vendored
@@ -1,19 +1,19 @@
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks(mobile=`${theme.fireworks.mobile}`)
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
script(src=url_for(theme.asset.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
|
||||
script(defer id="ribbon" src=url_for(theme.asset.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_fluttering_ribbon && theme.canvas_fluttering_ribbon.enable)
|
||||
script(defer id="fluttering_ribbon" mobile=`${theme.canvas_fluttering_ribbon.mobile}` src=url_for(theme.CDN.canvas_fluttering_ribbon))
|
||||
script(defer id="fluttering_ribbon" mobile=`${theme.canvas_fluttering_ribbon.mobile}` src=url_for(theme.asset.canvas_fluttering_ribbon))
|
||||
|
||||
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))
|
||||
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.asset.canvas_nest))
|
||||
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script(src=url_for(theme.asset.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = !{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = !{theme.activate_power_mode.shake};
|
||||
@@ -22,11 +22,11 @@ if theme.activate_power_mode.enable
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart && theme.click_heart.enable
|
||||
script#click-heart(src=url_for(theme.CDN.click_heart) async mobile=`${theme.click_heart.mobile}`)
|
||||
script#click-heart(src=url_for(theme.asset.click_heart) async mobile=`${theme.click_heart.mobile}`)
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script#click-show-text(
|
||||
src= url_for(theme.CDN.ClickShowText)
|
||||
src= url_for(theme.asset.ClickShowText)
|
||||
data-mobile= `${theme.ClickShowText.mobile}`
|
||||
data-text= theme.ClickShowText.text.join(",")
|
||||
data-fontsize= theme.ClickShowText.fontSize
|
||||
|
||||
5
layout/includes/third-party/math/katex.pug
vendored
5
layout/includes/third-party/math/katex.pug
vendored
@@ -1,6 +1,5 @@
|
||||
link(rel="stylesheet" type="text/css" href=theme.CDN.katex)
|
||||
script(src=url_for(theme.CDN.katex_copytex))
|
||||
link(rel="stylesheet" type="text/css" href=theme.CDN.katex_copytex_css)
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.asset.katex))
|
||||
script(src=url_for(theme.asset.katex_copytex))
|
||||
script.
|
||||
(() => {
|
||||
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
|
||||
|
||||
15
layout/includes/third-party/math/mathjax.pug
vendored
15
layout/includes/third-party/math/mathjax.pug
vendored
@@ -7,7 +7,7 @@ script.
|
||||
tags: 'ams'
|
||||
},
|
||||
chtml: {
|
||||
scale: 1.2
|
||||
scale: 1.1
|
||||
},
|
||||
options: {
|
||||
renderActions: {
|
||||
@@ -23,12 +23,11 @@ script.
|
||||
}
|
||||
}, ''],
|
||||
insertScript: [200, () => {
|
||||
document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
|
||||
const target = node.parentNode
|
||||
if (target.nodeName.toLowerCase() === 'li') {
|
||||
target.parentNode.classList.add('has-jax')
|
||||
document.querySelectorAll('mjx-container').forEach(node => {
|
||||
if (node.hasAttribute('display')) {
|
||||
btf.wrap(node, 'div', { class: 'mathjax-overflow' })
|
||||
} else {
|
||||
target.classList.add('has-jax')
|
||||
btf.wrap(node, 'span', { class: 'mathjax-overflow' })
|
||||
}
|
||||
});
|
||||
}, '', false]
|
||||
@@ -37,12 +36,12 @@ script.
|
||||
}
|
||||
|
||||
const script = document.createElement('script')
|
||||
script.src = '!{theme.CDN.mathjax}'
|
||||
script.src = '!{url_for(theme.asset.mathjax)}'
|
||||
script.id = 'MathJax-script'
|
||||
script.async = true
|
||||
document.head.appendChild(script)
|
||||
} else {
|
||||
MathJax.startup.document.state(0)
|
||||
MathJax.texReset()
|
||||
MathJax.typeset()
|
||||
MathJax.typesetPromise()
|
||||
}
|
||||
35
layout/includes/third-party/math/mermaid.pug
vendored
35
layout/includes/third-party/math/mermaid.pug
vendored
@@ -1,15 +1,26 @@
|
||||
script.
|
||||
if (document.getElementsByClassName('mermaid').length) {
|
||||
if (window.mermaidJsLoad) mermaid.init()
|
||||
else {
|
||||
getScript('!{theme.CDN.mermaid}').then(() => {
|
||||
window.mermaidJsLoad = true
|
||||
mermaid.initialize({
|
||||
theme: '!{theme.mermaid.theme}',
|
||||
(() => {
|
||||
const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
|
||||
if ($mermaidWrap.length) {
|
||||
window.runMermaid = () => {
|
||||
window.loadMermaid = true
|
||||
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{theme.mermaid.theme.dark}' : '!{theme.mermaid.theme.light}'
|
||||
|
||||
Array.from($mermaidWrap).forEach((item, index) => {
|
||||
const mermaidSrc = item.firstElementChild
|
||||
const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
|
||||
const mermaidID = 'mermaid-' + index
|
||||
const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
|
||||
mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
|
||||
mermaidSrc.insertAdjacentHTML('afterend', svgCode)
|
||||
})
|
||||
})
|
||||
!{theme.pjax.enable} && mermaid.init()
|
||||
})
|
||||
}
|
||||
|
||||
const loadMermaid = () => {
|
||||
window.loadMermaid ? runMermaid() : getScript('!{url_for(theme.asset.mermaid)}').then(runMermaid)
|
||||
}
|
||||
|
||||
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})()
|
||||
89
layout/includes/third-party/newest-comments/artalk.pug
vendored
Normal file
89
layout/includes/third-party/newest-comments/artalk.pug
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
- const { server, site, option } = theme.artalk
|
||||
- const avatarCdn = option !== null && option.gravatar ? option.gravatar.mirror : 'https://sdn.geekzu.org/avatar/'
|
||||
- const avatarDefault = option !== null && option.gravatar ? option.gravatar.default : 'mp'
|
||||
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
if (content === '') return content
|
||||
|
||||
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
|
||||
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
|
||||
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
|
||||
content = content.replace(/<[^>]+>/g,"") // remove html tag
|
||||
|
||||
if (content.length > 150) {
|
||||
content = content.substring(0,150) + '...'
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
const generateHtml = array => {
|
||||
let result = ''
|
||||
|
||||
if (array.length) {
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
result += '<div class=\'aside-list-item\'>'
|
||||
|
||||
if (!{theme.newest_comments.avatar}) {
|
||||
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
|
||||
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
} else {
|
||||
result += '!{_p("aside.card_newest_comments.zero")}'
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
const headerList = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Origin': window.location.origin
|
||||
}
|
||||
}
|
||||
|
||||
const getComment = () => {
|
||||
fetch('!{server}/api/stat?type=latest_comments&limit=!{theme.newest_comments.limit}&site_name=!{site}', headerList)
|
||||
.then(response => response.json())
|
||||
.then(d => {
|
||||
const artalk = d.data.map(function (e) {
|
||||
return {
|
||||
'avatar': '!{avatarCdn}' + e.email_encrypted + '?d=!{avatarDefault}',
|
||||
'content': changeContent(e.content_marked),
|
||||
'nick': e.nick,
|
||||
'url': e.page_url,
|
||||
'date': e.date,
|
||||
}
|
||||
})
|
||||
saveToLocal.set('artalk-newest-comments', JSON.stringify(artalk), !{theme.newest_comments.storage}/(60*24))
|
||||
generateHtml(artalk)
|
||||
}).catch(e => {
|
||||
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= "!{_p('aside.card_newest_comments.error')}"
|
||||
})
|
||||
}
|
||||
|
||||
const newestCommentInit = () => {
|
||||
if (document.querySelector('#card-newest-comments .aside-list')) {
|
||||
const data = saveToLocal.get('artalk-newest-comments')
|
||||
if (data) {
|
||||
generateHtml(JSON.parse(data))
|
||||
} else {
|
||||
getComment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newestCommentInit()
|
||||
document.addEventListener('pjax:complete', newestCommentInit)
|
||||
})
|
||||
@@ -49,7 +49,7 @@ script.
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick}</span><time> / ${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ script.
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
|
||||
@@ -23,4 +23,8 @@ if use
|
||||
include ./github-issues.pug
|
||||
when 'Utterances'
|
||||
- userRepo = theme.utterances.repo
|
||||
include ./github-issues.pug
|
||||
include ./github-issues.pug
|
||||
when 'Remark42'
|
||||
include ./remark42.pug
|
||||
when 'Artalk'
|
||||
include ./artalk.pug
|
||||
80
layout/includes/third-party/newest-comments/remark42.pug
vendored
Normal file
80
layout/includes/third-party/newest-comments/remark42.pug
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
- const { host, siteId } = theme.remark42
|
||||
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
if (content === '') return content
|
||||
|
||||
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
|
||||
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
|
||||
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
|
||||
content = content.replace(/<[^>]+>/g,"") // remove html tag
|
||||
|
||||
if (content.length > 150) {
|
||||
content = content.substring(0,150) + '...'
|
||||
}
|
||||
return content
|
||||
}
|
||||
|
||||
const generateHtml = array => {
|
||||
let result = ''
|
||||
|
||||
if (array.length) {
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
result += '<div class=\'aside-list-item\'>'
|
||||
|
||||
if (!{theme.newest_comments.avatar}) {
|
||||
const name = '!{theme.lazyload.enable ? "data-lazy-src" : "src"}'
|
||||
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
} else {
|
||||
result += '!{_p("aside.card_newest_comments.zero")}'
|
||||
}
|
||||
|
||||
let $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= result
|
||||
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||
window.pjax && window.pjax.refresh($dom)
|
||||
}
|
||||
|
||||
const getComment = () => {
|
||||
fetch('!{host}/api/v1/last/!{theme.newest_comments.limit}?site=!{siteId}')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const remark42 = data.map(function (e) {
|
||||
return {
|
||||
'avatar': e.user.picture,
|
||||
'content': changeContent(e.text),
|
||||
'nick': e.user.name,
|
||||
'url': e.locator.url,
|
||||
'date': e.time,
|
||||
}
|
||||
})
|
||||
saveToLocal.set('remark42-newest-comments', JSON.stringify(remark42), !{theme.newest_comments.storage}/(60*24))
|
||||
generateHtml(remark42)
|
||||
}).catch(e => {
|
||||
const $dom = document.querySelector('#card-newest-comments .aside-list')
|
||||
$dom.innerHTML= "!{_p('aside.card_newest_comments.error')}"
|
||||
})
|
||||
}
|
||||
|
||||
const newestCommentInit = () => {
|
||||
if (document.querySelector('#card-newest-comments .aside-list')) {
|
||||
const data = saveToLocal.get('remark42-newest-comments')
|
||||
if (data) {
|
||||
generateHtml(JSON.parse(data))
|
||||
} else {
|
||||
getComment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newestCommentInit()
|
||||
document.addEventListener('pjax:complete', newestCommentInit)
|
||||
})
|
||||
@@ -43,7 +43,7 @@ script.
|
||||
if (typeof twikoo === 'object') {
|
||||
runTwikoo()
|
||||
} else {
|
||||
getScript('!{theme.CDN.twikoo}').then(runTwikoo)
|
||||
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ script.
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- let default_avatar = theme.valine.avatar
|
||||
|
||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js")
|
||||
script(src=url_for(theme.asset.blueimp_md5))
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
@@ -37,7 +37,7 @@ script.
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
- let { avatar,avatarCDN } = theme.waline
|
||||
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
@@ -16,13 +14,6 @@ script.
|
||||
return content
|
||||
}
|
||||
|
||||
const getIcon = (ava,mail) => {
|
||||
if (ava) return ava
|
||||
let defaultIcon = '!{ avatar ? `?d=${avatar}` : ''}'
|
||||
let iconUrl = "!{avatarCDN ? avatarCDN : 'https://gravatar.loli.net/avatar/'}" + mail + defaultIcon
|
||||
return iconUrl
|
||||
}
|
||||
|
||||
const generateHtml = array => {
|
||||
let result = ''
|
||||
|
||||
@@ -36,7 +27,7 @@ script.
|
||||
}
|
||||
|
||||
result += `<div class='content'>
|
||||
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
|
||||
<a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
|
||||
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
|
||||
</div></div>`
|
||||
}
|
||||
@@ -52,17 +43,17 @@ script.
|
||||
|
||||
const getComment = () => {
|
||||
const loadWaline = () => {
|
||||
Waline.Widget.RecentComments({
|
||||
Waline.RecentComments({
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
count: !{theme.newest_comments.limit}
|
||||
}).then(res => {
|
||||
const walineArray = res.comments.map(e => {
|
||||
}).then(({comments}) => {
|
||||
const walineArray = comments.map(e => {
|
||||
return {
|
||||
'content': changeContent(e.comment),
|
||||
'avatar': getIcon(e.QQAvatar,e.mail),
|
||||
'avatar': e.avatar,
|
||||
'nick': e.nick,
|
||||
'url': e.url + '#' + e.objectId,
|
||||
'date': e.updatedAt,
|
||||
'date': e.insertedAt,
|
||||
}
|
||||
})
|
||||
saveToLocal.set('waline-newest-comments', JSON.stringify(walineArray), !{theme.newest_comments.storage}/(60*24))
|
||||
@@ -73,8 +64,8 @@ script.
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') loadWaline()
|
||||
else getScript('!{url_for(theme.CDN.waline)}').then(loadWaline)
|
||||
if (typeof Waline === 'object') loadWaline()
|
||||
else getScript('!{url_for(theme.asset.waline_js)}').then(loadWaline)
|
||||
}
|
||||
|
||||
const newestCommentInit = () => {
|
||||
|
||||
2
layout/includes/third-party/pangu.pug
vendored
2
layout/includes/third-party/pangu.pug
vendored
@@ -2,7 +2,7 @@ script.
|
||||
function panguFn () {
|
||||
if (typeof pangu === 'object') pangu.autoSpacingPage()
|
||||
else {
|
||||
getScript('!{url_for(theme.CDN.pangu)}')
|
||||
getScript('!{url_for(theme.asset.pangu)}')
|
||||
.then(() => {
|
||||
pangu.autoSpacingPage()
|
||||
})
|
||||
|
||||
38
layout/includes/third-party/pjax.pug
vendored
38
layout/includes/third-party/pjax.pug
vendored
@@ -3,20 +3,18 @@ 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',
|
||||
'#config-diff',
|
||||
'#body-wrap',
|
||||
'#rightside-config-hide',
|
||||
'#rightside-config-show',
|
||||
'.js-pjax'
|
||||
]
|
||||
- let pjaxSelectors = ['head > title','#config-diff','#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"]')
|
||||
}
|
||||
- let choose = theme.comments.use
|
||||
if choose
|
||||
if theme.Open_Graph_meta.enable && (choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus'))
|
||||
- pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
|
||||
if choose.includes('Utterances') || choose.includes('Giscus')
|
||||
- pjaxSelectors.unshift('link[rel="canonical"]')
|
||||
|
||||
script(src=url_for(theme.asset.pjax))
|
||||
script.
|
||||
let pjaxSelectors = !{JSON.stringify(pjaxSelectors)}
|
||||
|
||||
var pjax = new Pjax({
|
||||
elements: '!{pjaxExclude}',
|
||||
@@ -29,10 +27,10 @@ script.
|
||||
document.addEventListener('pjax:send', function () {
|
||||
|
||||
// removeEventListener scroll
|
||||
window.removeEventListener('scroll', window.tocScrollFn)
|
||||
window.removeEventListener('scroll', scrollCollect)
|
||||
window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
|
||||
window.scrollCollect && window.removeEventListener('scroll', scrollCollect)
|
||||
|
||||
typeof preloader === 'object' && preloader.initLoading()
|
||||
document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
|
||||
|
||||
if (window.aplayers) {
|
||||
for (let i = 0; i < window.aplayers.length; i++) {
|
||||
@@ -48,6 +46,7 @@ script.
|
||||
const $bodyClassList = document.body.classList
|
||||
$bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')
|
||||
|
||||
typeof disqusjs === 'object' && disqusjs.destroy()
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
@@ -74,15 +73,8 @@ script.
|
||||
|
||||
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
|
||||
|
||||
// Analytics
|
||||
if (!{theme.tencent_analytics ? true : false}) {
|
||||
MtaH5.pgv()
|
||||
}
|
||||
|
||||
// prismjs
|
||||
typeof Prism === 'object' && Prism.highlightAll()
|
||||
|
||||
typeof preloader === 'object' && preloader.endLoading()
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:error', (e) => {
|
||||
|
||||
6
layout/includes/third-party/prismjs.pug
vendored
6
layout/includes/third-party/prismjs.pug
vendored
@@ -1,5 +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))
|
||||
script(src=url_for(theme.asset.prismjs_js))
|
||||
script(src=url_for(theme.asset.prismjs_autoloader))
|
||||
if config.prismjs.line_number
|
||||
script(src=url_for(theme.CDN.prismjs_lineNumber_js))
|
||||
script(src=url_for(theme.asset.prismjs_lineNumber_js))
|
||||
|
||||
27
layout/includes/third-party/search/algolia.pug
vendored
27
layout/includes/third-party/search/algolia.pug
vendored
@@ -1,13 +1,22 @@
|
||||
#algolia-search
|
||||
.search-dialog
|
||||
#algolia-search-title.search-dialog__title Algolia
|
||||
#algolia-input-panel
|
||||
nav.search-nav
|
||||
span.search-dialog-title= _p('search.title')
|
||||
button.search-close-button
|
||||
i.fas.fa-times
|
||||
|
||||
.search-wrap
|
||||
#algolia-search-input
|
||||
hr
|
||||
#algolia-search-results
|
||||
#algolia-hits
|
||||
#algolia-pagination
|
||||
#algolia-stats
|
||||
span.search-close-button
|
||||
i.fas.fa-times
|
||||
hr
|
||||
#algolia-search-results
|
||||
#algolia-hits
|
||||
#algolia-pagination
|
||||
#algolia-info
|
||||
.algolia-stats
|
||||
.algolia-poweredBy
|
||||
|
||||
#search-mask
|
||||
|
||||
script(src=url_for(theme.asset.algolia_search))
|
||||
script(src=url_for(theme.asset.instantsearch))
|
||||
script(src=url_for(theme.asset.algolia_js))
|
||||
27
layout/includes/third-party/search/docsearch.pug
vendored
Normal file
27
layout/includes/third-party/search/docsearch.pug
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
- const { appId, apiKey, indexName, option } = theme.docsearch
|
||||
|
||||
.docsearch-wrap
|
||||
#docsearch(style="display:none")
|
||||
link(rel="stylesheet" href=url_for(theme.asset.docsearch_css))
|
||||
script(src=url_for(theme.asset.docsearch_js))
|
||||
script.
|
||||
(() => {
|
||||
docsearch(Object.assign({
|
||||
appId: '!{appId}',
|
||||
apiKey: '!{apiKey}',
|
||||
indexName: '!{indexName}',
|
||||
container: '#docsearch',
|
||||
}, !{JSON.stringify(option)}))
|
||||
|
||||
|
||||
const searchClickFn = () => {
|
||||
document.querySelector('#search-button > .search').addEventListener('click', () => {
|
||||
document.querySelector('.DocSearch-Button').click()
|
||||
})
|
||||
}
|
||||
|
||||
searchClickFn()
|
||||
window.addEventListener('pjax:complete', searchClickFn)
|
||||
})()
|
||||
|
||||
|
||||
4
layout/includes/third-party/search/index.pug
vendored
4
layout/includes/third-party/search/index.pug
vendored
@@ -1,4 +1,6 @@
|
||||
if theme.algolia_search.enable
|
||||
include ./algolia.pug
|
||||
else if theme.local_search.enable
|
||||
include ./local-search.pug
|
||||
include ./local-search.pug
|
||||
else if theme.docsearch.enable
|
||||
include ./docsearch.pug
|
||||
@@ -1,12 +1,22 @@
|
||||
#local-search
|
||||
.search-dialog
|
||||
#local-search-title.search-dialog__title=_p("local_search.label")
|
||||
#local-input-panel
|
||||
nav.search-nav
|
||||
span.search-dialog-title= _p('search.title')
|
||||
span#loading-status
|
||||
button.search-close-button
|
||||
i.fas.fa-times
|
||||
|
||||
#loading-database.is-center
|
||||
i.fas.fa-spinner.fa-pulse
|
||||
span= ' ' + _p("search.load_data")
|
||||
|
||||
.search-wrap
|
||||
#local-search-input
|
||||
.local-search-box
|
||||
input(placeholder=_p("local_search.input_placeholder") type="text").local-search-box--input
|
||||
hr
|
||||
#local-search-results
|
||||
span.search-close-button
|
||||
i.fas.fa-times
|
||||
#search-mask
|
||||
input(placeholder=_p("search.local_search.input_placeholder") type="text").local-search-box--input
|
||||
hr
|
||||
#local-search-results.no-result
|
||||
#local-search-stats-wrap
|
||||
#search-mask
|
||||
|
||||
script(src=url_for(theme.asset.local_search))
|
||||
@@ -5,6 +5,6 @@
|
||||
a(class="a2a_button_" + name)
|
||||
|
||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||
script(async src=url_for(theme.CDN.addtoany))
|
||||
script(async src='https://static.addtoany.com/menu/page.js')
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.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) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.CDN.sharejs) defer)
|
||||
- const coverVal = page.cover_type === 'img' ? page.cover : theme.avatar.img
|
||||
.social-share(data-image=url_for(coverVal) data-sites= theme.sharejs.sites)
|
||||
link(rel='stylesheet' href=url_for(theme.asset.sharejs_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.asset.sharejs) defer)
|
||||
172
layout/includes/third-party/subtitle.pug
vendored
172
layout/includes/third-party/subtitle.pug
vendored
@@ -1,158 +1,92 @@
|
||||
- let source = theme.subtitle.source
|
||||
- const { effect,source,sub,typed_option } = theme.subtitle
|
||||
- let subContent = sub || new Array()
|
||||
|
||||
script.
|
||||
window.typedJSFn = {
|
||||
init: (str) => {
|
||||
window.typed = new Typed('#subtitle', Object.assign({
|
||||
strings: str,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: true,
|
||||
backSpeed: 50,
|
||||
}, !{JSON.stringify(typed_option)}))
|
||||
},
|
||||
run: (subtitleType) => {
|
||||
if (!{effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case source
|
||||
when 1
|
||||
script.
|
||||
function subtitleType () {
|
||||
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json')
|
||||
.then(response => response.json())
|
||||
.then(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)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
when 2
|
||||
script.
|
||||
function subtitleType () {
|
||||
fetch('https://v1.hitokoto.cn')
|
||||
.then(response => response.json())
|
||||
.then(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,
|
||||
})
|
||||
if (!{effect}) {
|
||||
const from = '出自 ' + data.from
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
sub.unshift(data.hitokoto, from)
|
||||
typedJSFn.init(sub)
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||
}
|
||||
})
|
||||
}
|
||||
typedJSFn.run(subtitleType)
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
when 3
|
||||
when 2
|
||||
script.
|
||||
function subtitleType () {
|
||||
getScript('https://yijuzhan.com/api/word.php?m=js').then(() => {
|
||||
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,
|
||||
})
|
||||
const con = str[0]
|
||||
if (!{effect}) {
|
||||
const from = '出自 ' + str[1]
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
sub.unshift(con, from)
|
||||
typedJSFn.init(sub)
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = con
|
||||
}
|
||||
})
|
||||
}
|
||||
typedJSFn.run(subtitleType)
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
when 4
|
||||
when 3
|
||||
script.
|
||||
function subtitleType () {
|
||||
getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js').then(() => {
|
||||
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,
|
||||
})
|
||||
jinrishici.load(result =>{
|
||||
if (!{effect}) {
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
const content = result.data.content
|
||||
sub.unshift(content)
|
||||
typedJSFn.init(sub)
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = result.data.content
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
typedJSFn.run(subtitleType)
|
||||
|
||||
default
|
||||
- subContent = subContent.length ? subContent : new Array(config.subtitle)
|
||||
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
|
||||
})
|
||||
if (!{effect}) {
|
||||
typedJSFn.init(!{JSON.stringify(subContent)})
|
||||
} else {
|
||||
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||
document.getElementById("subtitle").innerHTML = '!{subContent[0]}'
|
||||
}
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
typedJSFn.run(subtitleType)
|
||||
@@ -1,6 +1,6 @@
|
||||
if theme.aside.card_announcement.enable
|
||||
.card-widget.card-announcement
|
||||
.item-headline
|
||||
i.fas.fa-bullhorn.card-announcement-animation
|
||||
i.fas.fa-bullhorn.fa-shake
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content!= theme.aside.card_announcement.content
|
||||
@@ -6,27 +6,19 @@ if theme.aside.card_author.enable
|
||||
.author-info__name= config.author
|
||||
.author-info__description!= theme.aside.card_author.description || config.description
|
||||
|
||||
.card-info-data
|
||||
if site.posts.length
|
||||
.card-info-data-item.is-center
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length-num= site.posts.length
|
||||
|
||||
if site.tags.length
|
||||
.card-info-data-item.is-center
|
||||
a(href=url_for(config.tag_dir) + '/')
|
||||
.headline= _p('aside.tags')
|
||||
.length-num= site.tags.length
|
||||
|
||||
if site.categories.length
|
||||
.card-info-data-item.is-center
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length-num= site.categories.length
|
||||
.card-info-data.site-data.is-center
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length-num= site.posts.length
|
||||
a(href=url_for(config.tag_dir) + '/')
|
||||
.headline= _p('aside.tags')
|
||||
.length-num= site.tags.length
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length-num= site.categories.length
|
||||
|
||||
if theme.aside.card_author.button.enable
|
||||
a#card-info-btn.button--animated(href=theme.aside.card_author.button.link)
|
||||
a#card-info-btn(href=theme.aside.card_author.button.link)
|
||||
i(class=theme.aside.card_author.button.icon)
|
||||
span=theme.aside.card_author.button.text
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if theme.newest_comments.enable
|
||||
if theme.newest_comments.enable && !['Livere','Facebook Comments','Giscus'].includes(theme.comments.use[0])
|
||||
.card-widget#card-newest-comments
|
||||
.item-headline
|
||||
i.fas.fa-comment-dots
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
- let tocNumber = page.toc_number !== undefined ? page.toc_number : theme.toc.number
|
||||
- let tocExpand = page.toc_expand !== undefined ? page.toc_expand : theme.toc.expand
|
||||
- let tocExpandClass = tocExpand ? 'is-expand' : ''
|
||||
|
||||
#card-toc.card-widget
|
||||
.item-headline
|
||||
i.fas.fa-stream
|
||||
span= _p('aside.card_toc')
|
||||
span.toc-percentage
|
||||
|
||||
if (page.encrypt == true)
|
||||
.toc-content.toc-div-class(style="display:none")!=toc(page.origin, {list_number: tocNumber})
|
||||
.toc-content.toc-div-class(class=tocExpandClass style="display:none")!=toc(page.origin, {list_number: tocNumber})
|
||||
else
|
||||
.toc-content!=toc(page.content, {list_number: tocNumber})
|
||||
.toc-content(class=tocExpandClass)!=toc(page.content, {list_number: tocNumber})
|
||||
|
||||
@@ -14,7 +14,10 @@ if theme.aside.card_recent_post.enable
|
||||
.aside-list-item(class=no_cover)
|
||||
if post_cover && theme.cover.aside_enable
|
||||
a.thumbnail(href=url_for(link) title=title)
|
||||
img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
if article.cover_type === 'img'
|
||||
img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
else
|
||||
div(style=`background: ${post_cover}`)
|
||||
.content
|
||||
a.title(href=url_for(link) title=title)= title
|
||||
if theme.aside.card_recent_post.sort === 'updated'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user