mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9479f8a704 | ||
|
|
793e004a3a | ||
|
|
b3e5b7c30d | ||
|
|
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
|
||||
63
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
63
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
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: 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
|
||||
2
.github/stale.yml
vendored
2
.github/stale.yml
vendored
@@ -10,7 +10,7 @@ exemptLabels:
|
||||
- enhancement
|
||||
- documentation
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
staleLabel: stale
|
||||
# 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
|
||||
|
||||
22
README.md
22
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,7 +79,7 @@ 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)
|
||||
- [x] Multiple Comment System Support
|
||||
- [x] Online Chats (Chatra/Tidio/Daovoice/Gitter/Crisp)
|
||||
- [x] Web analytics
|
||||
@@ -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
|
||||
|
||||

|
||||

|
||||
|
||||
25
README_CN.md
25
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,7 +79,7 @@ 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)
|
||||
- [x] 支持雙評論部署
|
||||
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Gitter/Crisp)
|
||||
- [x] 多種分析系統
|
||||
@@ -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>
|
||||
|
||||
## 📷 截圖
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
258
_config.yml
258
_config.yml
@@ -1,11 +1,7 @@
|
||||
# Main menu navigation (導航目錄)
|
||||
# see https://butterfly.js.org/posts/4aa8abbe/#導航菜單
|
||||
# --------------------------------------
|
||||
|
||||
# format: name: link || icon
|
||||
# sub-menu
|
||||
# name || icon:
|
||||
# name: link || icon
|
||||
|
||||
menu:
|
||||
# Home: / || fas fa-home
|
||||
# Archives: /archives/ || fas fa-archive
|
||||
@@ -17,9 +13,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 (代碼相關)
|
||||
# --------------------------------------
|
||||
|
||||
@@ -46,6 +39,7 @@ social:
|
||||
# fas fa-envelope: mailto:xxxxxx@gmail.com || Email
|
||||
|
||||
# search (搜索)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#搜索系統
|
||||
# --------------------------------------
|
||||
|
||||
# Algolia search
|
||||
@@ -57,6 +51,8 @@ algolia_search:
|
||||
# Local search
|
||||
local_search:
|
||||
enable: false
|
||||
preload: false
|
||||
CDN:
|
||||
|
||||
# Math (數學)
|
||||
# --------------------------------------
|
||||
@@ -155,6 +151,7 @@ post_meta:
|
||||
label: true # true or false 顯示描述性文字
|
||||
|
||||
# wordcount (字數統計)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#字數統計
|
||||
wordcount:
|
||||
enable: false
|
||||
post_wordcount: true
|
||||
@@ -170,18 +167,25 @@ index_post_content:
|
||||
method: 3
|
||||
length: 500 # if you set method to 2 or 3, the length need to config
|
||||
|
||||
# anchor
|
||||
# when you scroll in post, the URL will update according to header id.
|
||||
anchor: false
|
||||
|
||||
# Post
|
||||
# --------------------------------------
|
||||
|
||||
# toc (目錄)
|
||||
toc:
|
||||
enable: true
|
||||
post: true
|
||||
page: false
|
||||
number: true
|
||||
style_simple: false
|
||||
expand: false
|
||||
style_simple: false # for post
|
||||
|
||||
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/
|
||||
|
||||
@@ -220,10 +224,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
|
||||
@@ -259,10 +259,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
|
||||
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 +279,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 +295,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 +302,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 +312,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
|
||||
@@ -364,6 +343,17 @@ twikoo:
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# Giscus
|
||||
# https://giscus.app/
|
||||
giscus:
|
||||
repo:
|
||||
repo_id:
|
||||
category_id:
|
||||
theme:
|
||||
light: light
|
||||
dark: dark
|
||||
option:
|
||||
|
||||
# Chat Services
|
||||
# --------------------------------------
|
||||
|
||||
@@ -424,10 +414,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:
|
||||
@@ -461,9 +447,9 @@ google_adsense:
|
||||
# --------------------------------------
|
||||
|
||||
site_verification:
|
||||
# - name: google_site_verification
|
||||
# - name: google-site-verification
|
||||
# content: xxxxxx
|
||||
# - name: baidu_site_verification
|
||||
# - name: baidu-site-verification
|
||||
# content: xxxxxxx
|
||||
|
||||
# Beautify/Effect (美化/效果)
|
||||
@@ -486,6 +472,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在中間)
|
||||
@@ -580,8 +569,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 (非必要不要修改)
|
||||
@@ -610,18 +599,14 @@ subtitle:
|
||||
effect: true
|
||||
# loop (循環打字)
|
||||
loop: true
|
||||
# source調用第三方服務
|
||||
# source 調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用搏天api的隨機語錄(簡體)
|
||||
# source: 2 調用一言網的一句話(簡體)
|
||||
# source: 3 調用一句網(簡體)
|
||||
# source: 4 調用今日詩詞(簡體)
|
||||
# source: 1 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 2 調用一句網(簡體) http://yijuzhan.com/
|
||||
# source: 3 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
source: false
|
||||
# 如果有英文逗號' , ',請使用轉義字元 ,
|
||||
# 如果有英文雙引號' " ',請使用轉義字元 "
|
||||
# 開頭不允許轉義字元,如需要,請把整個句子用雙引號包住
|
||||
# 如果關閉打字效果,subtitle只會顯示sub的第一行文字
|
||||
# 如果關閉打字效果,subtitle 只會顯示 sub 的第一行文字
|
||||
sub:
|
||||
|
||||
# Loading Animation (加載動畫)
|
||||
@@ -636,6 +621,7 @@ aside:
|
||||
button: true
|
||||
mobile: true # display on mobile
|
||||
position: right # left or right
|
||||
archives: true
|
||||
card_author:
|
||||
enable: true
|
||||
description:
|
||||
@@ -699,9 +685,6 @@ newest_comments:
|
||||
# Bottom right button (右下角按鈕)
|
||||
# --------------------------------------
|
||||
|
||||
# Change font size
|
||||
change_font_size: false
|
||||
|
||||
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
||||
translate:
|
||||
enable: false
|
||||
@@ -730,6 +713,14 @@ darkmode:
|
||||
# autoChangeMode: false
|
||||
autoChangeMode: 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
|
||||
|
||||
# Lightbox (圖片大圖查看模式)
|
||||
# --------------------------------------
|
||||
# You can only choose one, or neither (只能選擇一個 或者 兩個都不選)
|
||||
@@ -750,7 +741,9 @@ fancybox: true
|
||||
mermaid:
|
||||
enable: false
|
||||
# built-in themes: default/forest/dark/neutral
|
||||
theme: default
|
||||
theme:
|
||||
light: default
|
||||
dark: dark
|
||||
|
||||
# Note (Bootstrap Callout)
|
||||
note:
|
||||
@@ -791,7 +784,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 (預加載)
|
||||
@@ -842,87 +835,62 @@ 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
|
||||
|
||||
# pjax
|
||||
pjax: https://cdn.jsdelivr.net/npm/pjax/pjax.min.js
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
# The CDN provider of internal scripts (主題內部 js 的 cdn 配置)
|
||||
# option: local/jsdelivr
|
||||
# Dev version cannot choose jsdelivr (dev版的主題不能設置為 jsdelivr)
|
||||
internal_provider: local
|
||||
# The CDN provider of third party scripts (第三方 js 的 cdn 配置)
|
||||
# option: local/jsdelivr
|
||||
# when set it to local, you need to install hexo-butterfly-extjs
|
||||
third_party_provider: jsdelivr
|
||||
option:
|
||||
# main_css:
|
||||
# main:
|
||||
# utils:
|
||||
# translate:
|
||||
# local_search:
|
||||
# algolia_js:
|
||||
# algolia_search_v4:
|
||||
# instantsearch_v4:
|
||||
# pjax:
|
||||
# gitalk:
|
||||
# gitalk_css:
|
||||
# blueimp_md5:
|
||||
# valine:
|
||||
# disqusjs:
|
||||
# disqusjs_css:
|
||||
# twikoo:
|
||||
# waline_js:
|
||||
# waline_css:
|
||||
# sharejs:
|
||||
# sharejs_css:
|
||||
# mathjax:
|
||||
# katex:
|
||||
# katex_copytex:
|
||||
# katex_copytex_css:
|
||||
# mermaid:
|
||||
# canvas_ribbon:
|
||||
# canvas_fluttering_ribbon:
|
||||
# canvas_nest:
|
||||
# lazyload:
|
||||
# instantpage:
|
||||
# typed:
|
||||
# pangu:
|
||||
# fancybox_css_v4:
|
||||
# fancybox_v4:
|
||||
# medium_zoom:
|
||||
# snackbar_css:
|
||||
# snackbar:
|
||||
# activate_power_mode:
|
||||
# fireworks:
|
||||
# click_heart:
|
||||
# ClickShowText:
|
||||
# fontawesomeV6:
|
||||
# flickr_justified_gallery_js:
|
||||
# flickr_justified_gallery_css:
|
||||
# aplayer_css:
|
||||
# aplayer_js:
|
||||
# meting_js:
|
||||
# prismjs_js:
|
||||
# prismjs_lineNumber_js:
|
||||
# prismjs_autoloader:
|
||||
@@ -34,16 +34,17 @@ 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}"
|
||||
|
||||
pagination:
|
||||
prev: Previous Post
|
||||
@@ -94,8 +95,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 +102,7 @@ rightside:
|
||||
scroll_to_comment: Scroll To Comments
|
||||
setting: Setting
|
||||
aside: Toggle between single-column and double-column
|
||||
chat: Chat
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
@@ -118,6 +118,4 @@ Snackbar:
|
||||
|
||||
loading: Loading...
|
||||
|
||||
error404:
|
||||
error_title: Page not found
|
||||
back_button: Go back home
|
||||
error404: Page not found
|
||||
|
||||
@@ -34,16 +34,17 @@ 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}"
|
||||
|
||||
pagination:
|
||||
prev: Previous Post
|
||||
@@ -94,8 +95,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 +102,7 @@ rightside:
|
||||
scroll_to_comment: Scroll To Comments
|
||||
setting: Setting
|
||||
aside: Toggle between single-column and double-column
|
||||
chat: Chat
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
@@ -118,6 +118,4 @@ Snackbar:
|
||||
|
||||
loading: Loading...
|
||||
|
||||
error404:
|
||||
error_title: Page not found
|
||||
back_button: Go back home
|
||||
error404: Page not found
|
||||
|
||||
@@ -35,16 +35,17 @@ 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}'
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
@@ -95,8 +96,6 @@ share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 阅读模式
|
||||
font_plus_title: 放大字体
|
||||
font_minus_title: 缩小字体
|
||||
translate_title: 简繁转换
|
||||
night_mode_title: 浅色和深色模式转换
|
||||
back_to_top: 回到顶部
|
||||
@@ -104,6 +103,7 @@ rightside:
|
||||
scroll_to_comment: 直达评论
|
||||
setting: 设置
|
||||
aside: 单栏和双栏切换
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
@@ -119,6 +119,4 @@ Snackbar:
|
||||
|
||||
loading: 加载中...
|
||||
|
||||
error404:
|
||||
error_title: 页面没有找到
|
||||
back_button: 回到主页
|
||||
error404: 页面没有找到
|
||||
|
||||
@@ -35,16 +35,17 @@ 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}'
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
@@ -65,7 +66,7 @@ aside:
|
||||
headline: 網站資訊
|
||||
article_name: 文章數目
|
||||
runtime:
|
||||
name: 已運行時間
|
||||
name: 已執行時間
|
||||
unit: 天
|
||||
last_push_date:
|
||||
name: 最後更新時間
|
||||
@@ -80,7 +81,7 @@ aside:
|
||||
zero: 沒有評論
|
||||
image: 圖片
|
||||
link: 連結
|
||||
code: 代碼
|
||||
code: 程式碼
|
||||
card_toc: 目錄
|
||||
|
||||
date_suffix:
|
||||
@@ -95,8 +96,6 @@ share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 閱讀模式
|
||||
font_plus_title: 放大字型
|
||||
font_minus_title: 縮小字型
|
||||
translate_title: 簡繁轉換
|
||||
night_mode_title: 淺色和深色模式轉換
|
||||
back_to_top: 回到頂部
|
||||
@@ -104,6 +103,7 @@ rightside:
|
||||
scroll_to_comment: 直達評論
|
||||
setting: 設定
|
||||
aside: 單欄和雙欄切換
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
@@ -119,6 +119,4 @@ Snackbar:
|
||||
|
||||
loading: 載入中...
|
||||
|
||||
error404:
|
||||
error_title: 頁面沒有找到
|
||||
back_button: 回到主頁
|
||||
error404: 頁面沒有找到
|
||||
|
||||
@@ -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,38 +1,42 @@
|
||||
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_v4))
|
||||
|
||||
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})
|
||||
!= partial("includes/third-party/pangu.pug", {}, { cache: true })
|
||||
|
||||
//- search
|
||||
if theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
script(src=url_for(theme.asset.algolia_search_v4))
|
||||
script(src=url_for(theme.asset.instantsearch_v4))
|
||||
script(src=url_for(theme.asset.algolia_js))
|
||||
else if theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
script(src=url_for(theme.asset.local_search))
|
||||
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache: true})
|
||||
!= partial("includes/loading/loading-js", {}, { 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
|
||||
|
||||
@@ -41,20 +45,20 @@ div
|
||||
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 +66,7 @@ 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='//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
- 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 : ''
|
||||
@@ -16,11 +16,13 @@
|
||||
- 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, maximum-scale=1.0, user-scalable=no")
|
||||
title= tabTitle
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
@@ -46,15 +48,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.fontawesomeV6) 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_v4) media="print" onload="this.media='all'")
|
||||
|
||||
//- google_adsense
|
||||
!=partial('includes/head/google_adsense', {}, {cache: true})
|
||||
|
||||
@@ -16,18 +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}`)
|
||||
|
||||
|
||||
@@ -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,11 @@
|
||||
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,
|
||||
languages: {
|
||||
// search languages
|
||||
hits_empty: _p("local_search.hits_empty")
|
||||
hits_empty: _p("search.local_search.hits_empty"),
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -112,17 +113,12 @@ 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}
|
||||
}
|
||||
|
||||
@@ -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,9 +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")
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -7,7 +7,7 @@ nav#nav
|
||||
#search-button
|
||||
a.site-page.social-icon.search
|
||||
i.fas.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
span=' '+_p('search.title')
|
||||
!=partial('includes/header/menu_item', {}, {cache: true})
|
||||
|
||||
#toggle-menu
|
||||
|
||||
@@ -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,24 @@
|
||||
if block
|
||||
block
|
||||
|
||||
if theme.busuanzi.page_pv
|
||||
- const commentUse = comments.use
|
||||
if commentUse && !comments.lazyload
|
||||
case commentUse[0]
|
||||
when 'Valine'
|
||||
if theme.valine.visitor
|
||||
+pvBlock(url_for(page.path),'leancloud_visitors',page.title)
|
||||
span.leancloud-visitors-count
|
||||
when 'Waline'
|
||||
if theme.waline.pageview
|
||||
+pvBlock('','','')
|
||||
span.waline-pageview-count(data-path=url_for(page.path))
|
||||
when 'Twikoo'
|
||||
if theme.twikoo.visitor
|
||||
+pvBlock('','','')
|
||||
span#twikoo_visitors
|
||||
else 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)
|
||||
+pvBlock(url_for(page.path),'leancloud_visitors',page.title)
|
||||
span.leancloud-visitors-count
|
||||
else if (comments.use.includes('Twikoo') && theme.twikoo.visitor)
|
||||
+pvBlock('','','')
|
||||
span#twikoo_visitors
|
||||
|
||||
if comments.count && !comments.lazyload && page.comments !== false && comments.use
|
||||
- var whichCount = comments.use[0]
|
||||
@@ -96,7 +104,7 @@
|
||||
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))
|
||||
when 'Gitalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
- var htmlClassHideAside = theme.aside.enable && theme.aside.hide ? 'hide-aside' : ''
|
||||
- page.aside = is_archive() ? theme.aside.archives : page.aside
|
||||
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||
- var pageType = is_post() ? 'post' : 'page'
|
||||
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
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)
|
||||
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)
|
||||
.recent-post-info(class=no_cover)
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
@@ -17,14 +22,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 +43,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
|
||||
|
||||
@@ -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,68 @@
|
||||
#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
|
||||
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)
|
||||
})
|
||||
})()
|
||||
|
||||
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>`
|
||||
|
||||
- page.content = result + page.content
|
||||
!= page.content
|
||||
|
||||
|
||||
@@ -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'})
|
||||
@@ -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,60 @@
|
||||
- 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"))
|
||||
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})
|
||||
|
||||
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))
|
||||
@@ -28,7 +28,7 @@ script.
|
||||
if (typeof twikoo === 'object') {
|
||||
runTwikoo()
|
||||
} else {
|
||||
getScript('!{theme.CDN.twikoo}').then(runTwikoo)
|
||||
getScript('!{theme.asset.twikoo}').then(runTwikoo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ script.
|
||||
}
|
||||
|
||||
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)
|
||||
else getScript('!{url_for(theme.asset.waline_js)}').then(initWaline)
|
||||
}
|
||||
|
||||
window.pjax ? loadWaline() : window.addEventListener('load', loadWaline)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
- let disqusjsApi = theme.disqusjs.api || 'https://disqus.skk.moe/disqus/'
|
||||
- let disqusjsPageTitle = page.title.replace(/'/ig,"\\'")
|
||||
|
||||
script.
|
||||
@@ -6,32 +5,28 @@ script.
|
||||
function addDisqusjsCSS () {
|
||||
const ele = document.createElement('link')
|
||||
ele.rel = 'stylesheet'
|
||||
ele.href= '!{url_for(theme.CDN.disqusjs_css)}'
|
||||
ele.href= '!{url_for(theme.asset.disqusjs_css)}'
|
||||
document.getElementsByTagName('head')[0].appendChild(ele)
|
||||
}
|
||||
|
||||
function initDisqusjs () {
|
||||
window.DISQUS = null
|
||||
new DisqusJS({
|
||||
new DisqusJS(Object.assign({
|
||||
shortname: '!{theme.disqusjs.shortname}',
|
||||
siteName: '!{theme.disqusjs.siteName}',
|
||||
identifier: '!{ 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)}))
|
||||
}
|
||||
|
||||
|
||||
window.disqusReset = initDisqusjs
|
||||
|
||||
if (window.disqusJsLoad) initDisqusjs()
|
||||
else {
|
||||
addDisqusjsCSS()
|
||||
getScript('!{url_for(theme.CDN.disqusjs)}').then(initDisqusjs)
|
||||
getScript('!{url_for(theme.asset.disqusjs)}').then(initDisqusjs)
|
||||
window.disqusJsLoad = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ script.
|
||||
if (typeof FB === 'object') FB.XFBML.parse()
|
||||
else {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v10.0')
|
||||
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v13.0&appId=!{theme.facebook_comments.app_id}&autoLogAppEvents=1')
|
||||
ele.setAttribute('async', 'true')
|
||||
ele.setAttribute('defer', 'true')
|
||||
ele.setAttribute('crossorigin', 'anonymous')
|
||||
|
||||
49
layout/includes/third-party/comments/giscus.pug
vendored
Normal file
49
layout/includes/third-party/comments/giscus.pug
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
- const { repo, repo_id, category_id, option } = theme.giscus
|
||||
- const themes = theme.giscus.theme
|
||||
script.
|
||||
function loadGiscus () {
|
||||
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
||||
|
||||
const config = Object.assign({
|
||||
src: 'https://giscus.app/client.js',
|
||||
'data-repo': '!{repo}',
|
||||
'data-repo-id': '!{repo_id}',
|
||||
'data-category-id': '!{category_id}',
|
||||
'data-mapping': 'pathname',
|
||||
'data-theme': nowTheme,
|
||||
'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 () {
|
||||
const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '!{themes.dark}' : '!{themes.light}'
|
||||
|
||||
function sendMessage(message) {
|
||||
const iframe = document.querySelector('iframe.giscus-frame');
|
||||
if (!iframe) return;
|
||||
iframe.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');
|
||||
}
|
||||
|
||||
sendMessage({
|
||||
setConfig: {
|
||||
theme: theme
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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()
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ script.
|
||||
function addGitalkSource () {
|
||||
const ele = document.createElement('link')
|
||||
ele.rel = 'stylesheet'
|
||||
ele.href= '!{url_for(theme.CDN.gitalk_css)}'
|
||||
ele.href= '!{url_for(theme.asset.gitalk_css)}'
|
||||
document.getElementsByTagName('head')[0].appendChild(ele)
|
||||
}
|
||||
|
||||
@@ -15,11 +15,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)}))
|
||||
|
||||
@@ -29,7 +24,7 @@ script.
|
||||
if (typeof Gitalk === 'function') initGitalk()
|
||||
else {
|
||||
addGitalkSource()
|
||||
getScript('!{url_for(theme.CDN.gitalk)}').then(initGitalk)
|
||||
getScript('!{url_for(theme.asset.gitalk)}').then(initGitalk)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ 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
|
||||
|
||||
2
layout/includes/third-party/comments/js.pug
vendored
2
layout/includes/third-party/comments/js.pug
vendored
@@ -16,5 +16,7 @@ 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})
|
||||
|
||||
46
layout/includes/third-party/comments/twikoo.pug
vendored
46
layout/includes/third-party/comments/twikoo.pug
vendored
@@ -1,42 +1,48 @@
|
||||
- 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 = () => {
|
||||
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
|
||||
document.getElementById('twikoo-count').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('!{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}) {
|
||||
|
||||
39
layout/includes/third-party/comments/waline.pug
vendored
39
layout/includes/third-party/comments/waline.pug
vendored
@@ -1,22 +1,35 @@
|
||||
- const { serverURL, option, pageview } = theme.waline
|
||||
- const { lazyload, count, use } = theme.comments
|
||||
|
||||
script.
|
||||
function loadWaline () {
|
||||
function initWaline () {
|
||||
const waline = new Waline(Object.assign({
|
||||
el: '#waline-wrap',
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
avatar: '#{theme.waline.avatar}',
|
||||
path: location.pathname,
|
||||
visitor: #{theme.waline.visitor},
|
||||
dark: 'html[data-theme="dark"]'
|
||||
}, !{JSON.stringify(theme.waline.option)}))
|
||||
function insertCSS () {
|
||||
const link = document.createElement("link")
|
||||
link.rel = "stylesheet"
|
||||
link.href = "!{url_for(theme.asset.waline_css)}"
|
||||
document.head.appendChild(link)
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') initWaline()
|
||||
else getScript('!{url_for(theme.CDN.waline)}').then(initWaline)
|
||||
function initWaline () {
|
||||
const waline = Waline.init(Object.assign({
|
||||
el: '#waline-wrap',
|
||||
serverURL: '!{serverURL}',
|
||||
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 {
|
||||
insertCSS()
|
||||
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
|
||||
|
||||
6
layout/includes/third-party/math/katex.pug
vendored
6
layout/includes/third-party/math/katex.pug
vendored
@@ -1,6 +1,6 @@
|
||||
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=theme.asset.katex)
|
||||
script(src=url_for(theme.asset.katex_copytex))
|
||||
link(rel="stylesheet" type="text/css" href=theme.asset.katex_copytex_css)
|
||||
script.
|
||||
(() => {
|
||||
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
|
||||
|
||||
2
layout/includes/third-party/math/mathjax.pug
vendored
2
layout/includes/third-party/math/mathjax.pug
vendored
@@ -37,7 +37,7 @@ script.
|
||||
}
|
||||
|
||||
const script = document.createElement('script')
|
||||
script.src = '!{theme.CDN.mathjax}'
|
||||
script.src = '!{theme.asset.mathjax}'
|
||||
script.id = 'MathJax-script'
|
||||
script.async = true
|
||||
document.head.appendChild(script)
|
||||
|
||||
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('!{theme.asset.mermaid}').then(runMermaid)
|
||||
}
|
||||
|
||||
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})()
|
||||
@@ -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>`
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ script.
|
||||
if (typeof twikoo === 'object') {
|
||||
runTwikoo()
|
||||
} else {
|
||||
getScript('!{theme.CDN.twikoo}').then(runTwikoo)
|
||||
getScript('!{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))
|
||||
@@ -74,7 +65,7 @@ script.
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') loadWaline()
|
||||
else getScript('!{url_for(theme.CDN.waline)}').then(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()
|
||||
})
|
||||
|
||||
34
layout/includes/third-party/pjax.pug
vendored
34
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 = ['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 && (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,11 @@ 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++) {
|
||||
@@ -74,11 +73,6 @@ script.
|
||||
|
||||
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
|
||||
|
||||
// Analytics
|
||||
if (!{theme.tencent_analytics ? true : false}) {
|
||||
MtaH5.pgv()
|
||||
}
|
||||
|
||||
// prismjs
|
||||
typeof Prism === 'object' && Prism.highlightAll()
|
||||
|
||||
|
||||
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))
|
||||
|
||||
23
layout/includes/third-party/search/algolia.pug
vendored
23
layout/includes/third-party/search/algolia.pug
vendored
@@ -1,13 +1,18 @@
|
||||
#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
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
#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
|
||||
input(placeholder=_p("search.local_search.input_placeholder") type="text").local-search-box--input
|
||||
hr
|
||||
#local-search-results
|
||||
|
||||
#search-mask
|
||||
@@ -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,3 @@
|
||||
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||
link(rel='stylesheet' href=url_for(theme.CDN.sharejs_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.CDN.sharejs) defer)
|
||||
link(rel='stylesheet' href=url_for(theme.asset.sharejs_css) media="print" onload="this.media='all'")
|
||||
script(src=url_for(theme.asset.sharejs) defer)
|
||||
106
layout/includes/third-party/subtitle.pug
vendored
106
layout/includes/third-party/subtitle.pug
vendored
@@ -1,53 +1,22 @@
|
||||
- let source = theme.subtitle.source
|
||||
- const { effect,loop,source,sub } = theme.subtitle
|
||||
- let subContent = sub || new Array()
|
||||
|
||||
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', {
|
||||
if (!{effect}) {
|
||||
const from = '出自 ' + data.from
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
sub.unshift(data.hitokoto, from)
|
||||
window.typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
loop: !{loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
@@ -56,30 +25,30 @@ case source
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (!{effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
getScript('!{url_for(theme.asset.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', {
|
||||
const con = str[0]
|
||||
if (!{effect}) {
|
||||
const from = '出自 ' + str[1]
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
sub.unshift(con, from)
|
||||
window.typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
loop: !{loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
@@ -88,30 +57,30 @@ case source
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (!{effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
getScript('!{url_for(theme.asset.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', {
|
||||
jinrishici.load(result =>{
|
||||
if (!{effect}) {
|
||||
const sub = !{JSON.stringify(subContent)}
|
||||
const content = result.data.content
|
||||
sub.unshift(content)
|
||||
window.typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
loop: !{loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
@@ -121,37 +90,38 @@ case source
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (!{effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
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(","),
|
||||
if (!{effect}) {
|
||||
window.typed = new Typed("#subtitle", {
|
||||
strings: !{JSON.stringify(subContent)},
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
loop: !{loop},
|
||||
backSpeed: 50
|
||||
})
|
||||
} else {
|
||||
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||
document.getElementById("subtitle").innerHTML = '!{subContent[0]}'
|
||||
}
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (!{effect}) {
|
||||
if (typeof Typed === 'function') {
|
||||
subtitleType()
|
||||
} else {
|
||||
getScript('!{url_for(theme.CDN.typed)}').then(subtitleType)
|
||||
getScript('!{url_for(theme.asset.typed)}').then(subtitleType)
|
||||
}
|
||||
} else {
|
||||
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})
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#aside-content.aside-content
|
||||
//- post
|
||||
if is_post()
|
||||
if showToc && theme.toc.style_simple
|
||||
- const tocStyle = page.toc_style_simple
|
||||
- const tocStyleVal = tocStyle === true || tocStyle === false ? tocStyle : theme.toc.style_simple
|
||||
if showToc && tocStyleVal
|
||||
.sticky_layout
|
||||
include ./card_post_toc.pug
|
||||
else
|
||||
!=partial('includes/widget/card_author', {}, {cache: true})
|
||||
!=partial('includes/widget/card_announcement', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
.sticky_layout
|
||||
if showToc
|
||||
include ./card_post_toc.pug
|
||||
@@ -20,6 +22,8 @@
|
||||
!=partial('includes/widget/card_top_self', {}, {cache: true})
|
||||
|
||||
.sticky_layout
|
||||
if showToc
|
||||
include ./card_post_toc.pug
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache: true})
|
||||
!=partial('includes/widget/card_ad', {}, {cache: true})
|
||||
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
|
||||
|
||||
@@ -2,6 +2,9 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
#page
|
||||
if top_img === false
|
||||
h1.page-title= page.title
|
||||
|
||||
case page.type
|
||||
when 'tags'
|
||||
include includes/page/tags.pug
|
||||
|
||||
@@ -14,7 +14,7 @@ block content
|
||||
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
||||
include includes/third-party/share/index.pug
|
||||
|
||||
if theme.reward.enable
|
||||
if theme.reward.enable && theme.reward.QR_code
|
||||
!=partial('includes/post/reward', {}, {cache: true})
|
||||
|
||||
//- ad
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "3.8.1",
|
||||
"version": "4.2.1",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -20,13 +20,13 @@
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jerryc127/hexo-theme-butterfly/issues",
|
||||
"email": "btf@immyw.com"
|
||||
"email": "my@crazywong.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo-renderer-stylus": "^2.0.1",
|
||||
"hexo-renderer-pug": "^2.0.0"
|
||||
"hexo-renderer-pug": "^3.0.0"
|
||||
},
|
||||
"homepage": "https://butterfly.js.org/",
|
||||
"author": "Jerry <i@immyw.com>",
|
||||
"author": "Jerry <my@crazywong.com>",
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
|
||||
133
scripts/events/config.js
Normal file
133
scripts/events/config.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* 1. Merge CDN
|
||||
* 2. Capitalize the first letter of comment name
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const { version } = require('../../package.json')
|
||||
const path = require('path')
|
||||
|
||||
hexo.extend.filter.register('before_generate', () => {
|
||||
const themeConfig = hexo.theme.config
|
||||
const { CDN, comments } = themeConfig
|
||||
|
||||
/**
|
||||
* Merge CDN
|
||||
*/
|
||||
|
||||
const internalSrcCDN = {
|
||||
main_css: '/css/index.css',
|
||||
main: `https://cdn.jsdelivr.net/npm/hexo-theme-butterfly@${version}/source/js/main.min.js`,
|
||||
utils: `https://cdn.jsdelivr.net/npm/hexo-theme-butterfly@${version}/source/js/utils.min.js`,
|
||||
translate: `https://cdn.jsdelivr.net/npm/hexo-theme-butterfly@${version}/source/js/tw_cn.min.js`,
|
||||
local_search: `https://cdn.jsdelivr.net/npm/hexo-theme-butterfly@${version}/source/js/search/local-search.min.js`,
|
||||
algolia_js: `https://cdn.jsdelivr.net/npm/hexo-theme-butterfly@${version}/source/js/search/algolia.min.js`,
|
||||
}
|
||||
|
||||
const internalSrcLocal = {
|
||||
main_css: '/css/index.css',
|
||||
main: '/js/main.js',
|
||||
utils: '/js/utils.js',
|
||||
translate: '/js/tw_cn.js',
|
||||
local_search: '/js/search/local-search.js',
|
||||
algolia_js: '/js/search/algolia.js',
|
||||
}
|
||||
|
||||
const thirdPartySrcCDN = {
|
||||
algolia_search_v4: 'https://cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js',
|
||||
instantsearch_v4: 'https://cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js',
|
||||
pjax: 'https://cdn.jsdelivr.net/npm/pjax/pjax.min.js',
|
||||
gitalk: 'https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js',
|
||||
gitalk_css: 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css',
|
||||
blueimp_md5: 'https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js',
|
||||
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',
|
||||
twikoo: 'https://cdn.jsdelivr.net/npm/twikoo@1/dist/twikoo.all.min.js',
|
||||
waline_js: 'https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.js',
|
||||
waline_css: 'https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css',
|
||||
sharejs: 'https://cdn.jsdelivr.net/gh/overtrue/share.js@master/dist/js/social-share.min.js',
|
||||
sharejs_css: 'https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css',
|
||||
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',
|
||||
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',
|
||||
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',
|
||||
lazyload: 'https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js',
|
||||
instantpage: 'https://cdn.jsdelivr.net/npm/instant.page@5/instantpage.min.js',
|
||||
typed: 'https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js',
|
||||
pangu: 'https://cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js',
|
||||
fancybox_css_v4: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css',
|
||||
fancybox_v4: 'https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js',
|
||||
medium_zoom: 'https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js',
|
||||
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',
|
||||
fontawesomeV6: 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css',
|
||||
flickr_justified_gallery_js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
|
||||
flickr_justified_gallery_css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css',
|
||||
aplayer_css: 'https://cdn.jsdelivr.net/npm/aplayer@1/dist/APlayer.min.css',
|
||||
aplayer_js: 'https://cdn.jsdelivr.net/npm/aplayer@1/dist/APlayer.min.js',
|
||||
meting_js: 'https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js',
|
||||
prismjs_js: 'https://cdn.jsdelivr.net/npm/prismjs@1/prism.min.js',
|
||||
prismjs_lineNumber_js: 'https://cdn.jsdelivr.net/npm/prismjs@1/plugins/line-numbers/prism-line-numbers.min.js',
|
||||
prismjs_autoloader: 'https://cdn.jsdelivr.net/npm/prismjs@1/plugins/autoloader/prism-autoloader.min.js',
|
||||
}
|
||||
|
||||
// delete null value
|
||||
const deleteNullValue = obj => {
|
||||
if (!obj) return
|
||||
for (const i in obj) {
|
||||
obj[i] === null && delete obj[i]
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
const defaultVal = (obj, choose) => {
|
||||
if (obj === 'internal') {
|
||||
if (choose === 'local') return internalSrcLocal
|
||||
else return internalSrcCDN
|
||||
}
|
||||
|
||||
if (obj === 'external') {
|
||||
if (choose === 'local') {
|
||||
let result = {}
|
||||
try {
|
||||
const data = path.join(hexo.plugin_dir,'hexo-butterfly-extjs/plugins.yml')
|
||||
result = hexo.render.renderSync({ path: data, engine: 'yaml'})
|
||||
Object.keys(result).map(key => {
|
||||
result[key] = '/pluginsSrc/' + result[key]
|
||||
})
|
||||
} catch (e) {}
|
||||
return result
|
||||
} else return thirdPartySrcCDN
|
||||
}
|
||||
}
|
||||
|
||||
themeConfig.asset = Object.assign(defaultVal('internal', CDN.internal_provider),
|
||||
defaultVal('external', CDN.third_party_provider), deleteNullValue(CDN.option))
|
||||
|
||||
/**
|
||||
* Capitalize the first letter of comment name
|
||||
*/
|
||||
|
||||
let { use } = comments
|
||||
|
||||
if (!use) return
|
||||
|
||||
if (typeof use === 'string') {
|
||||
use = use.split(',')
|
||||
}
|
||||
|
||||
const newArray = use.map(item => item.toLowerCase().replace(/\b[a-z]/g, s => s.toUpperCase()))
|
||||
|
||||
themeConfig.comments.use = newArray
|
||||
})
|
||||
@@ -4,9 +4,9 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
// Get first two digits of the Hexo version number
|
||||
const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
|
||||
|
||||
if (hexoVer < 5) {
|
||||
logger.error('Please update Hexo to V5.0.0 or higher!')
|
||||
logger.error('請把 Hexo 升級到 V5.0.0 或更高的版本!')
|
||||
if (hexoVer < 5.3) {
|
||||
logger.error('Please update Hexo to V5.3.0 or higher!')
|
||||
logger.error('請把 Hexo 升級到 V5.3.0 或更高的版本!')
|
||||
process.exit(-1)
|
||||
}
|
||||
|
||||
@@ -18,10 +18,4 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
process.exit(-1)
|
||||
}
|
||||
}
|
||||
|
||||
// let stylus to get the hexo highlight config
|
||||
const themeConfig = hexo.theme.config
|
||||
const hexoConfig = hexo.config
|
||||
themeConfig.highlight_settings = hexoConfig.highlight
|
||||
themeConfig.prismjs_settings = hexoConfig.prismjs
|
||||
})
|
||||
|
||||
15
scripts/events/stylus.js
Normal file
15
scripts/events/stylus.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* stylus
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.filter.register('stylus:renderer', function (style) {
|
||||
const { highlight, prismjs } = hexo.config
|
||||
style
|
||||
.define('$highlight_enable', highlight && highlight.enable)
|
||||
.define('$highlight_line_number', highlight && highlight.line_number)
|
||||
.define('$prismjs_enable', prismjs && prismjs.enable)
|
||||
.define('$prismjs_line_number', prismjs && prismjs.line_number)
|
||||
// .import(this.source_dir.replace(/\\/g, '/') + '_data/css/*')
|
||||
})
|
||||
@@ -12,6 +12,6 @@ hexo.on('ready', () => {
|
||||
# # # # # # # # # # # #
|
||||
##### #### # # ###### # # # ###### #
|
||||
|
||||
${version}
|
||||
${version}
|
||||
===================================================================`)
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
function lazyload (htmlContent) {
|
||||
const bg = hexo.theme.config.lazyload.placeholder ? urlFor(hexo.theme.config.lazyload.placeholder) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
||||
const bg = hexo.theme.config.lazyload.placeholder ? urlFor(hexo.theme.config.lazyload.placeholder) : 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
||||
return htmlContent.replace(/(<img.*? src=)/ig, `$1 "${bg}" data-lazy-src=`)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ function randomCover () {
|
||||
return cover
|
||||
}
|
||||
} else {
|
||||
cover = theme.default_top_img || 'https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg'
|
||||
cover = theme.default_top_img || 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
||||
return cover
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
'use strict'
|
||||
|
||||
hexo.extend.helper.register('inject_head_js', function () {
|
||||
const { darkmode, aside, change_font_size, index_img, disable_top_img, pjax} = this.theme
|
||||
const { darkmode, aside } = this.theme
|
||||
|
||||
const { theme_color } = hexo.theme.config
|
||||
const themeColorLight = theme_color && theme_color.enable && theme_color.meta_theme_color_light || '#ffffff'
|
||||
const themeColorDark = theme_color && theme_color.enable && theme_color.meta_theme_color_dark || '#0d0d0d'
|
||||
|
||||
const localStore = `
|
||||
win.saveToLocal = {
|
||||
@@ -62,13 +66,13 @@ hexo.extend.helper.register('inject_head_js', function () {
|
||||
win.activateDarkMode = function () {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '${themeColorDark}')
|
||||
}
|
||||
}
|
||||
win.activateLightMode = function () {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '${themeColorLight}')
|
||||
}
|
||||
}
|
||||
const t = saveToLocal.get('theme')
|
||||
@@ -131,31 +135,14 @@ hexo.extend.helper.register('inject_head_js', function () {
|
||||
`
|
||||
}
|
||||
|
||||
let changFontAside = ''
|
||||
if (change_font_size) {
|
||||
changFontAside = `
|
||||
const fontSizeVal = saveToLocal.get('global-font-size')
|
||||
if (fontSizeVal !== undefined) {
|
||||
document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
let detectApple = ''
|
||||
if (!disable_top_img || index_img !== false) {
|
||||
detectApple = `
|
||||
const detectApple = `
|
||||
const detectApple = () => {
|
||||
if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
`
|
||||
|
||||
if (pjax.enable) {
|
||||
detectApple += 'document.addEventListener(\'pjax:complete\', detectApple)'
|
||||
}
|
||||
}
|
||||
|
||||
return `<script>(win=>{${localStore + getScript + darkmodeJs + asideStatus + changFontAside + detectApple}})(window)</script>`
|
||||
return `<script>(win=>{${localStore + getScript + darkmodeJs + asideStatus + detectApple}})(window)</script>`
|
||||
})
|
||||
|
||||
@@ -46,11 +46,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
|
||||
if (relatedPosts.length > 0) {
|
||||
result += '<div class="relatedPosts">'
|
||||
result +=
|
||||
'<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>' +
|
||||
' ' +
|
||||
headlineLang +
|
||||
'</span></div>'
|
||||
result += `<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>${headlineLang}</span></div>`
|
||||
result += '<div class="relatedPosts-list">'
|
||||
|
||||
for (let i = 0; i < Math.min(relatedPosts.length, limitNum); i++) {
|
||||
@@ -58,32 +54,15 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
relatedPosts[i].cover === false
|
||||
? relatedPosts[i].randomcover
|
||||
: relatedPosts[i].cover
|
||||
result +=
|
||||
'<div><a href="' +
|
||||
hexoConfig.root +
|
||||
relatedPosts[i].path +
|
||||
'" title="' +
|
||||
relatedPosts[i].title +
|
||||
'">'
|
||||
result +=
|
||||
'<img class="cover" src="' +
|
||||
this.url_for(cover) +
|
||||
'" alt="cover">'
|
||||
const title = this.escape_html(relatedPosts[i].title)
|
||||
result += `<div><a href="${this.url_for(relatedPosts[i].path)}" title="${title}">`
|
||||
result += `<img class="cover" src="${this.url_for(cover)}" alt="cover">`
|
||||
if (dateType === 'created') {
|
||||
result +=
|
||||
'<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i>' +
|
||||
' ' +
|
||||
this.date(relatedPosts[i].created, hexoConfig.date_format) +
|
||||
'</div>'
|
||||
result += `<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> ${this.date(relatedPosts[i].created, hexoConfig.date_format)}</div>`
|
||||
} else {
|
||||
result +=
|
||||
'<div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i>' +
|
||||
' ' +
|
||||
this.date(relatedPosts[i].updated, hexoConfig.date_format) +
|
||||
'</div>'
|
||||
result += `<div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> ${this.date(relatedPosts[i].updated, hexoConfig.date_format)}</div>`
|
||||
}
|
||||
result +=
|
||||
'<div class="title">' + relatedPosts[i].title + '</div>'
|
||||
result += `<div class="title">${title}</div>`
|
||||
result += '</div></a></div>'
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function btn (args) {
|
||||
icon = icon.trim()
|
||||
option = option.trim()
|
||||
|
||||
return `<a class="btn-beautify button--animated ${option}" href="${urlFor(url)}"
|
||||
return `<a class="btn-beautify ${option}" href="${urlFor(url)}"
|
||||
title="${text}">${icon.length ? `<i class="${icon}"></i>` : ''}${text.length ? `<span>${text}</span>` : ''}</a>`
|
||||
}
|
||||
|
||||
|
||||
39
scripts/tag/flink.js
Normal file
39
scripts/tag/flink.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* flink
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
const flinkFn = (args, content) => {
|
||||
content = hexo.render.renderSync({ text: content, engine: 'yaml' })
|
||||
|
||||
let result = ''
|
||||
|
||||
content.forEach(i => {
|
||||
const className = i.class_name ? `<div class="flink-name">${i.class_name}</div>` : ''
|
||||
const classDesc = i.class_desc ? `<div class="flink-desc">${i.class_desc}</div>` : ''
|
||||
|
||||
let listResult = ''
|
||||
|
||||
i.link_list.forEach(j => {
|
||||
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="${urlFor(hexo.theme.config.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>`
|
||||
})
|
||||
|
||||
return `<div class="flink">${result}</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('flink', flinkFn, { ends: true })
|
||||
@@ -8,7 +8,7 @@
|
||||
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
function gallery (args, content) {
|
||||
return `<div class="justified-gallery">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
||||
return `<div class="fj-gallery">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
||||
</div>`
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ function galleryGroup (args) {
|
||||
|
||||
return `
|
||||
<figure class="gallery-group">
|
||||
<img class="gallery-group-img" src='${img}' alt="Group Image Gallery">
|
||||
<img class="gallery-group-img no-lightbox" src='${img}' alt="Group Image Gallery">
|
||||
<figcaption>
|
||||
<div class="gallery-group-name">${name}</div>
|
||||
<p>${desrc}</p>
|
||||
|
||||
@@ -28,7 +28,7 @@ function hideInline (args) {
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<span class="hide-inline"><button type="button" class="hide-button button--animated" ${group}>${display}
|
||||
return `<span class="hide-inline"><button type="button" class="hide-button" ${group}>${display}
|
||||
</button><span class="hide-content">${content}</span></span>`
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ function hideBlock (args, content) {
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<div class="hide-block"><button type="button" class="hide-button button--animated" ${group}>${display}
|
||||
return `<div class="hide-block"><button type="button" class="hide-button" ${group}>${display}
|
||||
</button><div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></div>`
|
||||
}
|
||||
|
||||
@@ -62,8 +62,7 @@ function hideToggle (args, content) {
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<div class="hide-toggle" ${border}><div class="hide-button toggle-title" ${group}><i class="fas fa-caret-right fa-fw"></i><span>${display}</span></div>
|
||||
<div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></div>`
|
||||
return `<details class="toggle" ${border}><summary class="toggle-button" ${group}>${display}</summary><div class="toggle-content">${hexo.render.renderSync({ text: content, engine: 'markdown' })}</div></details>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('hideInline', hideInline)
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
const { escapeHTML } = require('hexo-util')
|
||||
|
||||
function mermaid (args, content) {
|
||||
return `<div class="mermaid">${escapeHTML(content)}</div>`
|
||||
return `<div class="mermaid-wrap"><pre class="mermaid-src" hidden>
|
||||
${escapeHTML(content)}
|
||||
</pre></div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
||||
|
||||
41
scripts/tag/timeline.js
Normal file
41
scripts/tag/timeline.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* timeline
|
||||
* by Jerry
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
function timeLineFn (args, content) {
|
||||
const tlBlock = /<!--\s*timeline (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtimeline\s*-->/g
|
||||
|
||||
let result = ''
|
||||
let color = ''
|
||||
if (args.length) {
|
||||
args = args.join(' ').split(',')
|
||||
color = args[1]
|
||||
const mdContent = hexo.render.renderSync({ text: args[0], engine: 'markdown' })
|
||||
result += `<div class='timeline-item headline'><div class='timeline-item-title'><div class='item-circle'>${mdContent}</div></div></div>`
|
||||
}
|
||||
|
||||
const matches = []
|
||||
let match
|
||||
|
||||
while ((match = tlBlock.exec(content)) !== null) {
|
||||
matches.push(match[1])
|
||||
matches.push(match[2])
|
||||
}
|
||||
|
||||
for (let i = 0; i < matches.length; i += 2) {
|
||||
const tlChildTitle = hexo.render.renderSync({ text: matches[i], engine: 'markdown' })
|
||||
const tlChildContent = hexo.render.renderSync({ text: matches[i + 1], engine: 'markdown' })
|
||||
|
||||
const tlTitleHtml = `<div class='timeline-item-title'><div class='item-circle'>${tlChildTitle}</div></div>`
|
||||
const tlContentHtml = `<div class='timeline-item-content'>${tlChildContent}</div>`
|
||||
|
||||
result += `<div class='timeline-item'>${tlTitleHtml + tlContentHtml}</div>`
|
||||
}
|
||||
|
||||
return `<div class="timeline ${color}">${result}</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('timeline', timeLineFn, { ends: true })
|
||||
@@ -11,12 +11,67 @@
|
||||
.fontawesomeIcon
|
||||
display: inline-block
|
||||
font-weight: 600
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
font-family: 'Font Awesome 5 Free'
|
||||
font-family: 'Font Awesome 6 Free'
|
||||
text-rendering: auto
|
||||
-webkit-font-smoothing: antialiased
|
||||
|
||||
// card hover
|
||||
.cardHover
|
||||
border-radius: 8px
|
||||
background: var(--card-bg)
|
||||
box-shadow: var(--card-box-shadow)
|
||||
transition: all .3s
|
||||
|
||||
&:hover
|
||||
box-shadow: var(--card-hover-box-shadow)
|
||||
|
||||
.imgHover
|
||||
width: 100%
|
||||
height: 100%
|
||||
transition: filter 375ms ease-in .2s, transform .6s
|
||||
object-fit: cover
|
||||
|
||||
&:hover
|
||||
transform: scale(1.1)
|
||||
|
||||
.postImgHover
|
||||
&:hover
|
||||
img
|
||||
opacity: .8
|
||||
transform: scale(1.1)
|
||||
|
||||
img
|
||||
position: absolute
|
||||
width: 100%
|
||||
height: 100%
|
||||
opacity: .4
|
||||
transition: all .6s, filter 375ms ease-in .2s
|
||||
object-fit: cover
|
||||
|
||||
.list-beauty
|
||||
list-style: none
|
||||
|
||||
li
|
||||
position: relative
|
||||
padding: .12em .4em .12em 1.4em
|
||||
|
||||
&:hover
|
||||
&:before
|
||||
border-color: var(--pseudo-hover)
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: .67em
|
||||
left: 0
|
||||
width: w = .43em
|
||||
height: h = w
|
||||
border: .5 * w solid $light-blue
|
||||
border-radius: w
|
||||
background: transparent
|
||||
content: ''
|
||||
cursor: pointer
|
||||
transition: all .3s ease-out
|
||||
|
||||
maxWidth600()
|
||||
@media screen and (max-width: 600px)
|
||||
{block}
|
||||
@@ -60,7 +115,7 @@ if hexo-config('enter_transitions')
|
||||
|
||||
#site-title,
|
||||
#site-subtitle
|
||||
animation: titlescale 1s
|
||||
animation: titleScale 1s
|
||||
|
||||
#nav.show
|
||||
animation: headerNoOpacity 1s
|
||||
@@ -78,10 +133,6 @@ if hexo-config('enter_transitions')
|
||||
> :nth-child({i})
|
||||
animation: sidebarItem (i / 5)s
|
||||
|
||||
.card-announcement-animation
|
||||
color: #FF0000
|
||||
animation: announ_animation .8s linear infinite
|
||||
|
||||
.scroll-down-effects
|
||||
animation: scroll-down-effect 1.5s infinite
|
||||
|
||||
@@ -123,14 +174,14 @@ if hexo-config('avatar.effect') == true
|
||||
|
||||
@keyframes bottom-top
|
||||
0%
|
||||
opacity: 0
|
||||
margin-top: 50px
|
||||
opacity: 0
|
||||
|
||||
100%
|
||||
opacity: 1
|
||||
margin-top: 0
|
||||
opacity: 1
|
||||
|
||||
@keyframes titlescale
|
||||
@keyframes titleScale
|
||||
0%
|
||||
opacity: 0
|
||||
transform: scale(.7)
|
||||
@@ -194,17 +245,9 @@ if hexo-config('avatar.effect') == true
|
||||
opacity: 1
|
||||
transform: translateY(0)
|
||||
|
||||
@keyframes announ_animation
|
||||
0%,
|
||||
to
|
||||
transform: scale(1)
|
||||
|
||||
50%
|
||||
transform: scale(1.2)
|
||||
|
||||
@keyframes sidebarItem
|
||||
0%
|
||||
transform: translateX(200px)
|
||||
|
||||
100%
|
||||
transform: translateX(0)
|
||||
transform: translateX(0)
|
||||
@@ -21,18 +21,18 @@
|
||||
--btn-bg: $button-bg
|
||||
--text-bg-hover: rgba($text-bg-hover, .7)
|
||||
--light-grey: $light-grey
|
||||
--dark-grey: $dark-grey
|
||||
--white: $white
|
||||
--text-highlight-color: $text-highlight-color
|
||||
--blockquote-color: $blockquote-color
|
||||
--blockquote-bg: $blockquote-background-color
|
||||
--reward-pop: $reward-pop-up-bg
|
||||
--toc-link-color: $toc-link-color
|
||||
--card-box-shadow: 0 3px 8px 6px rgba(7, 17, 27, .06)
|
||||
--card-hover-box-shadow: 0 3px 8px 6px rgba(7, 17, 27, .15)
|
||||
|
||||
html
|
||||
height: 100%
|
||||
font-size: 20px
|
||||
--card-box-shadow: 0 3px 8px 6px rgba(7, 17, 27, .05)
|
||||
--card-hover-box-shadow: 0 3px 8px 6px rgba(7, 17, 27, .09)
|
||||
--pseudo-hover: $pseudo-hover
|
||||
--headline-presudo: #a0a0a0
|
||||
--scrollbar-color: $scrollbar-color
|
||||
|
||||
body
|
||||
position: relative
|
||||
@@ -47,16 +47,22 @@ body
|
||||
if !hexo-config('copy.enable')
|
||||
user-select: none
|
||||
|
||||
// scrollbar - chrome/safari
|
||||
*::-webkit-scrollbar
|
||||
width: 8px
|
||||
height: 8px
|
||||
|
||||
*::-webkit-scrollbar-thumb
|
||||
background: var(--btn-bg)
|
||||
background: var(--scrollbar-color)
|
||||
|
||||
*::-webkit-scrollbar-track
|
||||
background-color: transparent
|
||||
|
||||
// scrollbar - firefox
|
||||
*
|
||||
scrollbar-width: thin
|
||||
scrollbar-color: var(--scrollbar-color) transparent
|
||||
|
||||
input::placeholder
|
||||
color: var(--font-color)
|
||||
|
||||
@@ -79,7 +85,7 @@ h4,
|
||||
h5,
|
||||
h6
|
||||
position: relative
|
||||
margin: 1rem 0 .7rem
|
||||
margin: 20px 0 14px
|
||||
color: var(--text-highlight-color)
|
||||
font-weight: bold
|
||||
|
||||
@@ -91,7 +97,7 @@ h6
|
||||
|
||||
hr
|
||||
position: relative
|
||||
margin: 2rem auto
|
||||
margin: 40px auto
|
||||
border: 2px dashed var(--hr-border)
|
||||
|
||||
if hexo-config('hr_icon.enable')
|
||||
@@ -115,7 +121,7 @@ hr
|
||||
|
||||
.table-wrap
|
||||
overflow-x: scroll
|
||||
margin: 0 0 1rem
|
||||
margin: 0 0 20px
|
||||
|
||||
table
|
||||
display: table
|
||||
@@ -129,7 +135,7 @@ table
|
||||
|
||||
th,
|
||||
td
|
||||
padding: .3rem .6rem
|
||||
padding: 6px 12px
|
||||
border: 1px solid var(--light-grey)
|
||||
vertical-align: middle
|
||||
|
||||
@@ -143,6 +149,7 @@ button
|
||||
border: none
|
||||
background: none
|
||||
cursor: pointer
|
||||
touch-action: manipulation
|
||||
|
||||
a
|
||||
color: $a-link-color
|
||||
@@ -175,33 +182,7 @@ if $site-name-font
|
||||
.pull-right
|
||||
float: right
|
||||
|
||||
.button--animated
|
||||
position: relative
|
||||
z-index: 1
|
||||
transition: color 1s
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
z-index: -1
|
||||
background: var(--btn-hover-color)
|
||||
content: ''
|
||||
transition: transform .5s ease-out
|
||||
transform: scaleX(0)
|
||||
transform-origin: 0 50%
|
||||
|
||||
&:hover
|
||||
&:before
|
||||
transition-timing-function: cubic-bezier(.45, 1.64, .47, .66)
|
||||
transform: scaleX(1)
|
||||
|
||||
img
|
||||
max-width: 100%
|
||||
transition: all .2s
|
||||
|
||||
&[src=''],
|
||||
&:not([src])
|
||||
opacity: 0
|
||||
@@ -210,14 +191,30 @@ img
|
||||
if hexo-config('lazyload.enable') && hexo-config('lazyload.blur') && !hexo-config('lazyload.placeholder')
|
||||
img
|
||||
&[data-lazy-src]:not(.loaded)
|
||||
filter: blur(10px) brightness(1)
|
||||
filter: blur(8px) brightness(1)
|
||||
|
||||
&[data-lazy-src].error
|
||||
filter: none
|
||||
|
||||
.img-alt
|
||||
margin: -.5rem 0 .5rem
|
||||
margin: -10px 0 10px
|
||||
color: #858585
|
||||
|
||||
&:hover
|
||||
text-decoration: none !important
|
||||
text-decoration: none !important
|
||||
|
||||
blockquote
|
||||
margin: 0 0 20px
|
||||
padding: 12px 15px
|
||||
border-left: 3px solid $blockquote-padding-color
|
||||
background-color: var(--blockquote-bg)
|
||||
color: var(--blockquote-color)
|
||||
|
||||
footer
|
||||
cite
|
||||
&:before
|
||||
padding: 0 5px
|
||||
content: '—'
|
||||
|
||||
& > :last-child
|
||||
margin-bottom: 0 !important
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
$highlight_theme = hexo-config('highlight_theme')
|
||||
$highlighEnable = hexo-config('highlight_settings') && hexo-config('highlight_settings.enable')
|
||||
$prismjsEnable = hexo-config('prismjs_settings') && hexo-config('prismjs_settings.enable')
|
||||
wordWrap = !hexo-config('highlight_settings.line_number') && hexo-config('code_word_wrap')
|
||||
wordWrap = $highlight_enable && !$highlight_line_number && hexo-config('code_word_wrap')
|
||||
|
||||
@require 'theme'
|
||||
|
||||
@@ -15,15 +13,15 @@ wordWrap = !hexo-config('highlight_settings.line_number') && hexo-config('code_w
|
||||
--hlscrollbar-bg: $highlight-scrollbar
|
||||
--hlexpand-bg: linear-gradient(180deg, rgba($highlight-background, .6), rgba($highlight-background, .9))
|
||||
|
||||
if $highlighEnable
|
||||
if $highlight_enable
|
||||
@require 'highlight/index'
|
||||
|
||||
if $prismjsEnable
|
||||
if $prismjs_enable
|
||||
@require 'prismjs/index'
|
||||
|
||||
$code-block
|
||||
overflow: auto
|
||||
margin: 0 0 1rem
|
||||
margin: 0 0 20px
|
||||
padding: 0
|
||||
background: var(--hl-bg)
|
||||
color: var(--hl-color)
|
||||
@@ -33,28 +31,6 @@ $code-block
|
||||
counter-reset: line
|
||||
white-space: pre-wrap
|
||||
|
||||
blockquote
|
||||
margin: 0 0 1rem
|
||||
padding: .1rem .8rem
|
||||
border-left: .2rem solid $blockquote-padding-color
|
||||
background-color: var(--blockquote-bg)
|
||||
color: var(--blockquote-color)
|
||||
|
||||
a
|
||||
word-break: break-all
|
||||
|
||||
p
|
||||
margin: 0 !important
|
||||
padding: .5rem 0
|
||||
|
||||
footer
|
||||
padding: 0 0 .5rem
|
||||
|
||||
cite
|
||||
&:before
|
||||
padding: 0 .3em
|
||||
content: '—'
|
||||
|
||||
#article-container
|
||||
pre,
|
||||
code
|
||||
@@ -62,7 +38,7 @@ blockquote
|
||||
font-family: $code-font-family !important
|
||||
|
||||
code
|
||||
padding: .1rem .2rem
|
||||
padding: 2px 4px
|
||||
background: $code-background
|
||||
color: $code-foreground
|
||||
|
||||
@@ -87,7 +63,7 @@ blockquote
|
||||
|
||||
figcaption,
|
||||
.caption
|
||||
padding: .3rem 0 .1rem .7rem
|
||||
padding: 6px 0 2px 14px
|
||||
font-size: $code-font-size
|
||||
line-height: 1em
|
||||
|
||||
@@ -104,7 +80,7 @@ blockquote
|
||||
display: flex
|
||||
align-items: center
|
||||
overflow: hidden
|
||||
min-height: 1.2rem
|
||||
min-height: 24px
|
||||
height: 2.15em
|
||||
background: var(--hltools-bg)
|
||||
color: var(--hltools-color)
|
||||
@@ -115,12 +91,12 @@ blockquote
|
||||
|
||||
.expand
|
||||
position: absolute
|
||||
padding: .4rem .7rem
|
||||
padding: .57em .7em
|
||||
cursor: pointer
|
||||
transition: transform .3s
|
||||
|
||||
& + .code-lang
|
||||
left: 1.7rem
|
||||
left: 1.7em
|
||||
|
||||
&.closed
|
||||
transition: all .3s
|
||||
@@ -128,7 +104,7 @@ blockquote
|
||||
|
||||
.code-lang
|
||||
position: absolute
|
||||
left: .7rem
|
||||
left: 14px
|
||||
text-transform: uppercase
|
||||
font-weight: bold
|
||||
font-size: 1.15em
|
||||
@@ -136,13 +112,13 @@ blockquote
|
||||
|
||||
.copy-notice
|
||||
position: absolute
|
||||
right: 1.7rem
|
||||
right: 2.4em
|
||||
opacity: 0
|
||||
transition: opacity .4s
|
||||
|
||||
.copy-button
|
||||
position: absolute
|
||||
right: .7rem
|
||||
right: 14px
|
||||
cursor: pointer
|
||||
transition: color .2s
|
||||
|
||||
@@ -160,7 +136,7 @@ blockquote
|
||||
|
||||
if $highlight_theme == 'mac' || ($highlight_theme == 'mac light')
|
||||
figure.highlight
|
||||
margin: 0 0 1.2rem
|
||||
margin: 0 0 24px
|
||||
border-radius: 7px
|
||||
box-shadow: 0 5px 10px 0 $highlight-mac-border
|
||||
-webkit-transform: translateZ(0)
|
||||
@@ -168,7 +144,7 @@ blockquote
|
||||
.highlight-tools
|
||||
&:after
|
||||
position: absolute
|
||||
left: .7rem
|
||||
left: 14px
|
||||
width: 12px
|
||||
height: 12px
|
||||
border-radius: 50%
|
||||
@@ -184,13 +160,13 @@ blockquote
|
||||
transform: rotate(90deg) !important
|
||||
|
||||
& ~ .copy-notice
|
||||
right: 2.8rem
|
||||
right: 3.45em
|
||||
|
||||
& ~ .copy-button
|
||||
right: 1.8rem
|
||||
right: 2.1em
|
||||
|
||||
.code-lang
|
||||
left: 3.8rem !important
|
||||
left: 75px
|
||||
|
||||
if hexo-config('highlight_height_limit')
|
||||
.code-expand-btn
|
||||
@@ -204,12 +180,17 @@ blockquote
|
||||
cursor: pointer
|
||||
|
||||
i
|
||||
padding: .3rem 0
|
||||
padding: 6px 0
|
||||
color: var(--hlnumber-color)
|
||||
animation: code-expand-key 1.2s infinite
|
||||
|
||||
&.expand-done
|
||||
display: none !important
|
||||
& > i
|
||||
transform: rotate(180deg)
|
||||
|
||||
& + table,
|
||||
& + pre
|
||||
margin-bottom: 1.8em
|
||||
|
||||
&:not(.expand-done)
|
||||
& ~ table,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
figure.highlight
|
||||
table
|
||||
scrollbar-color: var(--hlscrollbar-bg) transparent
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: var(--hlscrollbar-bg)
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ if $highlight_theme != false
|
||||
if wordWrap
|
||||
&:before
|
||||
display: inline-block
|
||||
padding: 0 .3rem 0 0
|
||||
min-width: 1.6rem
|
||||
padding: 0 6px 0 0
|
||||
min-width: 30px
|
||||
color: var(--hlnumber-color)
|
||||
content: counter(line)
|
||||
counter-increment: line
|
||||
@@ -27,13 +27,13 @@ if $highlight_theme != false
|
||||
border: none
|
||||
|
||||
.gutter pre
|
||||
padding-right: .5rem
|
||||
padding-left: .5rem
|
||||
padding-right: 10px
|
||||
padding-left: 10px
|
||||
background-color: var(--hlnumber-bg)
|
||||
color: var(--hlnumber-color)
|
||||
text-align: right
|
||||
|
||||
.code pre
|
||||
padding-right: .5rem
|
||||
padding-left: .5rem
|
||||
padding-right: 10px
|
||||
padding-left: 10px
|
||||
width: 100%
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if hexo-fonfig('prismjs_settings.line_number')
|
||||
if $prismjs_line_number
|
||||
@require 'line-number'
|
||||
|
||||
if $highlight_theme != false
|
||||
@@ -6,6 +6,8 @@ if $highlight_theme != false
|
||||
|
||||
#article-container
|
||||
pre[class*='language-']
|
||||
scrollbar-color: var(--hlscrollbar-bg) transparent
|
||||
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: var(--hlscrollbar-bg)
|
||||
|
||||
@@ -14,7 +16,7 @@ if $highlight_theme != false
|
||||
|
||||
.caption
|
||||
margin-left: -3.8em
|
||||
padding: .2rem .8rem !important
|
||||
padding: 4px 16px !important
|
||||
|
||||
a
|
||||
padding: 0 !important
|
||||
|
||||
@@ -11,9 +11,9 @@ if $highlight_theme == 'darker' || ($highlight_theme == 'mac')
|
||||
color: alpha($highlight-foreground, .8),
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 6)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
if $highlight_enable
|
||||
$highlight-comment = #969896
|
||||
$highlight-red = #FF5370
|
||||
$highlight-orange = #F78C6C
|
||||
@@ -37,9 +37,9 @@ if $highlight_theme == 'pale night'
|
||||
color: $highlight-foreground,
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 6)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
if $highlight_enable
|
||||
$highlight-comment = #676E95
|
||||
$highlight-red = #FF5370
|
||||
$highlight-orange = #F78C6C
|
||||
@@ -63,9 +63,9 @@ if $highlight_theme == 'ocean'
|
||||
color: $highlight-foreground,
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 5)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
if $highlight_enable
|
||||
$highlight-comment = rgba(101, 115, 126, .8)
|
||||
$highlight-red = #FF5370
|
||||
$highlight-orange = #F78C6C
|
||||
@@ -92,7 +92,7 @@ if $highlight_theme == 'light' || ($highlight_theme == 'mac light')
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
if $highlight_enable
|
||||
$highlight-comment = rgba(149, 165, 166, .8)
|
||||
$highlight-red = #E53935
|
||||
$highlight-orange = #F76D47
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#aside-content
|
||||
width: 25%
|
||||
width: 26%
|
||||
|
||||
+minWidth900()
|
||||
if hexo-config('aside.position') == 'right'
|
||||
@@ -14,20 +14,14 @@
|
||||
margin-top: 0
|
||||
|
||||
+maxWidth900()
|
||||
margin-top: 1rem
|
||||
margin-top: 20px
|
||||
|
||||
.card-widget
|
||||
@extend .cardHover
|
||||
position: relative
|
||||
overflow: hidden
|
||||
margin-top: 1rem
|
||||
padding: 1rem 1.2rem
|
||||
border-radius: 8px
|
||||
background: var(--card-bg)
|
||||
box-shadow: var(--card-box-shadow)
|
||||
transition: box-shadow .3s
|
||||
|
||||
&:hover
|
||||
box-shadow: var(--card-hover-box-shadow)
|
||||
margin-top: 20px
|
||||
padding: 20px 24px
|
||||
|
||||
if hexo-config('aside.mobile') == false
|
||||
+maxWidth768()
|
||||
@@ -41,36 +35,18 @@
|
||||
font-size: 1.57em
|
||||
|
||||
&__description
|
||||
margin-top: -.3rem
|
||||
margin-top: -.42em
|
||||
|
||||
.card-info-data
|
||||
display: table
|
||||
margin: .7rem 0 .2rem
|
||||
width: 100%
|
||||
table-layout: fixed
|
||||
|
||||
& > .card-info-data-item
|
||||
display: table-cell
|
||||
|
||||
a
|
||||
.headline
|
||||
@extend .limit-one-line
|
||||
color: var(--font-color)
|
||||
font-size: 1em
|
||||
|
||||
.length-num
|
||||
margin-top: -.3rem
|
||||
color: var(--text-highlight-color)
|
||||
font-size: 1.4em
|
||||
margin: 14px 0 4px
|
||||
|
||||
.card-info-social-icons
|
||||
margin: .3rem 0 -.3rem
|
||||
margin: 6px 0 -6px
|
||||
|
||||
.social-icon
|
||||
margin: 0 .5rem
|
||||
margin: 0 10px
|
||||
color: var(--font-color)
|
||||
font-size: 1.4em
|
||||
cursor: pointer
|
||||
|
||||
i
|
||||
transition: all .3s
|
||||
@@ -80,21 +56,24 @@
|
||||
|
||||
#card-info-btn
|
||||
display: block
|
||||
margin-top: .7rem
|
||||
margin-top: 14px
|
||||
background-color: var(--btn-bg)
|
||||
color: var(--btn-color)
|
||||
text-align: center
|
||||
line-height: 2.4
|
||||
|
||||
&:hover
|
||||
background-color: var(--btn-hover-color)
|
||||
|
||||
span
|
||||
padding-left: .5rem
|
||||
padding-left: 10px
|
||||
|
||||
.item-headline
|
||||
padding-bottom: .3rem
|
||||
padding-bottom: 6px
|
||||
font-size: 1.2em
|
||||
|
||||
span
|
||||
margin-left: .3rem
|
||||
margin-left: 6px
|
||||
|
||||
.sticky_layout
|
||||
+minWidth900()
|
||||
@@ -106,7 +85,7 @@
|
||||
.card-tag-cloud
|
||||
a
|
||||
display: inline-block
|
||||
padding: 0 .2rem
|
||||
padding: 0 4px
|
||||
|
||||
&:hover
|
||||
color: $text-hover !important
|
||||
@@ -114,13 +93,13 @@
|
||||
.aside-list
|
||||
& > span
|
||||
display: block
|
||||
margin-bottom: .5rem
|
||||
margin-bottom: 10px
|
||||
text-align: center
|
||||
|
||||
& > .aside-list-item
|
||||
display: flex
|
||||
align-items: center
|
||||
padding: .3rem 0
|
||||
padding: 6px 0
|
||||
|
||||
&:first-child
|
||||
padding-top: 0
|
||||
@@ -137,13 +116,7 @@
|
||||
height: w
|
||||
|
||||
& > img
|
||||
width: 100%
|
||||
height: 100%
|
||||
transition: all .6s
|
||||
object-fit: cover
|
||||
|
||||
&:hover
|
||||
transform: scale(1.1)
|
||||
@extend .imgHover
|
||||
|
||||
.content
|
||||
flex: 1
|
||||
@@ -183,32 +156,26 @@
|
||||
.card-archives ul.card-archive-list > .card-archive-list-item,
|
||||
.card-categories ul.card-category-list > .card-category-list-item
|
||||
a
|
||||
display: inline-block
|
||||
padding: .15rem .5rem
|
||||
width: 100%
|
||||
display: flex
|
||||
flex-direction: row
|
||||
padding: 3px 10px
|
||||
color: var(--font-color)
|
||||
transition: all .4s
|
||||
|
||||
&:hover
|
||||
padding: .15rem .85rem
|
||||
padding: 3px 17px
|
||||
background-color: var(--text-bg-hover)
|
||||
|
||||
span
|
||||
@extend .limit-one-line
|
||||
display: inline-block
|
||||
vertical-align: bottom
|
||||
|
||||
&:first-child
|
||||
width: 80%
|
||||
|
||||
&:last-child
|
||||
width: 20%
|
||||
text-align: right
|
||||
flex: 1
|
||||
|
||||
.card-categories
|
||||
.card-category-list
|
||||
&.child
|
||||
padding: 0 0 0 .8rem
|
||||
padding: 0 0 0 16px
|
||||
|
||||
> .parent
|
||||
> a
|
||||
@@ -222,8 +189,8 @@
|
||||
|
||||
i
|
||||
float: right
|
||||
margin-right: -.35rem
|
||||
padding: .35rem
|
||||
margin-right: -.5em
|
||||
padding: .5em
|
||||
transition: transform .3s
|
||||
transform: rotate(0)
|
||||
|
||||
@@ -239,12 +206,12 @@
|
||||
.webinfo-item
|
||||
display: flex
|
||||
align-items: center
|
||||
padding: .1rem .5rem 0
|
||||
padding: 2px 10px 0
|
||||
|
||||
div
|
||||
&:first-child
|
||||
flex: 1
|
||||
padding-right: 1rem
|
||||
padding-right: 20px
|
||||
|
||||
// toc
|
||||
#card-toc
|
||||
@@ -256,28 +223,48 @@
|
||||
right: -100%
|
||||
bottom: 30px
|
||||
z-index: 100
|
||||
max-width: $toc-mobile-maxWidth
|
||||
max-height: calc(100% - 60px)
|
||||
width: $toc-mobile-width
|
||||
opacity: 0
|
||||
transition: initial
|
||||
transform-origin: right bottom
|
||||
|
||||
.toc-percentage
|
||||
float: right
|
||||
margin-top: -9px
|
||||
color: #a9a9a9
|
||||
font-style: italic
|
||||
font-size: 140%
|
||||
|
||||
.toc-content
|
||||
overflow-y: auto
|
||||
overflow-y: scroll
|
||||
overflow-y: overlay
|
||||
margin: 0 -24px
|
||||
max-height: calc(100vh - 120px)
|
||||
|
||||
+maxWidth900()
|
||||
max-height: calc(100vh - 140px)
|
||||
|
||||
.toc-child
|
||||
display: none
|
||||
& > *
|
||||
margin: 0 20px !important
|
||||
|
||||
+maxWidth900()
|
||||
display: block !important
|
||||
& > .toc-item > .toc-child
|
||||
margin-left: 10px
|
||||
padding-left: 10px
|
||||
border-left: 1px solid var(--dark-grey)
|
||||
|
||||
.toc-item
|
||||
&.active
|
||||
.toc-child
|
||||
display: block
|
||||
&:not(.is-expand)
|
||||
.toc-child
|
||||
display: none
|
||||
|
||||
+maxWidth900()
|
||||
display: block !important
|
||||
|
||||
.toc-item
|
||||
&.active
|
||||
.toc-child
|
||||
display: block
|
||||
|
||||
ol,
|
||||
li
|
||||
@@ -288,29 +275,22 @@
|
||||
|
||||
ol
|
||||
margin: 0
|
||||
padding-left: .4rem
|
||||
padding-left: 18px
|
||||
|
||||
.toc-link
|
||||
display: block
|
||||
padding-left: .3rem
|
||||
border-left: 3px solid transparent
|
||||
margin: 4px 0
|
||||
padding: 1px 6px
|
||||
color: var(--toc-link-color)
|
||||
transition: all .2s ease-in-out
|
||||
|
||||
&:hover
|
||||
color: $theme-color
|
||||
|
||||
&.active
|
||||
border-left-color: darken($theme-toc-color, 20%)
|
||||
background: $theme-toc-color
|
||||
color: $toc-active-color
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: .6rem
|
||||
right: 1.2rem
|
||||
color: #a9a9a9
|
||||
content: attr(progress-percentage)
|
||||
font-style: italic
|
||||
font-size: 1.2rem
|
||||
|
||||
:only-child
|
||||
> .card-widget
|
||||
margin-top: 0
|
||||
@@ -322,6 +302,11 @@
|
||||
&:hover
|
||||
animation: more-btn-move 1s infinite
|
||||
|
||||
.card-announcement
|
||||
.item-headline
|
||||
i
|
||||
color: #FF0000
|
||||
|
||||
.avatar-img
|
||||
overflow: hidden
|
||||
margin: 0 auto
|
||||
@@ -330,13 +315,38 @@
|
||||
border-radius: 70px
|
||||
|
||||
img
|
||||
width: 100%
|
||||
height: 100%
|
||||
transition: all .5s
|
||||
transition: filter 375ms ease-in .2s, transform .3s
|
||||
object-fit: cover
|
||||
|
||||
&:hover
|
||||
transform: rotate(360deg)
|
||||
|
||||
.site-data
|
||||
display: table
|
||||
width: 100%
|
||||
table-layout: fixed
|
||||
|
||||
& > a
|
||||
display: table-cell
|
||||
|
||||
div
|
||||
transition: all .3s
|
||||
|
||||
&:hover
|
||||
div
|
||||
color: $theme-color !important
|
||||
|
||||
.headline
|
||||
@extend .limit-one-line
|
||||
color: var(--font-color)
|
||||
|
||||
.length-num
|
||||
margin-top: -.32em
|
||||
color: var(--text-highlight-color)
|
||||
font-size: 1.4em
|
||||
|
||||
@keyframes more-btn-move
|
||||
0%,
|
||||
100%
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#post-comment
|
||||
.comment-head
|
||||
margin-bottom: 1rem
|
||||
margin-bottom: 20px
|
||||
|
||||
.comment-headline
|
||||
display: inline-block
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
if hexo-config('comments.text')
|
||||
float: right
|
||||
margin: .1rem auto 0
|
||||
padding: .2rem .8rem
|
||||
margin: 2px auto 0
|
||||
padding: 4px 16px
|
||||
width: max-content
|
||||
border-radius: 8px
|
||||
background: $comments-switch-bg
|
||||
@@ -33,7 +33,7 @@
|
||||
.switch-btn
|
||||
position: relative
|
||||
display: inline-block
|
||||
margin: -4px .4rem 0
|
||||
margin: -4px 8px 0
|
||||
width: 42px
|
||||
height: 22px
|
||||
border-radius: 34px
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#footer
|
||||
position: relative
|
||||
background: $light-blue
|
||||
background-attachment: local
|
||||
background-attachment: scroll
|
||||
background-position: bottom
|
||||
background-size: cover
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#footer-wrap
|
||||
position: relative
|
||||
padding: 2rem 1rem
|
||||
padding: 40px 20px
|
||||
color: var(--light-grey)
|
||||
text-align: center
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
text-decoration: underline
|
||||
|
||||
.footer-separator
|
||||
margin: 0 .2rem
|
||||
margin: 0 4px
|
||||
|
||||
.icp-icon
|
||||
padding: 0 4px
|
||||
vertical-align: text-bottom
|
||||
max-height: 1.4em
|
||||
width auto
|
||||
width: auto
|
||||
vertical-align: text-bottom
|
||||
|
||||
@@ -7,22 +7,29 @@
|
||||
background-repeat: no-repeat
|
||||
transition: all .5s
|
||||
|
||||
&:not(.not-top-img):before
|
||||
position: absolute
|
||||
width: 100%
|
||||
height: 100%
|
||||
background-color: alpha($dark-black, .3)
|
||||
content: ''
|
||||
|
||||
// index
|
||||
&.full_page
|
||||
min-height: $index_top_img_height
|
||||
height: $index_top_img_height
|
||||
background-attachment: fixed
|
||||
|
||||
#site-info
|
||||
position: absolute
|
||||
top: $index_site_info_top
|
||||
padding: 0 .5rem
|
||||
padding: 0 10px
|
||||
width: 100%
|
||||
|
||||
#site-title,
|
||||
#site-subtitle,
|
||||
#scroll-down .scroll-down-effects
|
||||
text-align: center
|
||||
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, .15)
|
||||
line-height: 1.5
|
||||
|
||||
#site-title
|
||||
@@ -43,18 +50,17 @@
|
||||
#site_social_icons
|
||||
display: none
|
||||
margin: 0 auto
|
||||
width: 15rem
|
||||
width: 300px
|
||||
text-align: center
|
||||
|
||||
+maxWidth768()
|
||||
display: block
|
||||
|
||||
.social-icon
|
||||
margin: 0 .5rem
|
||||
margin: 0 10px
|
||||
color: var(--light-grey)
|
||||
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, .15)
|
||||
font-size: 1.43em
|
||||
cursor: pointer
|
||||
|
||||
#scroll-down
|
||||
position: absolute
|
||||
@@ -70,55 +76,48 @@
|
||||
|
||||
// page
|
||||
&.not-home-page
|
||||
min-height: 20rem
|
||||
height: 400px
|
||||
|
||||
+maxWidth768()
|
||||
height: 14rem
|
||||
height: 280px
|
||||
|
||||
#page-site-info
|
||||
position: absolute
|
||||
top: 10rem
|
||||
padding: 0 .5rem
|
||||
top: 200px
|
||||
padding: 0 10px
|
||||
width: 100%
|
||||
|
||||
+maxWidth768()
|
||||
top: 7rem
|
||||
top: 140px
|
||||
|
||||
// post
|
||||
&.post-bg
|
||||
min-height: 20rem
|
||||
height: 400px
|
||||
|
||||
+maxWidth768()
|
||||
height: 18rem
|
||||
height: 360px
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 0
|
||||
display: block
|
||||
width: 100%
|
||||
height: 100%
|
||||
background-color: alpha($dark-black, .5)
|
||||
content: ''
|
||||
|
||||
#post-info
|
||||
position: absolute
|
||||
bottom: 5rem
|
||||
bottom: 100px
|
||||
padding: 0 8%
|
||||
width: 100%
|
||||
text-align: center
|
||||
|
||||
+maxWidth900()
|
||||
bottom: 1.5rem
|
||||
bottom: 30px
|
||||
text-align: left
|
||||
|
||||
+maxWidth768()
|
||||
bottom: 1.1rem
|
||||
padding: 0 1.1rem
|
||||
bottom: 22px
|
||||
padding: 0 22px
|
||||
|
||||
&.not-top-img
|
||||
margin-bottom: .5rem
|
||||
min-height: 60px
|
||||
margin-bottom: 10px
|
||||
height: 60px
|
||||
background: 0
|
||||
|
||||
#nav
|
||||
@@ -157,21 +156,17 @@
|
||||
top: 70px
|
||||
transition: top .5s
|
||||
|
||||
.apple
|
||||
#page-header.full_page
|
||||
background-attachment: scroll !important
|
||||
|
||||
#page
|
||||
h1.page-title
|
||||
margin: .4rem 0 1rem
|
||||
margin: 8px 0 20px
|
||||
|
||||
// for not top_img
|
||||
#post
|
||||
& > #post-info
|
||||
margin-bottom: 1.5rem
|
||||
margin-bottom: 30px
|
||||
|
||||
.post-title
|
||||
padding-bottom: .2rem
|
||||
padding-bottom: 4px
|
||||
border-bottom: 1px solid var(--light-grey)
|
||||
color: var(--text-highlight-color)
|
||||
|
||||
@@ -185,7 +180,7 @@
|
||||
#post-info
|
||||
.post-title
|
||||
@extend .limit-more-line
|
||||
margin-bottom: .4rem
|
||||
margin-bottom: 8px
|
||||
color: var(--white)
|
||||
font-weight: normal
|
||||
font-size: 2.5em
|
||||
@@ -193,10 +188,10 @@
|
||||
-webkit-line-clamp: 3
|
||||
|
||||
+maxWidth768()
|
||||
font-size: 1.72em
|
||||
font-size: 2.1em
|
||||
|
||||
.post-edit-link
|
||||
padding-left: .5rem
|
||||
padding-left: 10px
|
||||
|
||||
#post-meta
|
||||
color: var(--light-grey)
|
||||
@@ -216,14 +211,14 @@
|
||||
|
||||
.post-meta
|
||||
&-separator
|
||||
margin: 0 .25rem
|
||||
margin: 0 5px
|
||||
|
||||
&-icon
|
||||
margin-right: .2rem
|
||||
margin-right: 4px
|
||||
|
||||
&-label
|
||||
if hexo-config('post_meta.post.label')
|
||||
margin-right: .2rem
|
||||
margin-right: 4px
|
||||
else
|
||||
display: none
|
||||
|
||||
@@ -244,7 +239,6 @@
|
||||
top: 0
|
||||
z-index: 90
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
align-items: center
|
||||
padding: 0 36px
|
||||
width: 100%
|
||||
@@ -264,7 +258,7 @@
|
||||
|
||||
#toggle-menu
|
||||
display: none
|
||||
padding: .1rem 0 0 .3rem
|
||||
padding: 2px 0 0 6px
|
||||
vertical-align: top
|
||||
|
||||
&:hover
|
||||
@@ -277,7 +271,7 @@
|
||||
color: var(--white)
|
||||
|
||||
#site-name
|
||||
text-shadow: .1rem .1rem .2rem rgba($dark-black, .15)
|
||||
text-shadow: 2px 2px 4px rgba($dark-black, .15)
|
||||
font-weight: bold
|
||||
cursor: pointer
|
||||
|
||||
@@ -287,16 +281,16 @@
|
||||
.menus_item
|
||||
position: relative
|
||||
display: inline-block
|
||||
padding: 0 0 0 .7rem
|
||||
padding: 0 0 0 14px
|
||||
|
||||
&:hover
|
||||
.menus_item_child
|
||||
display: block
|
||||
|
||||
i.expand
|
||||
transform: rotate(180deg) !important
|
||||
& > a > i:last-child
|
||||
transform: rotate(180deg)
|
||||
|
||||
i.expand
|
||||
& > a > i:last-child
|
||||
padding: 4px
|
||||
transition: transform .3s
|
||||
|
||||
@@ -310,6 +304,7 @@
|
||||
background-color: var(--sidebar-bg)
|
||||
box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
|
||||
animation: sub_menus .3s .1s ease both
|
||||
border-radius: 5px
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
@@ -325,9 +320,13 @@
|
||||
&:hover
|
||||
background: var(--text-bg-hover)
|
||||
|
||||
&:first-child
|
||||
border-radius: 5px 5px 0 0
|
||||
&:last-child
|
||||
border-radius: 0 0 5px 5px
|
||||
a
|
||||
display: inline-block
|
||||
padding: .3rem .7rem
|
||||
padding: 8px 16px
|
||||
width: 100%
|
||||
color: var(--font-color) !important
|
||||
text-shadow: none !important
|
||||
@@ -340,22 +339,19 @@
|
||||
font-size: inherit
|
||||
|
||||
.menus_items
|
||||
position: absolute
|
||||
left: 0
|
||||
visibility: hidden
|
||||
opacity: 0
|
||||
display: none
|
||||
|
||||
#search-button span
|
||||
display: none !important
|
||||
display: none
|
||||
|
||||
#search-button
|
||||
display: inline
|
||||
padding: 0 0 0 .7rem
|
||||
padding: 0 0 0 14px
|
||||
|
||||
.site-page
|
||||
position: relative
|
||||
padding-bottom: .3rem
|
||||
text-shadow: .05rem .05rem .1rem rgba($dark-black, .3)
|
||||
padding-bottom: 6px
|
||||
text-shadow: 1px 1px 2px rgba($dark-black, .3)
|
||||
font-size: .78em
|
||||
cursor: pointer
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ if hexo-config('preloader')
|
||||
.loading-word
|
||||
position: absolute
|
||||
color: var(--preloader-color)
|
||||
font-size: .8rem
|
||||
font-size: 16px
|
||||
|
||||
.configure-core
|
||||
width: 100%
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user