mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bf11ddeb0 | ||
|
|
ddff0348b7 | ||
|
|
321091befb | ||
|
|
9c996d0a73 | ||
|
|
748709f56f | ||
|
|
1ef2720c2c | ||
|
|
d85f71887b | ||
|
|
9bb7c2bb99 | ||
|
|
c40db692bf | ||
|
|
eec30fd6be | ||
|
|
24269f457e | ||
|
|
c002fd0e64 | ||
|
|
ae717bd304 | ||
|
|
894c709b3c | ||
|
|
d59ed0b401 | ||
|
|
96ef1478ef | ||
|
|
43b109bdb6 | ||
|
|
995fc7cf9d | ||
|
|
e77ab81941 | ||
|
|
eae694806c | ||
|
|
90726f1a59 | ||
|
|
ae73a2114f | ||
|
|
20dcc61e0d | ||
|
|
f36450dbc0 | ||
|
|
2fc895102d | ||
|
|
e26637c5a8 | ||
|
|
082df56112 | ||
|
|
27adaecf51 | ||
|
|
a33e7e1d89 | ||
|
|
da4a8d77d7 | ||
|
|
8cb366bdda | ||
|
|
7f8e431226 | ||
|
|
b32ff6920b | ||
|
|
25f128fb3d | ||
|
|
9e14fca4a7 | ||
|
|
336e221de5 | ||
|
|
32d1cd3f53 | ||
|
|
1e06a6ca5e | ||
|
|
6c26f20427 | ||
|
|
dc65869042 | ||
|
|
2b90e15596 | ||
|
|
2eb15123f9 | ||
|
|
eecfaaf124 | ||
|
|
05766e396f | ||
|
|
94c51b5d04 | ||
|
|
f6d70e5863 | ||
|
|
3d09a9331b | ||
|
|
83dc0559c0 | ||
|
|
91bb944931 | ||
|
|
bade41acd7 | ||
|
|
da8ffda39b | ||
|
|
51288ec8b6 | ||
|
|
3bf033c9e4 | ||
|
|
bb8e98c68a |
45
.github/ISSUE_TEMPLATE.md
vendored
Normal file
45
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
IMPORTANT: Please follow the template to create a new issue.
|
||||
重要:請依照該模板來提交。
|
||||
-->
|
||||
|
||||
## I want to create a new issue <!-- 我想要建立一個新的issue -->
|
||||
|
||||
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->
|
||||
<!-- 請確認是否都已經翻閱過如下的資料, 尤其是安裝文檔!! -->
|
||||
- [] Yes, I have read [Hexo Docs page](https://hexo.io/docs/), especially [Templates](https://hexo.io/docs/templates.html), [Variables](https://hexo.io/docs/variables.html), [Helpers](https://hexo.io/docs/helpers.html) and [Troubleshooting](https://hexo.io/docs/troubleshooting.html).
|
||||
- [] Yes, I have read [Hexo-theme-butterfly Documentation](https://jerryc.me/posts/21cfbf15/).
|
||||
- [] And yes, I already searched for current [issues](https://github.com/jerryc127/hexo-theme-butterfly/issues?utf8=%E2%9C%93&q=is%3Aissue) and this did not help me.
|
||||
|
||||
## Butterfly Information
|
||||
|
||||
<!-- Butterfly的版本 -->
|
||||
<!-- 檢視主題的package.json -->
|
||||
**Butterfly Version:**
|
||||
|
||||
<!-- Windows/macOS/Linux/Android/iOS -->
|
||||
**Platform:**
|
||||
|
||||
<!-- Chrome/Safari/FireFox/.. -->
|
||||
**Browser:**
|
||||
|
||||
## Expected behavior <!-- (預期行為) -->
|
||||
|
||||
## Actual behavior <!-- (實際行為) -->
|
||||
|
||||
<!-- Please give me the screenshots to locate the issue -->
|
||||
<!-- 請儘量提供截圖來定位問題 -->
|
||||
|
||||
## Steps to reproduce the behavior <!-- (重現步驟) -->
|
||||
|
||||
## Feature Request
|
||||
|
||||
<!-- If you have any ideas of theme-butterfly, please write down here and we can have a discussion. -->
|
||||
<!-- 如果你有任何關於Butterfly的功能方面的想法,可以在這個部分裡寫下來我們一起討論 -->
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Love hexo-theme-butterfly? Please consider starring the repo to support it!
|
||||
喜歡 hexo-theme-butterfly嗎? 考慮一下給它點個star來支援它吧!
|
||||
-->
|
||||
21
.github/stale.yml
vendored
Normal file
21
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- bug
|
||||
- enhancement
|
||||
- Solved
|
||||
- documentation
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
41
README.md
41
README.md
@@ -1,37 +1,48 @@
|
||||
# hexo-theme-butterfly
|
||||
|
||||
[预览](https://jerryc.me/)
|
||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.2.0-blue"/></a>
|
||||
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
||||
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a>
|
||||
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||
|
||||
一款基于[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主题
|
||||
Demo: https://demo.jerryc.me/
|
||||
|
||||
## 安装
|
||||
JerryC: https://jerryc.me/
|
||||
|
||||
在你的博客根目录里
|
||||
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
||||
|
||||
## Installation
|
||||
|
||||
Stable branch:
|
||||
|
||||
```
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
如果想要安裝比較新的dev分支,可以
|
||||
Dev branch:
|
||||
|
||||
```
|
||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
## 应用主题
|
||||
修改hexo配置文件`_config.yml`,把主题改为`Butterfly`
|
||||
## Configuration
|
||||
|
||||
```
|
||||
theme: Butterfly
|
||||
```
|
||||
Set theme in the hexo work folder's root config file `_config.yml`:
|
||||
|
||||
>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-jade hexo-renderer-stylus --save or yarn add hexo-renderer-jade hexo-renderer-stylus
|
||||
> theme: Butterfly
|
||||
|
||||
## 文档
|
||||
If you don't have pug & stylus renderer, try this:
|
||||
|
||||
可查看或[这里](https://docs.jerryc.me/)或[这里](https://jerryc.me/posts/21cfbf15)
|
||||
> npm install hexo-renderer-pug hexo-renderer-stylus
|
||||
|
||||
## Documentation
|
||||
|
||||
Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
|
||||
|
||||
## Screenshots
|
||||
|
||||
## 截图
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
46
README_CN.md
Normal file
46
README_CN.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# hexo-theme-butterfly
|
||||
|
||||
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.2.0-blue"/></a>
|
||||
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></a>
|
||||
<a href="https://hexo.io"><img alt="Hexo" src="https://img.shields.io/badge/hexo-4.0+-0e83c"/></a>
|
||||
<a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
|
||||
|
||||
Demo: https://demo.jerryc.me/
|
||||
|
||||
JerryC: https://jerryc.me/
|
||||
|
||||
|
||||
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
||||
|
||||
## 安裝
|
||||
|
||||
在你的博客根目錄裡
|
||||
|
||||
```
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
如果想要安裝比較新的dev分支,可以
|
||||
|
||||
```
|
||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
## 應用主題
|
||||
修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
|
||||
|
||||
```
|
||||
theme: Butterfly
|
||||
```
|
||||
|
||||
>如果你沒有pug以及stylus的渲染器,請下載安裝: npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus
|
||||
|
||||
## 文檔
|
||||
|
||||
可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15)
|
||||
|
||||
## 截圖
|
||||

|
||||

|
||||
|
||||

|
||||
654
_config.yml
654
_config.yml
@@ -1,28 +1,19 @@
|
||||
# Theme color for customize
|
||||
# Notice: color value must in double quotes like "#000" or may cause error!
|
||||
# ---------------
|
||||
# theme_color:
|
||||
# enable: true
|
||||
# main: "#7A7FF1"
|
||||
# paginator: "#7A7FF1"
|
||||
# button_hover: "#FF7242"
|
||||
# text_selection: "#69c46d"
|
||||
# link_color: "#858585"
|
||||
# hr_color: "#A4D8FA"
|
||||
# read-mode-bg_color: '#FAF9DE'
|
||||
|
||||
# Main menu navigation
|
||||
# format: xxx: /xxx/||icon
|
||||
# ---------------
|
||||
# format: xxx: 連結 || icon
|
||||
# sub-menu
|
||||
# xxx || icon:
|
||||
# xxx || 連結 || icon
|
||||
menu:
|
||||
Home: /||fa fa-home
|
||||
Archives: /archives/||fa fa-archive
|
||||
Tags: /tags/||fa fa-tags
|
||||
Categories: /categories/||fa fa-folder-open
|
||||
Link: /link/||fa fa-link
|
||||
About: /about/||fa fa-heart
|
||||
# #XXX: /xxx
|
||||
|
||||
Home: / || fa fa-home
|
||||
Archives: /archives/ || fa fa-archive
|
||||
Tags: /tags/ || fa fa-tags
|
||||
Categories: /categories/ || fa fa-folder-open
|
||||
Link: /link/ || fa fa-link
|
||||
About: /about/ || fa fa-heart
|
||||
List||fa fa-list:
|
||||
- Music || /music/ || fa fa-music
|
||||
- Movie || /movies/ || fa fa-film
|
||||
|
||||
# Favicon
|
||||
# ---------------
|
||||
@@ -39,24 +30,33 @@ favicon: /img/favicon.ico
|
||||
# favicon_32_32: /img/pwa/32.png
|
||||
# favicon_16_16: /img/pwa/16.png
|
||||
# mask_icon: /img/pwa/safari-pinned-tab.svg
|
||||
# shortcut_icon: /img/favicon.ico
|
||||
|
||||
|
||||
# Highlight theme
|
||||
# ---------------
|
||||
highlight_theme: light
|
||||
highlight_copy: true
|
||||
highlight_theme: light # default / darker / pale night / light / ocean
|
||||
highlight_copy: true #代碼複製按鈕
|
||||
highlight_lang: true #代碼語言顯示
|
||||
highlight_shrink: false # true 全部代碼框不展開,需點擊 '>' 打開 / false 代碼框展開,有'>'點擊按鈕 | none 代碼框展開,不顯示 '>' 按鈕
|
||||
|
||||
code_word_wrap: false
|
||||
|
||||
# Nav settings
|
||||
# formal:
|
||||
# copy setting
|
||||
# 是否禁止複製(如果禁止,highlight_copy的功能將無效)
|
||||
# copyright 複製的內容後面加上版權信息
|
||||
copy:
|
||||
enable: true # true 開啟 / false 禁止
|
||||
copyright: false
|
||||
|
||||
# social settings
|
||||
# formal:
|
||||
# icon: link
|
||||
# ---------------
|
||||
social:
|
||||
fa fa-github: https://github.com/jerryc127
|
||||
fa fa-envelope: mailto:xxxxxxxx@gmail.com
|
||||
fa fa-rss: /atom.xml
|
||||
|
||||
#### search ####
|
||||
# Algolia search
|
||||
# ---------------
|
||||
algolia_search:
|
||||
@@ -69,7 +69,6 @@ algolia_search:
|
||||
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
||||
hits_stats: "${hits} results found in ${time} ms"
|
||||
|
||||
|
||||
# Local search
|
||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#本地搜索
|
||||
# ---------------
|
||||
@@ -84,80 +83,92 @@ local_search:
|
||||
# ---------------
|
||||
mathjax:
|
||||
enable: false
|
||||
cdn: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
||||
# true 表示每一頁都加載mathjax.js
|
||||
# false 需要時加載,須在使用的Markdown Front-matter 加上 mathjax: true
|
||||
per_page: false
|
||||
|
||||
# KaTeX
|
||||
# ---------------
|
||||
katex:
|
||||
enable: false
|
||||
cdn:
|
||||
css: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
||||
# true 表示每一頁都加載katex.js
|
||||
# false 需要時加載,須在使用的Markdown Front-matter 加上 katex: true
|
||||
per_page: false
|
||||
hide_scrollbar: true
|
||||
|
||||
|
||||
|
||||
# Analysis
|
||||
# ---------------
|
||||
# baidu_analytics:
|
||||
|
||||
#Google Analytics
|
||||
google_analytics:
|
||||
|
||||
|
||||
# stylesheets loaded in the <head>
|
||||
# ---------------
|
||||
stylesheets:
|
||||
- /css/index.css
|
||||
|
||||
# scripts loaded in the end of the body
|
||||
# ---------------
|
||||
scripts:
|
||||
- /js/utils.js
|
||||
- /js/main.js
|
||||
|
||||
# cdn for third-party library
|
||||
# ---------------
|
||||
cdn:
|
||||
css:
|
||||
fontawesome: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
||||
# fontawesomeV5: https://use.fontawesome.com/releases/v5.8.1/css/all.css
|
||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
||||
js:
|
||||
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js
|
||||
js-cookies: https://cdn.jsdelivr.net/npm/js-cookie@2/src/js.cookie.min.js
|
||||
# mermaid
|
||||
# see https://github.com/knsv/mermaid
|
||||
# -------------------------------
|
||||
mermaid:
|
||||
enable: false
|
||||
# built-in themes: default/forest/dark/neutral
|
||||
theme: default
|
||||
|
||||
# Post info settings
|
||||
# ---------------
|
||||
# avatar: /img/avatar.png
|
||||
avatar: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/avatar.png
|
||||
avatar:
|
||||
img: /img/avatar.png
|
||||
effect: false # 頭像會一直轉圈
|
||||
|
||||
# the banner image of index
|
||||
# if the banner of another page not setting,it will show the top_img
|
||||
top_img: https://i.loli.net/2019/05/22/5ce53eb6dc82757840.jpg
|
||||
index_img:
|
||||
|
||||
#the banner image of post
|
||||
# if the post not set the post cover and post top image, it will show it
|
||||
post_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/post.png
|
||||
|
||||
# the default cover of the post
|
||||
default_cover: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png
|
||||
# if the banner of page not setting,it will show the top_img
|
||||
default_top_img: /img/index.jpg
|
||||
|
||||
# the banner image of archive page
|
||||
archive_img: https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/Photo/archive.jpg
|
||||
archive_img:
|
||||
|
||||
# the banner image of tag page
|
||||
# tag page, look like https://xxxxxxxxx.com/tags/butterfly
|
||||
tag_img:
|
||||
|
||||
# the banner image of category page
|
||||
# category page, look like https://xxxxxxxxx.com/categories/butterfly
|
||||
category_img:
|
||||
|
||||
# 如果你有使用hexo-douban,可配置這個
|
||||
# douban:
|
||||
# meta: false
|
||||
# movies_img:
|
||||
# books_img:
|
||||
# games_img:
|
||||
|
||||
cover:
|
||||
# 是否顯示文章封面
|
||||
index_enable: true
|
||||
aside_enable: true
|
||||
archives_enable: true
|
||||
# 封面顯示的位置
|
||||
# 三個值可配置 left , right , both
|
||||
position: both
|
||||
# 當沒有設置cover時,默認的封面顯示
|
||||
default_cover:
|
||||
- /img/post.jpg
|
||||
|
||||
# if the photo link cannot connect,it will show that
|
||||
lodding_bg:
|
||||
flink: /img/friend_404.gif
|
||||
post_page: /img/404.jpg
|
||||
flink: /img/friend_404.gif #404後圖片
|
||||
post_page: /img/404.jpg #404後圖片
|
||||
# post: /img/loading.gif ##加載動畫
|
||||
|
||||
# A simple 404 page
|
||||
error_404:
|
||||
enable: false
|
||||
subtitle: "Page Not Found"
|
||||
background:
|
||||
|
||||
post_meta:
|
||||
date_type: both # or created or updated 文章日期是创建日或者更新日或都显示
|
||||
categories: true # or false 是否显示分类
|
||||
tags: true # or false 是否显示标签
|
||||
page:
|
||||
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
|
||||
categories: true # true or false 主頁是否顯示分類
|
||||
tags: false # true or false 主頁是否顯示標籤
|
||||
post:
|
||||
date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
|
||||
categories: true # true or false 文章頁是否顯示分類
|
||||
tags: true # true or false 文章頁是否顯示標籤
|
||||
|
||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#字数统计
|
||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#字數統計
|
||||
wordcount:
|
||||
enable: false
|
||||
|
||||
@@ -171,16 +182,17 @@ auto_open_sidebar:
|
||||
|
||||
post_copyright:
|
||||
enable: true
|
||||
decode: false
|
||||
license: CC BY-NC-SA 4.0
|
||||
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
|
||||
# 自動節選
|
||||
auto_excerpt:
|
||||
enable: true
|
||||
length: 150
|
||||
|
||||
|
||||
# Share System
|
||||
# ---------------
|
||||
#### Share System ####
|
||||
# -----------------------------------------
|
||||
addThis:
|
||||
enable: false
|
||||
pubid:
|
||||
@@ -201,50 +213,75 @@ addtoany:
|
||||
- email
|
||||
- copy_link
|
||||
|
||||
# Comments System
|
||||
# ---------------
|
||||
#### Comments System ####
|
||||
# ------------------------------------
|
||||
disqus:
|
||||
enable: false
|
||||
shortname:
|
||||
|
||||
# laibili:
|
||||
# enable: false
|
||||
# uid:
|
||||
shortname:
|
||||
count: false # top_img顯示評論數
|
||||
|
||||
# gitment
|
||||
# enable: false
|
||||
# owner:
|
||||
# repo:
|
||||
# client_id:
|
||||
# client_secret:
|
||||
# Disqus.js版評論系統,應對大陸長城的折中方案,兼容原版:https://github.com/SukkaW/DisqusJS
|
||||
# API 申請地址:https://disqus.com/api/applications/
|
||||
# 與 disqus 共用樣式
|
||||
disqusjs:
|
||||
enable: false
|
||||
shortname:
|
||||
siteName:
|
||||
apikey:
|
||||
api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址
|
||||
admin:
|
||||
adminLabel:
|
||||
count: true # top_img顯示評論數
|
||||
|
||||
# gitalk:
|
||||
# enable: false
|
||||
# client_id:
|
||||
# client_secret:
|
||||
# repo:
|
||||
# owner:
|
||||
# admin:
|
||||
#### Using this js for redirect to gitalk container after login
|
||||
#### See https://github.com/gitalk/gitalk/issues/125
|
||||
# js: https://cdn.jsdelivr.net/gh/upupming/gitalk@36368e5dffd049e956cdbbd751ff96c28d8255cf/dist/gitalk.min.js
|
||||
laibili:
|
||||
enable: false
|
||||
uid:
|
||||
|
||||
gitalk:
|
||||
enable: false
|
||||
client_id:
|
||||
client_secret:
|
||||
repo:
|
||||
owner:
|
||||
admin:
|
||||
language: zh-CN # en , zh-CN , zh-TW
|
||||
perPage: 10 # Pagination size, with maximum 100.
|
||||
distractionFreeMode: false # Facebook-like distraction free mode.
|
||||
pagerDirection: last # Comment sorting direction, available values are last and first.
|
||||
createIssueManually: false # Gitalk will create a corresponding github issue for your every single page automatically
|
||||
count: true # top_img顯示評論數
|
||||
|
||||
# valine comment system. https://valine.js.org
|
||||
valine:
|
||||
enable: false # if you want use valine,please set this value is true
|
||||
appId: # leancloud application app id
|
||||
appKey: # leancloud application app key
|
||||
appId: # leancloud application app id
|
||||
appKey: # leancloud application app key
|
||||
notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
|
||||
verify: false # valine verify code (true/false)
|
||||
pageSize: 10 # comment list page size
|
||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||
lang: en # i18n: zh-cn/en
|
||||
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
|
||||
guest_info: nick,mail,link #valine comment header inf
|
||||
guest_info: nick,mail,link #valine comment header info
|
||||
recordIP: false # Record reviewer IP
|
||||
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
|
||||
bg: /img/comment_bg.png # valine background
|
||||
count: true # top_img顯示評論數
|
||||
|
||||
# Footer Settings
|
||||
# ---------------
|
||||
since: 2018
|
||||
# utterances
|
||||
# https://utteranc.es/
|
||||
utterances:
|
||||
enable: false
|
||||
repo:
|
||||
# 可選 pathname/url/title/og:title
|
||||
issue_term: pathname
|
||||
# 可選 github-light/github-dark/github-dark-orange/icy-dark/dark-blue/photon-dark
|
||||
light_theme: github-light
|
||||
dark_theme: photon-dark
|
||||
|
||||
##### Footer Settings ####
|
||||
# ------------------------------------
|
||||
since: 2020
|
||||
|
||||
footer_custom_text:
|
||||
|
||||
@@ -253,18 +290,30 @@ footer_copyright:
|
||||
|
||||
ICP:
|
||||
enable: false
|
||||
url:
|
||||
url:
|
||||
text:
|
||||
icon: /img/icp.png
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
busuanzi:
|
||||
site_uv: true
|
||||
site_pv: true
|
||||
page_pv: true
|
||||
#### Analysis ####
|
||||
# ---------------
|
||||
baidu_analytics:
|
||||
|
||||
# Google Analytics
|
||||
google_analytics:
|
||||
|
||||
# Tencent_analytics ID
|
||||
tencent_analytics:
|
||||
|
||||
# Ads
|
||||
# ---------------
|
||||
# Google Adsense
|
||||
google_adsense:
|
||||
enable: false
|
||||
js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
|
||||
client:
|
||||
enable_page_level_ads: true
|
||||
|
||||
#### 站長驗證 ####
|
||||
# Google Webmaster tools verification setting
|
||||
# See: https://www.google.com/webmasters/
|
||||
google_site_verification:
|
||||
@@ -281,34 +330,7 @@ baidu_site_verification:
|
||||
# see http://zhanzhang.so.com/
|
||||
qihu_site_verification:
|
||||
|
||||
Flink:
|
||||
headline: 友情鏈接
|
||||
info_headline: 我的Blog資料
|
||||
name: Blog 名字: JerryC
|
||||
address: Blog 地址: https://jerryc.me/
|
||||
avatar: Blog 頭像: https://jerryc.me/img/avatar.png
|
||||
info: Blog 簡介: 今日事,今日畢
|
||||
comment: 如果需要交換友鏈,請留言
|
||||
|
||||
|
||||
|
||||
runtimeshow:
|
||||
enable: true
|
||||
start_date: 6/7/2018 00:00:00
|
||||
|
||||
|
||||
nightshift:
|
||||
enable: true
|
||||
|
||||
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
|
||||
|
||||
|
||||
announcement:
|
||||
content: 感謝訪問本站,若喜歡請收藏 ^_^
|
||||
|
||||
# 打賞按鈕
|
||||
reward:
|
||||
enable: true
|
||||
QR_code:
|
||||
@@ -319,65 +341,167 @@ reward:
|
||||
img: /img/alipay.jpg
|
||||
text: 支付寶
|
||||
|
||||
# 推薦文章
|
||||
related_post:
|
||||
enable: true
|
||||
limit: 6 # 顯示推薦文章數目
|
||||
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||
|
||||
# canvas_ribbon
|
||||
#### 美化/效果 ####
|
||||
#--------------------------------
|
||||
|
||||
# Theme color for customize
|
||||
# Notice: color value must in double quotes like "#000" or may cause error!
|
||||
# ---------------
|
||||
# theme_color:
|
||||
# enable: true
|
||||
# main: "#49B1F5"
|
||||
# paginator: "#00c4b6"
|
||||
# button_hover: "#FF7242"
|
||||
# text_selection: "#00c4b6"
|
||||
# link_color: "#99a9bf"
|
||||
# meta_color: "#858585"
|
||||
# hr_color: "#A4D8FA"
|
||||
# code_foreground: "#F47466"
|
||||
# code_background: "rgba(27, 31, 35, .05)"
|
||||
# toc_color: "#00c4b6"
|
||||
# blockquote_padding_color: "#49b1f5"
|
||||
# blockquote_background_color: "#49b1f5"
|
||||
|
||||
# 主頁設置
|
||||
# 默認top_img全屏,site_info在中間
|
||||
# 使用默認, 都無需填寫(建議默認)
|
||||
index_site_info_top: # 主頁標題距離頂部距離 例如 300px/300em/300rem/10%
|
||||
index_top_img_height: # 主頁top_img高度 例如 300px/300em/300rem 不能使用百分比
|
||||
|
||||
# category和tag頁的UI設置
|
||||
# index 值代表 UI將與首頁的UI一樣
|
||||
# 默認跟archives頁面UI一樣
|
||||
category_ui: # 留空或index
|
||||
tag_ui: # 留空或index
|
||||
|
||||
# 設置網站背景
|
||||
# 可設置圖片 或者 顔色
|
||||
# 圖片格式 background: url(http://xxxxxx.com/xxx.jpg)
|
||||
# 顔色 background: '#49B202'
|
||||
# 留空 顯示白色
|
||||
background:
|
||||
|
||||
# footer是否顯示圖片背景(與top_img一致)
|
||||
footer_bg: false
|
||||
|
||||
# 背景特效
|
||||
# 避免卡頓,建議只開啟一個
|
||||
# canvas_ribbon 禁止彩帶背景
|
||||
# See: https://github.com/hustcc/ribbon.js
|
||||
canvas_ribbon:
|
||||
enable: true
|
||||
enable: false
|
||||
size: 150
|
||||
alpha: 0.6
|
||||
zIndex: -1
|
||||
click_to_change: false
|
||||
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||
|
||||
|
||||
# 動態彩帶
|
||||
canvas_ribbon_piao:
|
||||
enable: false
|
||||
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||
|
||||
# canvas_nest
|
||||
# https://github.com/hustcc/canvas-nest.js
|
||||
canvas_nest:
|
||||
enable: false
|
||||
color: "0,0,255" #color of lines, default: '0,0,0'; RGB values: (R,G,B).(note: use ',' to separate.)
|
||||
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
||||
zIndex: -1 # z-index property of the background, default: -1.
|
||||
count: 99 # the number of lines, default: 99.
|
||||
mobile: false # false 手機端不顯示 true 手機端顯示
|
||||
|
||||
# 避免重複網址分散seo
|
||||
canonical: true
|
||||
# 打字效果
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
colorful: true # 冒光特效
|
||||
shake: true # 抖動特效
|
||||
|
||||
# 禁止百度轉碼
|
||||
disable_baidu_transformation: true
|
||||
# 鼠標點擊效果
|
||||
# 避免卡頓,建議只開啟一個
|
||||
# 點擊煙火特效
|
||||
fireworks:
|
||||
enable: false
|
||||
|
||||
twitter_meta: true
|
||||
Open_Graph_meta: true
|
||||
# 點擊出現愛心
|
||||
click_heart:
|
||||
enable: false
|
||||
|
||||
#閲讀模式
|
||||
readmode:
|
||||
enable: true
|
||||
# 點擊出現文字,文字可自行修改
|
||||
ClickShowText:
|
||||
enable: false
|
||||
text:
|
||||
- 本人
|
||||
- 超帥
|
||||
fontSize: 15px
|
||||
|
||||
#全局字體
|
||||
# 網站顯示模式
|
||||
# light 默認模式
|
||||
# dark 黑暗模式(不建議)
|
||||
display_mode: light
|
||||
|
||||
# 美化頁面顯示
|
||||
beautify:
|
||||
enable: false
|
||||
title-prefix-icon: '\f0c1'
|
||||
title-prefix-icon-color: "#F47466"
|
||||
|
||||
# 全局字體
|
||||
font:
|
||||
enable: false
|
||||
font-family: Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB,"Microsoft JhengHei", "MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
code-font: consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
font-family: Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
code-font: consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
|
||||
#網站名字字體
|
||||
#左上角網站名字 主頁居中網站名字
|
||||
# 網站名字字體
|
||||
# 左上角網站名字 主頁居中網站名字
|
||||
blog_title_font:
|
||||
#字體鏈接
|
||||
font_link: https://fonts.googleapis.com/css?family=Titillium+Web
|
||||
font-family: Titillium Web, PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
font_link: https://fonts.googleapis.com/css?family=Titillium+Web #字體鏈接
|
||||
font-family: Titillium Web, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
|
||||
#水平分隔綫
|
||||
# 水平分隔綫
|
||||
hr:
|
||||
enable: false
|
||||
#fontawesome上圖標的Unicode
|
||||
icon: '\f21c'
|
||||
icon: '\f21c' #fontawesome上圖標的Unicode
|
||||
icon-top: -20px
|
||||
|
||||
# 主頁subtitle
|
||||
subtitle:
|
||||
subtitle:
|
||||
enable: true
|
||||
sub1: 今日事,今日畢
|
||||
sub2: Never put off till tomorrow what you can do today #如果有符號 ' ,記得前面加上 \
|
||||
# 打字效果
|
||||
effect: true
|
||||
# 循環或者只打字一次
|
||||
loop: false
|
||||
# source調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用金山詞霸的每日一句(簡體)
|
||||
# source: 2 調用一言網的一句話(簡體) #https://hitokoto.cn/
|
||||
# source: 3 調用一句網(簡體) http://yijuzhan.com/
|
||||
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
source: false
|
||||
# (如果有英文逗號' , ',請使用轉義字符 ,)
|
||||
# 如果關閉打字效果,subtitle只會顯示sub的第一行文字
|
||||
sub:
|
||||
- 今日事,今日畢
|
||||
- Never put off till tomorrow what you can do today
|
||||
|
||||
#側邊欄顯示設置
|
||||
# fontawesome圖標
|
||||
# 默認使用的是 fontawesome v4版本的圖標
|
||||
fontawesome_v5:
|
||||
enable: false
|
||||
|
||||
#### 側邊欄 ####
|
||||
#-------------------------------------
|
||||
# 側邊欄顯示設置
|
||||
aside:
|
||||
enable: true
|
||||
mobile: true # 手機頁面( 顯示寬度 < 768px )是否顯示aside內容
|
||||
position: right # left or right
|
||||
card_author: true
|
||||
card_announcement: true
|
||||
@@ -387,52 +511,208 @@ aside:
|
||||
card_archives: true
|
||||
card_webinfo: true
|
||||
|
||||
# 網站公告
|
||||
announcement:
|
||||
content: 感謝訪問本站,若喜歡請收藏 ^_^
|
||||
|
||||
## chinese traditional to Simplified
|
||||
# busuanzi count for PV / UV in site
|
||||
# 訪問人數
|
||||
busuanzi:
|
||||
site_uv: true
|
||||
site_pv: true
|
||||
page_pv: true
|
||||
|
||||
# 網頁開通時間
|
||||
# 格式: 月/日/年 時間
|
||||
# 也可以寫成 年/月/日 時間
|
||||
runtimeshow:
|
||||
enable: true
|
||||
start_date: 6/7/2018 00:00:00
|
||||
|
||||
#### 右下角按鈕 ####
|
||||
#----------------------------------------------
|
||||
# 簡繁轉換
|
||||
translate:
|
||||
enable: true
|
||||
# 默認按鈕顯示文字
|
||||
default: 繁
|
||||
#网站默认语言,1: 繁體中文, 2: 简体中文
|
||||
#網站默認語言,1: 繁體中文, 2: 簡體中文
|
||||
defaultEncoding: 2
|
||||
#延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
||||
#延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0
|
||||
translateDelay: 0
|
||||
#博客网址
|
||||
#博客網址
|
||||
cookieDomain: "https://xxx/"
|
||||
#當文字是簡體時,按鈕顯示的文字
|
||||
msgToTraditionalChinese: "繁"
|
||||
#當文字是繁體時,按鈕顯示的文字
|
||||
msgToSimplifiedChinese: "简"
|
||||
msgToSimplifiedChinese: "簡"
|
||||
|
||||
#閲讀模式
|
||||
readmode:
|
||||
enable: true
|
||||
|
||||
# 鼠標點擊效果
|
||||
fireworks:
|
||||
# dark mode
|
||||
darkmode:
|
||||
enable: true
|
||||
# dark mode和 light mode切換按鈕
|
||||
button: true
|
||||
# 自動切換 dark mode和 light mode
|
||||
# autoChangeMode: 1 跟隨系統而變化,不支持的瀏覽器/系統將按照時間晚上6點到早上6點之間切換為 dark mode
|
||||
# autoChangeMode: 2 只按照時間晚上6點到早上6點之間切換為 dark mode
|
||||
# autoChangeMode: false 取消自動切換
|
||||
autoChangeMode: 1
|
||||
|
||||
#### other ####
|
||||
#------------------------------------------------
|
||||
|
||||
# 圖片大圖查看模式
|
||||
# 可選 medium_zoom 或者 fancybox
|
||||
# 只選一個 或者 兩個都不選
|
||||
#--------------------------------------------
|
||||
# medium_zoom https://github.com/francoischalifour/medium-zoom
|
||||
medium_zoom:
|
||||
enable: false
|
||||
|
||||
# fancybox http://fancyapps.com/fancybox/3/
|
||||
fancybox:
|
||||
enable: true
|
||||
|
||||
# Snackbar 彈窗
|
||||
# https://github.com/polonel/SnackBar
|
||||
# position 彈窗位置
|
||||
# 可選 top-left / top-center / top-right / bottom-left / bottom-center / bottom-right
|
||||
snackbar:
|
||||
enable: false
|
||||
position: bottom-left
|
||||
bg_light: "#49b1f5" #light mode時彈窗背景
|
||||
bg_dark: "#2d3035" #dark mode時彈窗背景
|
||||
|
||||
#百度推送
|
||||
baidu_push:
|
||||
enable: false
|
||||
|
||||
#https://instant.page/
|
||||
#prefetch預加載
|
||||
# https://instant.page/
|
||||
# prefetch預加載
|
||||
instantpage:
|
||||
enable: true
|
||||
|
||||
# https://github.com/vinta/pangu.js
|
||||
# 中英文之間添加空格
|
||||
pangu:
|
||||
enable: false
|
||||
field: page # page/post
|
||||
|
||||
# Note (Bootstrap Callout)
|
||||
# https://muse.theme-next.org/docs/tag-plugins/note
|
||||
note:
|
||||
# Note tag style values:
|
||||
# - simple bs-callout old alert style. Default.
|
||||
# - modern bs-callout new (v2-v3) alert style.
|
||||
# - flat flat callout style with background, like on Mozilla or StackOverflow.
|
||||
# - disabled disable all CSS styles import of note tag.
|
||||
style: simple
|
||||
style: flat
|
||||
icons: true
|
||||
border_radius: 3
|
||||
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
|
||||
# Offset also applied to label tag variables. This option can work with disabled note tag.
|
||||
light_bg_offset: 0
|
||||
|
||||
|
||||
#圖片懶加載
|
||||
# 圖片懶加載
|
||||
# https://github.com/aFarkas/lazysizes
|
||||
lazyload:
|
||||
enable: true
|
||||
script: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js
|
||||
|
||||
# 避免重複網址分散seo
|
||||
canonical: true
|
||||
|
||||
# 禁止百度轉碼
|
||||
disable_baidu_transformation: true
|
||||
|
||||
# twitter分享自動帶上樣式
|
||||
# https://i.loli.net/2019/09/08/qm3RfvUCKbct1Wz.png
|
||||
twitter_meta: true
|
||||
|
||||
# facebook QQ 等 分享自動帶上樣式
|
||||
# https://i.loli.net/2019/09/08/2wbFJEKloisRvhj.png
|
||||
Open_Graph_meta: true
|
||||
|
||||
# 開啟hexo自帶的緩存,加快生成速度
|
||||
fragment_cache: true
|
||||
|
||||
# CDN
|
||||
# 網站必須
|
||||
# 可根據需要自行添加js/css
|
||||
CDN_USE:
|
||||
css:
|
||||
- /css/index.css
|
||||
|
||||
js:
|
||||
- https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js #/js/third-party/jquery.min.js
|
||||
- /js/utils.js
|
||||
- /js/main.js
|
||||
|
||||
# CDN
|
||||
# 非必要不要修改
|
||||
CDN:
|
||||
# comments
|
||||
blueimp_md5: https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js
|
||||
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
|
||||
gitalk_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.2/dist/disqus.js
|
||||
disqusjs_css: https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqusjs.css
|
||||
utterances: https://utteranc.es/client.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/MathJax.js?config=TeX-AMS-MML_HTMLorMML
|
||||
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
|
||||
katex_copytex: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js
|
||||
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css
|
||||
mermaid: https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
|
||||
|
||||
# count
|
||||
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
|
||||
|
||||
# background effect
|
||||
canvas_ribbon: /js/third-party/canvas-ribbon.js
|
||||
canvas_ribbon_piao: /js/third-party/piao.js
|
||||
canvas_nest: /js/third-party/canvas-nest.js
|
||||
|
||||
lazyload: https://cdn.jsdelivr.net/npm/lazysizes@latest/lazysizes.min.js
|
||||
instantpage: https://cdn.jsdelivr.net/npm/instant.page@latest/instantpage.min.js
|
||||
typed: https://cdn.jsdelivr.net/npm/typed.js
|
||||
js_cookies: https://cdn.jsdelivr.net/npm/js-cookie/dist/js.cookie.min.js
|
||||
pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
|
||||
|
||||
# photo
|
||||
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
||||
fancybox: 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
|
||||
|
||||
# 鼠標點擊特效
|
||||
anime: https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js
|
||||
activate_power_mode: /js/third-party/activate-power-mode.js
|
||||
fireworks: /js/third-party/fireworks.js
|
||||
click_heart: /js/third-party/click_heart.js
|
||||
ClickShowText: /js/third-party/ClickShowText.js
|
||||
|
||||
# fontawesome
|
||||
fontawesome_v4: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
||||
fontawesome_v5: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
|
||||
|
||||
translate: /js/tw_cn.js
|
||||
|
||||
@@ -19,8 +19,6 @@ page:
|
||||
|
||||
sticky: Sticky
|
||||
no_title: No title
|
||||
archives: Archives
|
||||
read_more: Read more
|
||||
|
||||
post:
|
||||
created: Created
|
||||
@@ -28,11 +26,13 @@ post:
|
||||
wordcount: Word count
|
||||
min2read: "Reading time: %s min"
|
||||
page_pv: Post View
|
||||
comments: Comments
|
||||
copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
copyright_notice: Copyright Notice
|
||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||
recommend: Recommend
|
||||
|
||||
search: Search
|
||||
algolia_search:
|
||||
@@ -71,11 +71,8 @@ aside:
|
||||
|
||||
donate: Donate
|
||||
share: Share
|
||||
|
||||
bookmark:
|
||||
title: Bookmark
|
||||
message_prev: Press
|
||||
message_next: to bookmark this page
|
||||
|
||||
rightside:
|
||||
readmode_title: Read Mode
|
||||
@@ -83,5 +80,26 @@ rightside:
|
||||
font_minus_title: Decrease font size
|
||||
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
||||
night_mode_title: Dark Mode
|
||||
back_to_top: Back to top
|
||||
toc: Table of Contents
|
||||
scroll_to_comment: Scroll to comment
|
||||
setting: Setting
|
||||
|
||||
runtime_unit: days
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
source: Source
|
||||
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||
|
||||
Snackbar:
|
||||
bookmark:
|
||||
message_prev: Press
|
||||
message_next: to bookmark this page
|
||||
chs_to_cht: Traditional Chinese Activated Manually
|
||||
cht_to_chs: Simplified Chinese Activated Manually
|
||||
day_to_night: Dark Mode Activated Manually
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
error_title: Page not found
|
||||
|
||||
@@ -19,8 +19,6 @@ page:
|
||||
|
||||
sticky: Sticky
|
||||
no_title: No title
|
||||
archives: Archives
|
||||
read_more: Read more
|
||||
|
||||
post:
|
||||
created: Created
|
||||
@@ -28,11 +26,13 @@ post:
|
||||
wordcount: Word count
|
||||
min2read: "Reading time: %s min"
|
||||
page_pv: Post View
|
||||
comments: Comments
|
||||
copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
copyright_notice: Copyright Notice
|
||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||
recommend: Recommend
|
||||
|
||||
search: Search
|
||||
algolia_search:
|
||||
@@ -73,8 +73,6 @@ donate: Donate
|
||||
share: Share
|
||||
bookmark:
|
||||
title: Bookmark
|
||||
message_prev: Press
|
||||
message_next: to bookmark this page
|
||||
|
||||
rightside:
|
||||
readmode_title: Read Mode
|
||||
@@ -82,5 +80,26 @@ rightside:
|
||||
font_minus_title: Decrease font size
|
||||
translate_title: Traditional Chinese and Simplified Chinese Conversion
|
||||
night_mode_title: Dark Mode
|
||||
back_to_top: Back to top
|
||||
toc: Table of Contents
|
||||
scroll_to_comment: Scroll to comment
|
||||
setting: Setting
|
||||
|
||||
runtime_unit: days
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
source: Source
|
||||
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||
|
||||
Snackbar:
|
||||
bookmark:
|
||||
message_prev: Press
|
||||
message_next: to bookmark this page
|
||||
chs_to_cht: Traditional Chinese Activated Manually
|
||||
cht_to_chs: Simplified Chinese Activated Manually
|
||||
day_to_night: Dark Mode Activated Manually
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
error_title: Page not found
|
||||
|
||||
@@ -19,8 +19,6 @@ page:
|
||||
|
||||
sticky: 置顶
|
||||
no_title: 无题
|
||||
archives: 时间轴
|
||||
read_more: 阅读更多
|
||||
|
||||
post:
|
||||
created: 发表于
|
||||
@@ -28,11 +26,14 @@ post:
|
||||
wordcount: 字数总计
|
||||
min2read: "阅读时长: %s 分钟"
|
||||
page_pv: 阅读量
|
||||
comments: 评论数
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章链接
|
||||
copyright_notice: 版权声明
|
||||
copyright_content: '本博客所有文章除特别声明外,均采用 <a href="%s">%s</a> 许可协议。转载请注明来自 <a href="%s">%s</a>!'
|
||||
copyright_content: '本博客所有文章除特别声明外,均采用
|
||||
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 相关推荐
|
||||
|
||||
search: 搜索
|
||||
algolia_search:
|
||||
@@ -74,8 +75,6 @@ donate: 打赏
|
||||
share: 分享
|
||||
bookmark:
|
||||
title: 添加书签
|
||||
message_prev: 按
|
||||
message_next: 键将本页加入书签
|
||||
|
||||
rightside:
|
||||
readmode_title: 阅读模式
|
||||
@@ -83,5 +82,26 @@ rightside:
|
||||
font_minus_title: 缩小字体
|
||||
translate_title: 简繁转换
|
||||
night_mode_title: 夜间模式
|
||||
back_to_top: 回到顶部
|
||||
toc: 目录
|
||||
scroll_to_comment: 直达评论
|
||||
setting: 设置
|
||||
|
||||
runtime_unit: 天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 链接
|
||||
source: 来源
|
||||
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
||||
|
||||
Snackbar:
|
||||
bookmark:
|
||||
message_prev: 按
|
||||
message_next: 键将本页加入书签
|
||||
chs_to_cht: 你已切换为繁体
|
||||
cht_to_chs: 你已切换为简体
|
||||
day_to_night: 你已切换为深色模式
|
||||
night_to_day: 你已切换为浅色模式
|
||||
|
||||
error_title: 页面没有找到
|
||||
|
||||
@@ -19,8 +19,6 @@ page:
|
||||
|
||||
sticky: 置頂
|
||||
no_title: 無題
|
||||
archives: 時間軸
|
||||
read_more: 閲讀更多
|
||||
|
||||
post:
|
||||
created: 發表於
|
||||
@@ -28,12 +26,14 @@ post:
|
||||
wordcount: 字數總計
|
||||
min2read: "閲讀時長: %s 分鐘"
|
||||
page_pv: 閲讀量
|
||||
comments: 評論數
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章鏈接
|
||||
copyright_notice: 版權聲明
|
||||
copyright_content: '本博客所有文章除特別聲明外,均採用
|
||||
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 相關推薦
|
||||
|
||||
search: 搜索
|
||||
algolia_search:
|
||||
@@ -75,8 +75,6 @@ donate: 打賞
|
||||
share: 分享
|
||||
bookmark:
|
||||
title: 添加書籤
|
||||
message_prev: 按
|
||||
message_next: 鍵將本頁加入書籤
|
||||
|
||||
rightside:
|
||||
readmode_title: 閲讀模式
|
||||
@@ -84,5 +82,28 @@ rightside:
|
||||
font_minus_title: 縮小字體
|
||||
translate_title: 簡繁轉換
|
||||
night_mode_title: 夜間模式
|
||||
back_to_top: 回到頂部
|
||||
toc: 目錄
|
||||
scroll_to_comment: 直達評論
|
||||
setting: 設置
|
||||
|
||||
runtime_unit: 天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 鏈接
|
||||
source: 來源
|
||||
info: 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。
|
||||
|
||||
Snackbar:
|
||||
bookmark:
|
||||
message_prev: 按
|
||||
message_next: 鍵將本頁加入書籤
|
||||
chs_to_cht: 你已切換為繁體
|
||||
cht_to_chs: 你已切換為簡體
|
||||
day_to_night: 你已切換為深色模式
|
||||
night_to_day: 你已切換為淺色模式
|
||||
|
||||
error_title: 頁面沒有找到
|
||||
|
||||
|
||||
runtime_unit: 天
|
||||
87
layout/404.pug
Normal file
87
layout/404.pug
Normal file
@@ -0,0 +1,87 @@
|
||||
doctype html
|
||||
html(lang=config.language data-theme=theme.display_mode)
|
||||
head
|
||||
- var pageTitle = _p('error_title')
|
||||
- var tabTitle = pageTitle + ' | ' + config.title
|
||||
- var pageDescription = page.description || page.title || config.description
|
||||
- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var without_html = url.replace('index.html', '')
|
||||
- var top_img = theme.error_404.background || theme.default_top_img
|
||||
- var bg_img = `background-image: url(${top_img})`
|
||||
|
||||
|
||||
meta(charset='UTF-8')
|
||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5")
|
||||
title= tabTitle
|
||||
meta(name="description" content=pageDescription)
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
!=favicon_tag(theme.favicon || config.favicon)
|
||||
//- 預解析
|
||||
include includes/head/dns_prefetch.pug
|
||||
//- 網站驗證
|
||||
include includes/head/site_verification.pug
|
||||
//- Open_Graph
|
||||
include includes/head/Open_Graph.pug
|
||||
//- PWA
|
||||
if (theme.pwa && theme.pwa.enable)
|
||||
include includes/head/pwa
|
||||
|
||||
script(src=url_for(theme.CDN.js_cookies))
|
||||
|
||||
if theme.darkmode.enable
|
||||
include includes/head/darkmode.pug
|
||||
|
||||
each item in theme.CDN_USE.css
|
||||
link(rel='stylesheet', href=url_for(item))
|
||||
|
||||
if theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
|
||||
else
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
||||
|
||||
if theme.canonical
|
||||
link(rel="canonical" href=without_html)
|
||||
|
||||
if theme.algolia_search.enable
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
|
||||
script(src=url_for(theme.CDN.algolia_search) defer)
|
||||
|
||||
//- google_adsense
|
||||
include includes/head/google_adsense.pug
|
||||
|
||||
//- analytics
|
||||
include includes/head/analytics.pug
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||
|
||||
include includes/head/config.pug
|
||||
include includes/head/config_site.pug
|
||||
|
||||
body
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
nav#nav.error-no-found(style=bg_img)
|
||||
include includes/header/header.pug
|
||||
#error_info.is-center
|
||||
h1#error_title= '404'
|
||||
#error_subtitle= theme.error_404.subtitle
|
||||
include includes/mobile-sidebar/index.pug
|
||||
include includes/rightside.pug
|
||||
each item in theme.CDN_USE.js
|
||||
script(src=url_for(item))
|
||||
include includes/additional-js.pug
|
||||
include includes/search/index.pug
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
@@ -6,6 +5,4 @@ block content
|
||||
#archive
|
||||
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
include includes/pagination.pug
|
||||
@@ -1,11 +1,14 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#category
|
||||
.article-sort-title= _p('page.category') + ' - ' + page.category
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
|
||||
if theme.category_ui == 'index'
|
||||
include ./includes/mixins/UI.pug
|
||||
#recent-posts.recent-posts.category_ui
|
||||
+UI_NEW(page.posts)
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#category
|
||||
.article-sort-title= _p('page.category') + ' - ' + page.category
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
@@ -1,31 +1,20 @@
|
||||
.flink
|
||||
each i in site.data.link
|
||||
p.comment-word= i.class_name
|
||||
.post-cards
|
||||
ul.md-links
|
||||
each item in i.link_list
|
||||
li.md-links-item
|
||||
a(href=item.link title=item.name target="_blank")
|
||||
if theme.lazyload.enable
|
||||
img.lozad(data-src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||
else
|
||||
img(src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||
div(class="md-links-title")= item.name
|
||||
<br/>
|
||||
div(class="md-links-des")=item.descr
|
||||
|
||||
hr
|
||||
div
|
||||
p(style="font-size:15px;font-weight:bold")= theme.Flink.info_headline
|
||||
ul
|
||||
li= theme.Flink.name
|
||||
li= theme.Flink.address
|
||||
li= theme.Flink.avatar
|
||||
li= theme.Flink.info
|
||||
|
||||
hr
|
||||
.comment_int
|
||||
p.comment-word= theme.Flink.comment
|
||||
|
||||
#page
|
||||
.flink#article-container
|
||||
each i in site.data.link
|
||||
h2= i.class_name
|
||||
.post-cards
|
||||
.md-links
|
||||
each item in i.link_list
|
||||
.md-links-item
|
||||
a(href=item.link title=item.name target="_blank")
|
||||
if theme.lazyload.enable
|
||||
img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
||||
else
|
||||
img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
||||
.md-links-title= item.name
|
||||
.md-links-des= item.descr
|
||||
!= page.content
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
include includes/gallery/layout.pug
|
||||
@@ -1,20 +1,20 @@
|
||||
if (theme.algolia_search.enable)
|
||||
script(async src=url_for('/js/search/algolia.js'))
|
||||
if (theme.mathjax && theme.mathjax.enable)
|
||||
if(!is_tag() && !is_category() && !is_archive())
|
||||
include ./third-party/mathjax.pug
|
||||
if (theme.katex && theme.katex.enable)
|
||||
if(!is_tag() && !is_category() && !is_archive())
|
||||
include ./third-party/katex.pug
|
||||
if (theme.local_search && theme.local_search.enable)
|
||||
script(async src=url_for('/js/search/local-search.js'))
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
|
||||
if (theme.medium_zoom && theme.medium_zoom.enable)
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
|
||||
if (theme.fancybox && theme.fancybox.enable)
|
||||
script(src=url_for(theme.CDN.fancybox))
|
||||
|
||||
include ./math/index.pug
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
script(src='https://cdn.jsdelivr.net/npm/animejs@latest/anime.min.js')
|
||||
script(src=url_for('/js/third-party/fireworks.js'))
|
||||
script(src=url_for(theme.CDN.anime))
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
|
||||
if theme.nightshift.enable
|
||||
script(src=url_for('js/nightshift.js'))
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
script(src=url_for(theme.CDN.snackbar))
|
||||
|
||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
include ./third-party/canvas-ribbon.pug
|
||||
@@ -22,77 +22,44 @@ if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
||||
include ./third-party/canvas-ribbon-piao.pug
|
||||
|
||||
if theme.baidu_push && theme.baidu_push.enable
|
||||
script(src=url_for('js/baidupush.js'))
|
||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||
include ./third-party/canvas-nest.pug
|
||||
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for('js/activate-power-mode.js'))
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = true; // make power mode colorful
|
||||
POWERMODE.shake = true; // turn off shake
|
||||
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for('/js/tw_cn.js'))
|
||||
script.
|
||||
translateInitilization()
|
||||
|
||||
|
||||
if is_home() && theme.subtitle.enable
|
||||
script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9")
|
||||
script.
|
||||
var typed = new Typed(".subtitle", {
|
||||
strings: ['!{theme.subtitle.sub1}','!{theme.subtitle.sub2}'],
|
||||
startDelay: 300,
|
||||
typeSpeed: 100,
|
||||
loop: true,
|
||||
backSpeed: 50
|
||||
});
|
||||
|
||||
if is_home()
|
||||
script.
|
||||
//首頁fullpage
|
||||
function alignContent() {
|
||||
for (var n = $(window).height(), e = document.querySelectorAll(".full_page"), i = 0; i < e.length; i++)
|
||||
e[i].style.height = n + "px";
|
||||
$("#site-info").each(function () {
|
||||
var x = $(this).height();
|
||||
$(this).css("top", (n-x)/2)
|
||||
})
|
||||
}
|
||||
|
||||
function recent_post_padding() {
|
||||
$(".recent-post-info").each(function () {
|
||||
var k = $(".recent-post-item").height();
|
||||
var e = $(this).height();
|
||||
$(this).css({"padding-top": (k-e)/2 , "padding-bottom": (k-e)/2 })
|
||||
})
|
||||
}
|
||||
|
||||
alignContent();
|
||||
|
||||
//recent-post-item垂直置中
|
||||
if ($(window).width() > 768) {
|
||||
recent_post_padding();
|
||||
}
|
||||
|
||||
$(window).bind("resize", function () {
|
||||
|
||||
alignContent()
|
||||
|
||||
if ($(window).width() > 768) {
|
||||
recent_post_padding();
|
||||
}
|
||||
})
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||
script(async src=url_for(theme.CDN.busuanzi))
|
||||
|
||||
if theme.instantpage.enable
|
||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
||||
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.lazyload.script))
|
||||
script.
|
||||
const observer = lozad(); // lazy loads elements with default selector as '.lozad'
|
||||
observer.observe();
|
||||
script(src=url_for(theme.CDN.lazyload) async="")
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart && theme.click_heart.enable
|
||||
script(src=url_for(theme.CDN.click_heart))
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script(src=url_for(theme.CDN.ClickShowText))
|
||||
|
||||
if theme.pangu && theme.pangu.enable
|
||||
include ./third-party/pangu.pug
|
||||
|
||||
//- search
|
||||
if theme.algolia_search && theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
else if theme.local_search && theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
|
||||
//- mermaid
|
||||
if theme.mermaid.enable
|
||||
include ./math/mermaid.pug
|
||||
|
||||
if is_home()
|
||||
include index-js.pug
|
||||
@@ -1,21 +0,0 @@
|
||||
if theme.aside.card_author
|
||||
include widget/card_author.pug
|
||||
|
||||
if theme.aside.card_announcement
|
||||
include widget/card_announcement.pug
|
||||
|
||||
if theme.aside.card_recent_post
|
||||
include widget/card_recent_post.pug
|
||||
|
||||
if theme.aside.card_categories
|
||||
include widget/card_categories.pug
|
||||
|
||||
if theme.aside.card_tags
|
||||
include widget/card_tags.pug
|
||||
|
||||
if theme.aside.card_archives
|
||||
include widget/card_archives.pug
|
||||
|
||||
if theme.aside.card_webinfo
|
||||
include widget/card_webinfo.pug
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
if theme.disqus && theme.disqus.enable
|
||||
#disqus_thread
|
||||
script.
|
||||
var unused = null;
|
||||
var disqus_config = function () {
|
||||
this.page.url = '!{ page.permalink }';
|
||||
this.page.identifier = '!{ page.path }';
|
||||
this.page.title = '!{ page.title }';
|
||||
}
|
||||
#disqus_thread
|
||||
script.
|
||||
var disqus_config = function () {
|
||||
this.page.url = '!{ page.permalink }';
|
||||
this.page.identifier = '!{ page.path }';
|
||||
this.page.title = '!{ page.title }';
|
||||
};
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js";
|
||||
s.setAttribute('data-timestamp', '' + +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
|
||||
script.
|
||||
function getDisqusCount() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
||||
s.id = 'dsq-count-scr';
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
23
layout/includes/comments/disqusjs.pug
Normal file
23
layout/includes/comments/disqusjs.pug
Normal file
@@ -0,0 +1,23 @@
|
||||
#disqus_thread
|
||||
script(src=url_for(theme.CDN.disqusjs))
|
||||
script.
|
||||
var dsqjs = new DisqusJS({
|
||||
shortname: '!{theme.disqusjs.shortname}',
|
||||
siteName: "!{theme.disqusjs.siteName}",
|
||||
identifier: '!{ page.path }',
|
||||
url: '!{ page.permalink }',
|
||||
title: '!{ page.title }',
|
||||
api: '!{theme.disqusjs.api}',
|
||||
apikey: '!{theme.disqusjs.apikey}',
|
||||
admin: '!{theme.disqusjs.admin}',
|
||||
adminLabel: '!{theme.disqusjs.adminLabel}'
|
||||
});
|
||||
|
||||
script.
|
||||
function getDisqusCount() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
|
||||
s.id = 'dsq-count-scr';
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
@@ -1,13 +1,23 @@
|
||||
if theme.gitalk && theme.gitalk.enable
|
||||
#gitalk-container
|
||||
script.
|
||||
var gitalk = new Gitalk({
|
||||
clientID: '!{theme.gitalk.client_id}',
|
||||
clientSecret: '!{theme.gitalk.client_secret}',
|
||||
repo: '!{theme.gitalk.repo}',
|
||||
owner: '!{theme.gitalk.owner}',
|
||||
admin: '!{theme.gitalk.admin}',
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
language: '!{lang}'
|
||||
})
|
||||
gitalk.render('gitalk-container')
|
||||
#gitalk-container
|
||||
script.
|
||||
var gitalk = new Gitalk({
|
||||
clientID: '!{theme.gitalk.client_id}',
|
||||
clientSecret: '!{theme.gitalk.client_secret}',
|
||||
repo: '!{theme.gitalk.repo}',
|
||||
owner: '!{theme.gitalk.owner}',
|
||||
admin: ['!{theme.gitalk.admin}'],
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
language: '!{theme.gitalk.language}',
|
||||
perPage: '!{theme.gitalk.perPage}',
|
||||
distractionFreeMode: !{theme.gitalk.distractionFreeMode},
|
||||
pagerDirection: '!{theme.gitalk.pagerDirection}',
|
||||
createIssueManually: !{theme.gitalk.createIssueManually},
|
||||
updateCountCallback: commentCount
|
||||
})
|
||||
gitalk.render('gitalk-container')
|
||||
|
||||
function commentCount(n){
|
||||
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
if theme.gitment && theme.gitment.enable
|
||||
#gitment-container
|
||||
script.
|
||||
var gitment = new Gitment({
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
owner: '!{theme.gitment.owner}',
|
||||
repo: '!{theme.gitment.repo}',
|
||||
oauth: {
|
||||
client_id: '!{theme.gitment.client_id}',
|
||||
client_secret: '!{theme.gitment.client_secret}'
|
||||
}
|
||||
})
|
||||
gitment.render('gitment-container')
|
||||
@@ -1,35 +1,26 @@
|
||||
if theme.disqus && theme.disqus.enable
|
||||
- var d = theme.disqus && theme.disqus.enable
|
||||
- var dj = theme.disqusjs && theme.disqusjs.enable
|
||||
- var l = theme.laibili && theme.laibili.enable
|
||||
- var gt = theme.gitalk && theme.gitalk.enable
|
||||
- var v = theme.valine && theme.valine.enable
|
||||
- var u = theme.utterances && theme.utterances.enable
|
||||
- var isComment = d || dj || l || gt || v || u
|
||||
|
||||
if isComment
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
span= ' ' + _p('comment')
|
||||
include ./disqus.pug
|
||||
else if theme.laibili && theme.laibili.enable
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
span= ' ' + _p('comment')
|
||||
include ./laibili.pug
|
||||
else if theme.gitment && theme.gitment.enable
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
span= ' ' + _p('comment')
|
||||
include ./gitment.pug
|
||||
else if theme.gitalk && theme.gitalk.enable
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
span= ' ' + _p('comment')
|
||||
include ./gitalk.pug
|
||||
else if theme.valine && theme.valine.enable
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
span= ' ' + _p('comment')
|
||||
include ./valine.pug
|
||||
if d
|
||||
include ./disqus.pug
|
||||
else if dj
|
||||
include ./disqusjs.pug
|
||||
else if l
|
||||
include ./laibili.pug
|
||||
else if gt
|
||||
include ./gitalk.pug
|
||||
else if v
|
||||
include ./valine.pug
|
||||
else if u
|
||||
include ./utterances.pug
|
||||
@@ -1,11 +1,10 @@
|
||||
if theme.laibili && theme.laibili.enable
|
||||
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
||||
script.
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
||||
script.
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
|
||||
19
layout/includes/comments/utterances.pug
Normal file
19
layout/includes/comments/utterances.pug
Normal file
@@ -0,0 +1,19 @@
|
||||
script#utterances_comment(src=theme.CDN.utterances
|
||||
repo=theme.utterances.repo
|
||||
issue-term=theme.utterances.issue_term
|
||||
theme=theme.utterances.light_theme
|
||||
crossorigin="anonymous"
|
||||
async)
|
||||
script.
|
||||
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
document.getElementById('utterances_comment').setAttribute('theme',themeNow)
|
||||
|
||||
function utterancesTheme () {
|
||||
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
const message = {
|
||||
type: 'set-theme',
|
||||
theme: theme
|
||||
};
|
||||
const iframe = document.querySelector('.utterances-frame');
|
||||
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||
}
|
||||
@@ -1,25 +1,23 @@
|
||||
if theme.valine && theme.valine.enable
|
||||
#vcomment.vcomment
|
||||
script(src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js')
|
||||
script.
|
||||
var notify = '#{ theme.valine.notify }' == true ? true : false;
|
||||
var verify = '#{ theme.valine.verify }' == true ? true : false;
|
||||
var GUEST_INFO = ['nick','mail','link'];
|
||||
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
|
||||
return GUEST_INFO.indexOf(item) > -1
|
||||
});
|
||||
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
|
||||
#vcomment.vcomment
|
||||
script(src=url_for(theme.CDN.valine))
|
||||
script.
|
||||
var GUEST_INFO = ['nick','mail','link'];
|
||||
var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
|
||||
return GUEST_INFO.indexOf(item) > -1
|
||||
});
|
||||
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
|
||||
|
||||
window.valine = new Valine({
|
||||
el:'#vcomment',
|
||||
notify:notify,
|
||||
verify:verify,
|
||||
appId:'#{theme.valine.appId}',
|
||||
appKey:'#{theme.valine.appKey}',
|
||||
placeholder:'#{theme.valine.placeholder}',
|
||||
avatar:'#{theme.valine.avatar}',
|
||||
guest_info:guest_info,
|
||||
pageSize:'#{theme.valine.pageSize}',
|
||||
lang:'#{theme.valine.lang}',
|
||||
recordIP: true
|
||||
});
|
||||
window.valine = new Valine({
|
||||
el:'#vcomment',
|
||||
notify: #{theme.valine.notify},
|
||||
verify: #{theme.valine.verify},
|
||||
appId: '#{theme.valine.appId}',
|
||||
appKey: '#{theme.valine.appKey}',
|
||||
placeholder: '#{theme.valine.placeholder}',
|
||||
avatar: '#{theme.valine.avatar}',
|
||||
meta: guest_info,
|
||||
pageSize: '#{theme.valine.pageSize}',
|
||||
lang: '#{theme.valine.lang}',
|
||||
recordIP: #{theme.valine.recordIP},
|
||||
serverURLs: '#{theme.valine.serverURLs}'
|
||||
});
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
-
|
||||
var algolia = 'undefined';
|
||||
var env = process.env;
|
||||
if (theme.algolia_search.enable) {
|
||||
algolia = JSON.stringify({
|
||||
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
|
||||
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
|
||||
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
|
||||
hits: theme.algolia_search.hits,
|
||||
// search languages
|
||||
languages: {
|
||||
input_placeholder: _p("algolia_search.input_placeholder"),
|
||||
hits_empty: _p("algolia_search.hits_empty"),
|
||||
hits_stats: _p("algolia_search.hits_stats")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var localSearch = 'undefined';
|
||||
if (theme.local_search && theme.local_search.enable) {
|
||||
localSearch = JSON.stringify({
|
||||
path: config.search.path,
|
||||
languages: {
|
||||
// search languages
|
||||
hits_empty: _p("local_search.hits_empty")
|
||||
}
|
||||
})
|
||||
}
|
||||
var translate = 'undefined';
|
||||
if (theme.translate && theme.translate.enable){
|
||||
var defaultEncoding;
|
||||
translate = JSON.stringify({
|
||||
defaultEncoding: theme.translate.defaultEncoding,
|
||||
translateDelay: theme.translate.translateDelay,
|
||||
cookieDomain: theme.translate.cookieDomain,
|
||||
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
script.
|
||||
var GLOBAL_CONFIG = {
|
||||
root: '!{config.root}',
|
||||
algolia: !{algolia},
|
||||
localSearch: !{localSearch},
|
||||
translate: !{translate},
|
||||
highlight_copy: '!{theme.highlight_copy}',
|
||||
copy: {
|
||||
success: '!{_p("copy.success")}',
|
||||
error: '!{_p("copy.error")}',
|
||||
noSupport: '!{_p("copy.noSupport")}'
|
||||
},
|
||||
bookmark: {
|
||||
title: '!{_p("bookmark.title")}',
|
||||
message_prev: '!{_p("bookmark.message_prev")}',
|
||||
message_next: '!{_p("bookmark.message_next")}'
|
||||
},
|
||||
runtime_unit: '!{_p("runtime_unit")}'
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#footer.layout
|
||||
#footer-wrap
|
||||
- var now = new Date()
|
||||
- var nowYear = now.getFullYear()
|
||||
if theme.since && theme.since != nowYear
|
||||
@@ -8,7 +8,7 @@
|
||||
if theme.footer_copyright.enable
|
||||
.framework-info
|
||||
span= _p('footer.driven') + ' '
|
||||
a(href='http://hexo.io')
|
||||
a(href='https://hexo.io')
|
||||
span Hexo
|
||||
span.footer-separator |
|
||||
span= _p('footer.theme') + ' '
|
||||
@@ -19,4 +19,6 @@
|
||||
if theme.ICP.enable
|
||||
.icp
|
||||
a(href=theme.ICP.url)
|
||||
if theme.ICP.icon
|
||||
img.icp-icon(src=url_for(theme.ICP.icon))
|
||||
span=theme.ICP.text
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#gallery!= page.content
|
||||
@@ -1,118 +1,99 @@
|
||||
- var without_index = url.replace('index.html', '')
|
||||
- var without_html = without_index.replace('.html', '')
|
||||
- var photo_check = page.cover || theme.avatar
|
||||
- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
||||
- var pageTitle = page.title || config.title || ''
|
||||
- if (is_archive()) pageTitle = _p('page.archives')
|
||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||
- if (is_year()) pageTitle += ': ' + page.year
|
||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||
- pageTitle ? '' : pageTitle = config.title || ''
|
||||
|
||||
meta(http-equiv="x-dns-prefetch-control" content="on")
|
||||
if theme.canonical
|
||||
link(rel="canonical" href=without_html)
|
||||
- var pageDescription = page.description || page.title || config.description
|
||||
- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var without_html = url.replace('index.html', '')
|
||||
|
||||
if theme.twitter_meta
|
||||
meta(name="twitter:card" content="summary_large_image")
|
||||
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
||||
meta(name="twitter:description" content=pageDescription)
|
||||
meta(name="twitter:image" content=photo_link)
|
||||
|
||||
if theme.Open_Graph_meta
|
||||
if is_post()
|
||||
meta(property="og:type" content="article")
|
||||
else
|
||||
meta(property="og:type" content="website")
|
||||
|
||||
meta(property="og:title" content=pageTitle_no_include_blog_name)
|
||||
meta(property="og:url" content=without_html)
|
||||
meta(property="og:site_name" content=config.title)
|
||||
meta(property="og:description" content=pageDescription)
|
||||
meta(property="og:image" content=photo_link)
|
||||
meta(charset='UTF-8')
|
||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||
meta(name="viewport" content="width=device-width,initial-scale=1")
|
||||
title= tabTitle
|
||||
meta(name="description" content=pageDescription)
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
!=favicon_tag(theme.favicon || config.favicon)
|
||||
|
||||
if theme.disable_baidu_transformation
|
||||
meta(http-equiv="Cache-Control" content="no-transform")
|
||||
meta(http-equiv="Cache-Control" content="no-siteapp")
|
||||
|
||||
if page.hide == true
|
||||
meta(name="robots" content="noindex")
|
||||
|
||||
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
|
||||
meta(name="referrer" content="no-referrer")
|
||||
|
||||
//- 預解析
|
||||
!=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- 網站驗證
|
||||
!=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- Open_Graph
|
||||
include ./head/Open_Graph.pug
|
||||
|
||||
//- PWA
|
||||
if (theme.pwa && theme.pwa.enable)
|
||||
!=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
|
||||
|
||||
script(src=url_for(theme.CDN.js_cookies))
|
||||
|
||||
if theme.darkmode.enable
|
||||
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
|
||||
|
||||
each item in theme.CDN_USE.css
|
||||
link(rel='stylesheet', href=url_for(item))
|
||||
|
||||
if theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
|
||||
else
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
|
||||
|
||||
if (theme.fancybox && theme.fancybox.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
||||
|
||||
if theme.canonical
|
||||
link(rel="canonical" href=without_html)
|
||||
|
||||
if is_post()
|
||||
if(page.prev)
|
||||
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
||||
if(page.next)
|
||||
link(rel="next" title=page.next.title href=url_for(page.next.permalink) )
|
||||
|
||||
|
||||
if theme.algolia_search.enable
|
||||
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
|
||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css")
|
||||
script(src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js" defer)
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.algolia_search_css))
|
||||
script(src=url_for(theme.CDN.algolia_search) defer)
|
||||
|
||||
if (theme.gitment && theme.gitment.enable)
|
||||
link(rel="dns-prefetch" href="https://unpkg.com")
|
||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitment/style/default.min.css")
|
||||
script(src="https://cdn.jsdelivr.net/npm/gitment/dist/gitment.browser.min.js")
|
||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
||||
if (theme.gitalk && theme.gitalk.enable)
|
||||
link(rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css")
|
||||
if(theme.gitalk.js)
|
||||
script(src=theme.gitalk.js)
|
||||
else
|
||||
script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js")
|
||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js")
|
||||
//- comment css
|
||||
include ./head/comment.pug
|
||||
|
||||
//- google_adsense
|
||||
!=partial('includes/head/google_adsense', {}, {cache:theme.fragment_cache})
|
||||
|
||||
|
||||
if (theme.pwa && theme.pwa.enable)
|
||||
link(rel="manifest" href=theme.pwa.manifest)
|
||||
if(theme.pwa.theme_color)
|
||||
meta(name="theme-color" content=theme.pwa.theme_color)
|
||||
if(theme.pwa.theme_color)
|
||||
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
||||
if(theme.pwa.apple_touch_icon)
|
||||
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon)
|
||||
if(theme.pwa.favicon_32_32)
|
||||
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32)
|
||||
if(theme.pwa.favicon_16_16)
|
||||
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
||||
if(theme.pwa.mask_icon)
|
||||
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
||||
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
||||
script.
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
if theme.google_analytics
|
||||
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
||||
script.
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '!{theme.google_analytics}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
if theme.google_site_verification
|
||||
meta(name="google-site-verification" content=theme.google_site_verification)
|
||||
|
||||
if theme.bing_site_verification
|
||||
meta(name="msvalidate.01" content=theme.bing_site_verification)
|
||||
|
||||
if theme.baidu_site_verification
|
||||
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
|
||||
|
||||
if theme.qihu_site_verification
|
||||
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
||||
|
||||
|
||||
- var preload_archive_img = theme.archive_img ||theme.top_img || config.top_img
|
||||
- var preload_img = page.top_img || theme.top_img || config.top_img
|
||||
|
||||
if (is_archive() && preload_archive_img)
|
||||
link(rel="preload" href=url_for(preload_archive_img) as="image" )
|
||||
else if (!is_post() && preload_img)
|
||||
link(rel="preload" href=url_for(preload_img) as="image" )
|
||||
//- analytics
|
||||
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||
|
||||
//- global config
|
||||
!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
|
||||
include ./head/config_site.pug
|
||||
|
||||
17
layout/includes/head/Open_Graph.pug
Normal file
17
layout/includes/head/Open_Graph.pug
Normal file
@@ -0,0 +1,17 @@
|
||||
- var contentType = is_post() ? 'article' : 'website'
|
||||
|
||||
//- twitter meta
|
||||
if theme.twitter_meta
|
||||
meta(name="twitter:card" content="summary")
|
||||
meta(name="twitter:title" content=pageTitle)
|
||||
meta(name="twitter:description" content=pageDescription)
|
||||
meta(name="twitter:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||
|
||||
//- Open_Graph
|
||||
if theme.Open_Graph_meta
|
||||
meta(property="og:type" content=contentType)
|
||||
meta(property="og:title" content=pageTitle)
|
||||
meta(property="og:url" content=without_html)
|
||||
meta(property="og:site_name" content=config.title)
|
||||
meta(property="og:description" content=pageDescription)
|
||||
meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||
22
layout/includes/head/analytics.pug
Normal file
22
layout/includes/head/analytics.pug
Normal file
@@ -0,0 +1,22 @@
|
||||
if theme.baidu_analytics
|
||||
script.
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
|
||||
if theme.google_analytics
|
||||
script.
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '!{theme.google_analytics}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
if theme.tencent_analytics
|
||||
script(src=`https://tajs.qq.com/stats?sId=${theme.tencent_analytics}` charset="UTF-8")
|
||||
8
layout/includes/head/comment.pug
Normal file
8
layout/includes/head/comment.pug
Normal file
@@ -0,0 +1,8 @@
|
||||
if (theme.disqusjs && theme.disqusjs.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))
|
||||
|
||||
if (theme.gitalk && theme.gitalk.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.gitalk_css))
|
||||
script(src=url_for(theme.CDN.gitalk))
|
||||
script(src=url_for(theme.CDN.blueimp_md5))
|
||||
|
||||
119
layout/includes/head/config.pug
Normal file
119
layout/includes/head/config.pug
Normal file
@@ -0,0 +1,119 @@
|
||||
-
|
||||
var algolia = 'undefined';
|
||||
var env = process.env;
|
||||
if (theme.algolia_search.enable) {
|
||||
algolia = JSON.stringify({
|
||||
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
|
||||
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
|
||||
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
|
||||
hits: theme.algolia_search.hits,
|
||||
// search languages
|
||||
languages: {
|
||||
input_placeholder: _p("algolia_search.input_placeholder"),
|
||||
hits_empty: _p("algolia_search.hits_empty"),
|
||||
hits_stats: _p("algolia_search.hits_stats")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var localSearch = 'undefined';
|
||||
if (theme.local_search && theme.local_search.enable) {
|
||||
localSearch = JSON.stringify({
|
||||
path: config.search.path,
|
||||
languages: {
|
||||
// search languages
|
||||
hits_empty: _p("local_search.hits_empty")
|
||||
}
|
||||
})
|
||||
}
|
||||
var translate = 'undefined';
|
||||
if (theme.translate && theme.translate.enable){
|
||||
translate = JSON.stringify({
|
||||
defaultEncoding: theme.translate.defaultEncoding,
|
||||
translateDelay: theme.translate.translateDelay,
|
||||
cookieDomain: theme.translate.cookieDomain,
|
||||
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
||||
})
|
||||
}
|
||||
|
||||
var copyright = 'undefined' ;
|
||||
if (theme.copy.enable && theme.copy.copyright){
|
||||
copyright = JSON.stringify({
|
||||
languages: {
|
||||
author: _p("copy_copyright.author") + ': ' + config.author,
|
||||
link: _p("copy_copyright.link") + ': ' + without_html,
|
||||
source: _p("copy_copyright.source") + ': ' + config.title,
|
||||
info: _p("copy_copyright.info")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var ClickShowText = 'undefined';
|
||||
if (theme.ClickShowText && theme.ClickShowText.enable) {
|
||||
ClickShowText = JSON.stringify({
|
||||
text: theme.ClickShowText.text.join(","),
|
||||
fontSize: theme.ClickShowText.fontSize
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
var Snackbar = 'undefined';
|
||||
if (theme.snackbar && theme.snackbar.enable) {
|
||||
Snackbar = JSON.stringify({
|
||||
bookmark: {
|
||||
title: _p("Snackbar.bookmark.title"),
|
||||
message_prev: _p("Snackbar.bookmark.message_prev"),
|
||||
message_next: _p("Snackbar.bookmark.message_next")
|
||||
},
|
||||
chs_to_cht: _p("Snackbar.chs_to_cht"),
|
||||
cht_to_chs: _p("Snackbar.cht_to_chs"),
|
||||
day_to_night: _p("Snackbar.day_to_night"),
|
||||
night_to_day: _p("Snackbar.night_to_day"),
|
||||
bgLight: theme.snackbar.bg_light,
|
||||
bgDark: theme.snackbar.bg_dark,
|
||||
position: theme.snackbar.position,
|
||||
})
|
||||
}
|
||||
|
||||
var highlightCopy = theme.highlight_copy
|
||||
var highlightLang = theme.highlight_lang
|
||||
var highlightShrink = theme.highlight_shrink
|
||||
var runtime = theme.runtimeshow.enable
|
||||
var fancybox = theme.fancybox.enable
|
||||
var medium_zoom = theme.medium_zoom.enable
|
||||
var baiduPush = theme.baidu_push && theme.baidu_push.enable
|
||||
var isFontAwesomeV5 = theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||
|
||||
|
||||
script.
|
||||
var GLOBAL_CONFIG = {
|
||||
root: '!{config.root}',
|
||||
algolia: !{algolia},
|
||||
localSearch: !{localSearch},
|
||||
translate: !{translate},
|
||||
copy: {
|
||||
success: '!{_p("copy.success")}',
|
||||
error: '!{_p("copy.error")}',
|
||||
noSupport: '!{_p("copy.noSupport")}'
|
||||
},
|
||||
bookmark: {
|
||||
title: '!{_p("Snackbar.bookmark.title")}',
|
||||
message_prev: '!{_p("Snackbar.bookmark.message_prev")}',
|
||||
message_next: '!{_p("Snackbar.bookmark.message_next")}'
|
||||
},
|
||||
runtime_unit: '!{_p("runtime_unit")}',
|
||||
runtime: !{runtime},
|
||||
copyright: !{copyright},
|
||||
ClickShowText: !{ClickShowText},
|
||||
medium_zoom: !{medium_zoom},
|
||||
fancybox: !{fancybox},
|
||||
Snackbar: !{Snackbar},
|
||||
baiduPush: !{baiduPush},
|
||||
highlightCopy: !{highlightCopy},
|
||||
highlightLang: !{highlightLang},
|
||||
highlightShrink: !{highlightShrink},
|
||||
isFontAwesomeV5: !{isFontAwesomeV5}
|
||||
|
||||
}
|
||||
|
||||
6
layout/includes/head/config_site.pug
Normal file
6
layout/includes/head/config_site.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
script.
|
||||
var GLOBAL_CONFIG_SITE = {
|
||||
isPost: !{is_post()},
|
||||
isHome: !{is_home()}
|
||||
}
|
||||
|
||||
47
layout/includes/head/darkmode.pug
Normal file
47
layout/includes/head/darkmode.pug
Normal file
@@ -0,0 +1,47 @@
|
||||
script.
|
||||
const autoChangeMode = '#{theme.darkmode.autoChangeMode}'
|
||||
var t = Cookies.get("theme")
|
||||
if (autoChangeMode == '1'){
|
||||
const isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
const isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
const isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
|
||||
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||
|
||||
if (t === undefined){
|
||||
if (isLightMode) activateLightMode()
|
||||
else if (isDarkMode) activateDarkMode()
|
||||
else if (isNotSpecified || hasNoSupport){
|
||||
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
|
||||
now = new Date();
|
||||
hour = now.getHours();
|
||||
isNight = hour < 6 || hour >= 18
|
||||
isNight ? activateDarkMode() : activateLightMode()
|
||||
}
|
||||
} else if (t == 'light') activateLightMode()
|
||||
else activateDarkMode()
|
||||
|
||||
} else if (autoChangeMode == '2'){
|
||||
now = new Date();
|
||||
hour = now.getHours();
|
||||
isNight = hour < 6 || hour >= 18
|
||||
if(t === undefined) isNight? activateDarkMode() : activateLightMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
else activateDarkMode()
|
||||
} else {
|
||||
if ( t == 'dark' ) activateDarkMode()
|
||||
else if ( t == 'light') activateLightMode()
|
||||
}
|
||||
|
||||
function activateDarkMode(){
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content','#000')
|
||||
}
|
||||
}
|
||||
function activateLightMode(){
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content','#fff')
|
||||
}
|
||||
}
|
||||
|
||||
16
layout/includes/head/dns_prefetch.pug
Normal file
16
layout/includes/head/dns_prefetch.pug
Normal file
@@ -0,0 +1,16 @@
|
||||
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||
|
||||
if theme.google_analytics
|
||||
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="https://hm.baidu.com")
|
||||
|
||||
if theme.tencent_analytics
|
||||
link(rel="preconnect" href="http://ta.qq.com")
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
7
layout/includes/head/google_adsense.pug
Normal file
7
layout/includes/head/google_adsense.pug
Normal file
@@ -0,0 +1,7 @@
|
||||
if (theme.google_adsense && theme.google_adsense.enable)
|
||||
script(async src=theme.google_adsense.js)
|
||||
script.
|
||||
(adsbygoogle = window.adsbygoogle || []).push({
|
||||
google_ad_client: '!{theme.google_adsense.client}',
|
||||
enable_page_level_ads: '!{theme.google_adsense.enable_page_level_ads}'
|
||||
});
|
||||
13
layout/includes/head/pwa.pug
Normal file
13
layout/includes/head/pwa.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
link(rel="manifest" href=theme.pwa.manifest)
|
||||
if(theme.pwa.theme_color)
|
||||
meta(name="theme-color" content=theme.pwa.theme_color)
|
||||
if(theme.pwa.theme_color)
|
||||
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
||||
if(theme.pwa.apple_touch_icon)
|
||||
link(rel="apple-touch-icon" sizes="180x180" href=theme.pwa.apple_touch_icon)
|
||||
if(theme.pwa.favicon_32_32)
|
||||
link(rel="icon" type="image/png" sizes="32x32" href=theme.pwa.favicon_32_32)
|
||||
if(theme.pwa.favicon_16_16)
|
||||
link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16)
|
||||
if(theme.pwa.mask_icon)
|
||||
link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5")
|
||||
11
layout/includes/head/site_verification.pug
Normal file
11
layout/includes/head/site_verification.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
if theme.google_site_verification
|
||||
meta(name="google-site-verification" content=theme.google_site_verification)
|
||||
|
||||
if theme.bing_site_verification
|
||||
meta(name="msvalidate.01" content=theme.bing_site_verification)
|
||||
|
||||
if theme.baidu_site_verification
|
||||
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
|
||||
|
||||
if theme.qihu_site_verification
|
||||
meta(name="360-site-verification" content=theme.qihu_site_verification)
|
||||
@@ -1,26 +0,0 @@
|
||||
#page-header
|
||||
span.pull-left
|
||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||
//- i.fa.fa-bars.toggle-menu.pull-right(aria-hidden="true")
|
||||
.open.toggle-menu.pull-right
|
||||
.menu-icon-first
|
||||
.menu-icon-second
|
||||
.menu-icon-third
|
||||
|
||||
span.pull-right.menus
|
||||
.mobile_author_icon
|
||||
img.lozad(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
.mobile_author-info__description= config.description
|
||||
hr
|
||||
.menus_item
|
||||
each value, label in theme.menu
|
||||
a.site-page(href=value.split('||')[0])
|
||||
i.fa-fw(class=value.split('||')[1])
|
||||
span=' '+label
|
||||
script.
|
||||
document.body.addEventListener('touchstart', function(){ });
|
||||
span.pull-right
|
||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||
a.site-page.social-icon.search
|
||||
i.fa.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
15
layout/includes/header/header.pug
Normal file
15
layout/includes/header/header.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
#page-header
|
||||
span#blog_name.pull_left
|
||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||
span.toggle-menu.pull_right.close
|
||||
a.site-page
|
||||
i.fa.fa-bars.fa-fw(aria-hidden="true")
|
||||
span.pull_right.menus
|
||||
.menus_items
|
||||
include ./menu_item.pug
|
||||
|
||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||
span#search_button.pull_right
|
||||
a.site-page.social-icon.search
|
||||
i.fa.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
45
layout/includes/header/index.pug
Normal file
45
layout/includes/header/index.pug
Normal file
@@ -0,0 +1,45 @@
|
||||
if is_home()
|
||||
- var top_img = theme.index_img || theme.default_top_img
|
||||
else if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
||||
else if is_archive()
|
||||
- var top_img = theme.archive_img || theme.default_top_img
|
||||
else if is_tag()
|
||||
- var top_img = theme.tag_img || theme.default_top_img
|
||||
else if is_category()
|
||||
- var top_img = theme.category_img || theme.default_top_img
|
||||
else
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
|
||||
if theme.douban
|
||||
if is_current('/movies/', [strict])
|
||||
- var top_img = theme.douban.movies_img || theme.default_top_img
|
||||
else if is_current('/books/', [strict])
|
||||
- var top_img = theme.douban.books_img || theme.default_top_img
|
||||
else if is_current('/games/', [strict])
|
||||
- var top_img = theme.douban.games_img || theme.default_top_img
|
||||
|
||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
||||
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
|
||||
#nav(class=isHomeClass style=bg_img)
|
||||
!=partial('includes/header/header', {}, {cache:theme.fragment_cache})
|
||||
if is_home()
|
||||
#site-info
|
||||
h1#site_title=site_title
|
||||
#site_subtitle
|
||||
span#subtitle
|
||||
if(theme.social)
|
||||
#site_social_icons
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=url target="_blank")
|
||||
i(class=icon aria-hidden="true")
|
||||
#scroll_down
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
else if is_post()
|
||||
include ./post-info.pug
|
||||
else
|
||||
#page_site-info
|
||||
h1#site_title=site_title
|
||||
18
layout/includes/header/menu_item.pug
Normal file
18
layout/includes/header/menu_item.pug
Normal file
@@ -0,0 +1,18 @@
|
||||
each value, label in theme.menu
|
||||
if !Array.isArray(value)
|
||||
.menus_item
|
||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||
i.fa-fw(class=trim(value.split('||')[1]))
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page
|
||||
i.fa-fw(class=trim(label.split('||')[1]) aria-hidden="true")
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
||||
ul.menus_item_child
|
||||
each i in value
|
||||
li
|
||||
a.site-page(href=url_for(trim(i.split('||')[1])))
|
||||
i.fa-fw(class=trim(i.split('||')[2]))
|
||||
span=' '+trim(i.split('||')[0])
|
||||
65
layout/includes/header/post-info.pug
Normal file
65
layout/includes/header/post-info.pug
Normal file
@@ -0,0 +1,65 @@
|
||||
#post-info
|
||||
#post-title
|
||||
.posttitle= page.title || _p('no_title')
|
||||
#post-meta
|
||||
if (theme.post_meta.post.date_type)
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
|
||||
|
||||
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta__separator |
|
||||
span
|
||||
each item, index in page.categories.data
|
||||
i.fa.fa-inbox.post-meta__icon.fa-fw(aria-hidden="true")
|
||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.fa.fa-angle-right.fa-fw(aria-hidden="true")
|
||||
.post-meta-wordcount
|
||||
if (theme.wordcount && theme.wordcount.enable)
|
||||
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
|
||||
i.post-meta__icon.fa-fw(class=wordCountIcon aria-hidden="true")
|
||||
span= _p('post.wordcount') + ':'
|
||||
span.word-count= wordcount(page.content)
|
||||
span.post-meta__separator |
|
||||
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
|
||||
i.post-meta__icon.fa-fw(class=readCountIcon aria-hidden="true")
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
.post-meta-pv-cv
|
||||
if (theme.wordcount && theme.wordcount.enable && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
if theme.busuanzi.page_pv
|
||||
i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
|
||||
span=_p('post.page_pv') + ':'
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
- var commentCount = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-comments' : 'fa fa-comment-o'
|
||||
if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
span.disqus-comment-count.comment-count
|
||||
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||
if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||
if (theme.busuanzi && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-comment-count.comment-count
|
||||
116
layout/includes/index-js.pug
Normal file
116
layout/includes/index-js.pug
Normal file
@@ -0,0 +1,116 @@
|
||||
if theme.subtitle.enable
|
||||
- let source = theme.subtitle.source
|
||||
- let subtitleEffect = theme.subtitle.effect
|
||||
|
||||
if subtitleEffect
|
||||
script(src=url_for(theme.CDN.typed))
|
||||
|
||||
if source == '1'
|
||||
script.
|
||||
let subtitleEffect = !{subtitleEffect}
|
||||
fetch('https://api.ooopn.com/ciba/api.php',)
|
||||
.then(function (res){
|
||||
return res.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect){
|
||||
let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
||||
let both = sub.unshift(data['ciba-en'],data.ciba)
|
||||
let typed = new Typed("#subtitle", {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
});
|
||||
}else{
|
||||
document.getElementById("subtitle").innerHTML = data['ciba-en']
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err);
|
||||
})
|
||||
|
||||
else if source == '2'
|
||||
script.
|
||||
let subtitleEffect = !{subtitleEffect}
|
||||
fetch('https://v1.hitokoto.cn')
|
||||
.then(function (res){
|
||||
return res.json();
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect){
|
||||
let from = '出自 ' + data.from
|
||||
let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
||||
let both = sub.unshift(data.hitokoto,from)
|
||||
let typed = new Typed("#subtitle", {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
});
|
||||
}else{
|
||||
document.getElementById("subtitle").innerHTML = data.hitokoto
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err);
|
||||
})
|
||||
|
||||
else if source == "3"
|
||||
script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
|
||||
script.
|
||||
let subtitleEffect = !{subtitleEffect}
|
||||
let con = str[0];
|
||||
if (subtitleEffect){
|
||||
let from = "出自 " + str[1];
|
||||
let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
||||
let both = sub.unshift(con,from)
|
||||
let typed = new Typed("#subtitle", {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
});
|
||||
}else{
|
||||
document.getElementById("subtitle").innerHTML = con
|
||||
}
|
||||
|
||||
else if source == '4'
|
||||
script(type="text/javascript" src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8")
|
||||
script.
|
||||
let subtitleEffect = !{subtitleEffect}
|
||||
jinrishici.load(function(result) {
|
||||
if (subtitleEffect){
|
||||
let sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
|
||||
let content = result.data.content;
|
||||
let both = sub.unshift(content)
|
||||
let typed = new Typed("#subtitle", {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
});
|
||||
}else{
|
||||
document.getElementById("subtitle").innerHTML = result.data.content
|
||||
}
|
||||
})
|
||||
|
||||
else
|
||||
- var subtitle = theme.subtitle.sub[0]
|
||||
script.
|
||||
let subtitleEffect = !{subtitleEffect}
|
||||
if (subtitleEffect){
|
||||
let typed = new Typed("#subtitle", {
|
||||
strings: '!{theme.subtitle.sub}'.split(","),
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
})
|
||||
}else{
|
||||
document.getElementById("subtitle").innerHTML = '!{subtitle}'
|
||||
}
|
||||
@@ -1,86 +1,46 @@
|
||||
|
||||
- var pageTitle = page.title || config.subtitle || ''
|
||||
- if (is_archive()) pageTitle = _p('page.archives')
|
||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||
- if (is_year()) pageTitle += ': ' + page.year
|
||||
- var pageTitle_saved //- 暫時存儲pageTitle
|
||||
- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
|
||||
- var home_subtitle_true //有subtitle
|
||||
//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
|
||||
- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
|
||||
//- 暫時存儲pageTitle
|
||||
- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
|
||||
//- 是否有 config.subtitle 是各自显示
|
||||
- config.subtitle ? home_subtitle_true = ' - ' + config.subtitle : home_subtitle_true = ''
|
||||
//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
|
||||
- is_home() ? pageTitle = config.title + home_subtitle_true : pageTitle = pageTitle_saved
|
||||
|
||||
- var pageDescription = page.description || page.title || config.description || ''
|
||||
- var pageKeywords = (config.keywords || []).join(',')
|
||||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||
- var autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
|
||||
|
||||
doctype html
|
||||
html(lang=config.language)
|
||||
html(lang=config.language data-theme=theme.display_mode)
|
||||
head
|
||||
meta(charset='UTF-8')
|
||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1")
|
||||
title= pageTitle
|
||||
meta(name="description" content=pageDescription)
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
||||
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
||||
each url in theme.stylesheets
|
||||
link(rel='stylesheet', href=url_for(url))
|
||||
each item in theme.cdn.css
|
||||
if item !== undefined
|
||||
link(rel='stylesheet', href=item)
|
||||
include ./head.pug
|
||||
include ./config.pug
|
||||
body
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
||||
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
|
||||
include ./sidebar.pug
|
||||
if (!is_post())
|
||||
include ./nav.pug
|
||||
#content-outer
|
||||
block top_img
|
||||
#body-wrap
|
||||
if theme.background
|
||||
- var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
|
||||
#web_bg(data-type=is_photo)
|
||||
include ./header/index.pug
|
||||
|
||||
if (!is_post())
|
||||
#content-inner.layout_page
|
||||
main#content-inner.layout_page(class=hideAside)
|
||||
if body
|
||||
div!= body
|
||||
else
|
||||
block content
|
||||
include widget/index.pug
|
||||
else
|
||||
#content-inner.layout.layout_post
|
||||
main#content-inner.layout_post
|
||||
if body
|
||||
div!= body
|
||||
else
|
||||
block content
|
||||
footer
|
||||
include ./footer.pug
|
||||
i.fa.fa-arrow-up#go-up(aria-hidden="true")
|
||||
|
||||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||||
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
|
||||
footer#footer(style=footer_bg data-type=is_bg)
|
||||
!=partial('includes/footer', {}, {cache:theme.fragment_cache})
|
||||
include ./rightside.pug
|
||||
if (is_post())
|
||||
include ./post-bottom.pug
|
||||
each item in theme.cdn.js
|
||||
if item !== undefined
|
||||
script(src=url_for(item))
|
||||
if theme.scripts !== undefined && theme.scripts.length > 0
|
||||
//- scripts list from config.yml
|
||||
each url in theme.scripts
|
||||
script(src=url_for(url))
|
||||
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||
each item in theme.CDN_USE.js
|
||||
script(src=url_for(item))
|
||||
include ./additional-js.pug
|
||||
include ./search/index.pug
|
||||
|
||||
|
||||
|
||||
|
||||
15
layout/includes/math/index.pug
Normal file
15
layout/includes/math/index.pug
Normal file
@@ -0,0 +1,15 @@
|
||||
if theme.mathjax && theme.mathjax.enable
|
||||
if theme.mathjax.per_page
|
||||
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
include ./mathjax.pug
|
||||
else
|
||||
if page.mathjax
|
||||
include ./mathjax.pug
|
||||
|
||||
if theme.katex && theme.katex.enable
|
||||
if theme.katex.per_page
|
||||
if(!is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
include ./katex.pug
|
||||
else
|
||||
if page.katex
|
||||
include ./katex.pug
|
||||
7
layout/includes/math/katex.pug
Normal file
7
layout/includes/math/katex.pug
Normal file
@@ -0,0 +1,7 @@
|
||||
link(rel="stylesheet" type="text/css" href=theme.CDN.katex)
|
||||
script(src=url_for(theme.CDN.katex_copytex))
|
||||
link(rel="stylesheet" type="text/css" href=theme.CDN.katex_copytex_css)
|
||||
script.
|
||||
$(function () {
|
||||
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
||||
})
|
||||
@@ -24,4 +24,4 @@ script(type="text/x-mathjax-config").
|
||||
}
|
||||
});
|
||||
|
||||
script(src=theme.mathjax.cdn)
|
||||
script(src=theme.CDN.mathjax)
|
||||
8
layout/includes/math/mermaid.pug
Normal file
8
layout/includes/math/mermaid.pug
Normal file
@@ -0,0 +1,8 @@
|
||||
script.
|
||||
if (document.getElementsByClassName('mermaid').length) {
|
||||
loadScript('!{theme.CDN.mermaid}',function () {
|
||||
mermaid.initialize({
|
||||
theme: '!{theme.mermaid.theme}',
|
||||
})
|
||||
})
|
||||
}
|
||||
53
layout/includes/mixins/UI.pug
Normal file
53
layout/includes/mixins/UI.pug
Normal file
@@ -0,0 +1,53 @@
|
||||
mixin UI_NEW(posts)
|
||||
- posts.each(function(article,index){
|
||||
.recent-post-item
|
||||
- var link = article.link || article.path
|
||||
- var post_cover = article.cover
|
||||
- var title = article.title || _p('no_title')
|
||||
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lazyload(data-src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
else
|
||||
img.post_bg(src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
.recent-post-info(class=no_cover)
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
.article-meta-wrap
|
||||
if (theme.post_meta.page.date_type)
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
=date(page.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
each item, index in article.categories.data
|
||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fa.fa-angle-right(aria-hidden="true")
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
span.article-meta__separator |
|
||||
each item, index in article.tags.data
|
||||
i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
if (index < article.tags.data.length - 1)
|
||||
span.article-meta__link -
|
||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
else
|
||||
.content!= article.description
|
||||
- })
|
||||
@@ -3,10 +3,18 @@ mixin articleSort(posts)
|
||||
- var year
|
||||
- posts.each(function (article) {
|
||||
- var tempYear = date(article.date, 'YYYY')
|
||||
- var no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
|
||||
if tempYear !== year
|
||||
- year = tempYear
|
||||
.article-sort-item.year= year
|
||||
.article-sort-item
|
||||
time.article-sort-item__time= date(article.date)
|
||||
a.article-sort-item__title(href=url_for(article.path))= article.title || 'No Title'
|
||||
.article-sort-item(class=no_cover)
|
||||
if article.cover && theme.cover.archives_enable
|
||||
.article-sort-img
|
||||
a.article-sort-item__img(href=url_for(article.path))
|
||||
img(src=article.cover alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
.article-sort-post
|
||||
a.article-sort-item__post(href=url_for(article.path))
|
||||
i.fa.fa-clock-o(aria-hidden="true")
|
||||
time.article-sort-item__time= date(article.date)
|
||||
.article-sort-item__title= article.title || 'No Title'
|
||||
- })
|
||||
3
layout/includes/mobile-sidebar/index.pug
Normal file
3
layout/includes/mobile-sidebar/index.pug
Normal file
@@ -0,0 +1,3 @@
|
||||
#mobile-sidebar
|
||||
#menu_mask
|
||||
include ../mobile-sidebar/mobile-menus.pug
|
||||
27
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
27
layout/includes/mobile-sidebar/mobile-menus.pug
Normal file
@@ -0,0 +1,27 @@
|
||||
#mobile-sidebar-menus
|
||||
.mobile_author_icon
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
|
||||
.mobile_post_data
|
||||
if site.posts.length
|
||||
.mobile_data_item.is-center
|
||||
.mobile_data_link
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
.headline= _p('aside.articles')
|
||||
.length_num= site.posts.length
|
||||
|
||||
if site.tags.length
|
||||
.mobile_data_item.is-center
|
||||
.mobile_data_link
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
.headline= _p('aside.tags')
|
||||
.length_num= site.tags.length
|
||||
|
||||
if site.categories.length
|
||||
.mobile_data_item.is-center
|
||||
.mobile_data_link
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
.headline= _p('aside.categories')
|
||||
.length_num= site.categories.length
|
||||
hr
|
||||
.menus_items
|
||||
include ../header/menu_item.pug
|
||||
@@ -1,35 +0,0 @@
|
||||
if (is_archive())
|
||||
- var top_img = theme.archive_img ||theme.top_img || config.top_img
|
||||
else
|
||||
- var top_img = page.top_img||theme.top_img || config.top_img
|
||||
|
||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
|
||||
|
||||
|
||||
if is_home()
|
||||
nav#nav.full_page(style=bg_img)
|
||||
include ./header.pug
|
||||
#site-info
|
||||
#site-title
|
||||
span.blogtitle= page.title || page.tag || page.category || config.title
|
||||
#site-sub-title
|
||||
span.subtitle
|
||||
|
||||
if(theme.social)
|
||||
#site-social-icons
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=url target="_blank")
|
||||
i(class=icon)
|
||||
|
||||
.scroll-down
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
|
||||
else
|
||||
nav#nav.bg_local(style=bg_img)
|
||||
include ./header.pug
|
||||
#page_site-info
|
||||
#site-title
|
||||
if (is_archive())
|
||||
span.blogtitle= _p('archives')
|
||||
else
|
||||
span.blogtitle= page.title || page.tag || page.category || config.title
|
||||
@@ -1,8 +1,9 @@
|
||||
-
|
||||
var options = {
|
||||
prev_text: '<i class="fa fa-chevron-left"></i>',
|
||||
next_text: '<i class="fa fa-chevron-right"></i>',
|
||||
mid_size: 1
|
||||
prev_text: '<i class="fa fa-fw fa-chevron-left" aria-hidden="true"></i>',
|
||||
next_text: '<i class="fa fa-fw fa-chevron-right" aria-hidden="true"></i>',
|
||||
mid_size: 1,
|
||||
escape: false
|
||||
}
|
||||
|
||||
if(!is_post())
|
||||
@@ -12,51 +13,27 @@ if(!is_post())
|
||||
else
|
||||
nav#pagination.pagination_post
|
||||
if(page.prev)
|
||||
if(page.next)
|
||||
.prev-post.pull-left
|
||||
- var pagination_cover = page.prev.cover || random_cover()
|
||||
a(href=url_for(page.prev.path))
|
||||
if theme.lazyload.enable
|
||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
else
|
||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
|
||||
- var hasPageNext = page.prev ? 'pull_left' : 'pull-full'
|
||||
.prev-post(class=hasPageNext)
|
||||
- var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
|
||||
a(href=url_for(page.prev.path))
|
||||
if theme.lazyload.enable
|
||||
img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
else
|
||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
.pagination-info
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info
|
||||
span=page.prev.title
|
||||
else
|
||||
.prev-post.pull-full
|
||||
- var pagination_cover = page.prev.cover || random_cover()
|
||||
a(href=url_for(page.prev.path))
|
||||
if theme.lazyload.enable
|
||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info
|
||||
span=page.prev.title
|
||||
.prev_info=page.prev.title
|
||||
|
||||
if(page.next)
|
||||
if(page.prev)
|
||||
.next-post.pull-right
|
||||
- var pagination_cover = page.next.cover || random_cover()
|
||||
a(href=url_for(page.next.path))
|
||||
if theme.lazyload.enable
|
||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
- var hasPagePrev = page.prev ? 'pull_right' : 'pull-full'
|
||||
- var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover
|
||||
.next-post(class=hasPagePrev)
|
||||
a(href=url_for(page.next.path))
|
||||
if theme.lazyload.enable
|
||||
img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.pagination-info
|
||||
.label=_p('pagination.next')
|
||||
.next_info
|
||||
span=page.next.title
|
||||
else
|
||||
.next-post.pull-full
|
||||
- var pagination_cover = page.next.cover || random_cover()
|
||||
a(href=url_for(page.next.path))
|
||||
if theme.lazyload.enable
|
||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.label=_p('pagination.next')
|
||||
.next_info
|
||||
span=page.next.title
|
||||
|
||||
.next_info=page.next.title
|
||||
@@ -1,8 +0,0 @@
|
||||
#post_bottom
|
||||
#post_bottom_items
|
||||
a#to_comment(href="#post-comment")
|
||||
i.scroll_to_comment.fa.fa-comments
|
||||
i#mobile_toc.fa.fa-list
|
||||
#toc_mobile
|
||||
.toc_mobile_headline= _p('sidebar.catalog')
|
||||
!=toc(page.content,{"class":"toc_mobile_items"})
|
||||
13
layout/includes/post/post-copyright.pug
Normal file
13
layout/includes/post/post-copyright.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
if (theme.post_copyright && theme.post_copyright.enable && page.copyright != false)
|
||||
.post-copyright
|
||||
.post-copyright__author
|
||||
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
||||
span.post-copyright-info
|
||||
a(href=`mailto:${config.email}`) #[=config.author]
|
||||
.post-copyright__type
|
||||
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
||||
span.post-copyright-info
|
||||
a(href=url_for(page.permalink))= theme.post_copyright.decode ? decodeURI(page.permalink) : page.permalink
|
||||
.post-copyright__notice
|
||||
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
||||
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
||||
@@ -1,11 +1,11 @@
|
||||
.post-reward
|
||||
a.reward-buttom
|
||||
a.reward-button.button--primary.button--animated
|
||||
i.fa.fa-qrcode
|
||||
= ' ' + _p('donate')
|
||||
.reward-main
|
||||
ul.reward-all
|
||||
each item in theme.reward.QR_code
|
||||
li.reward-item
|
||||
img.lozad.post-qr-code__img(src=(item.itemlist||item).img)
|
||||
img.lazyload.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||
.post-qr-code__desc=(item.itemlist||item).text
|
||||
|
||||
@@ -1,69 +1,57 @@
|
||||
each article , index in page.posts.data
|
||||
.recent-post-item.article-container
|
||||
.recent-post-item
|
||||
- var link = article.link || article.path
|
||||
if index%2 == 0
|
||||
.post_cover.is_left
|
||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = random_cover()
|
||||
if (post_cover)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
.post_cover.is_right
|
||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = random_cover()
|
||||
if (post_cover)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.recent-post-info
|
||||
a.article-title(href=url_for(link) title= article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
if (article.top)
|
||||
span.article-meta
|
||||
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
||||
span.sticky= _p('sticky')
|
||||
span.article-meta__separator(style="margin-right: 0.3rem") |
|
||||
if (theme.post_meta.date_type)
|
||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(article[date_type], config.date_format)]
|
||||
if (theme.post_meta.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
each item, index in article.categories.data
|
||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fa.fa-angle-right(aria-hidden="true")
|
||||
//- if (theme.post_meta.tags && article.tags.data.length > 0)
|
||||
//- span.article-meta.tags
|
||||
//- span.article-meta__separator |
|
||||
//- each item, index in article.tags.data
|
||||
//- i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
||||
//- a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
//- if (index < article.tags.data.length - 1)
|
||||
//- span.article-meta__link -
|
||||
- var title = article.title || _p('no_title')
|
||||
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||
- var post_cover = article.cover
|
||||
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||
else
|
||||
img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||
.recent-post-info(class=no_cover)
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
.article-meta-wrap
|
||||
if (article.top)
|
||||
span.article-meta
|
||||
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
||||
span.sticky= _p('sticky')
|
||||
span.article-meta__separator |
|
||||
if (theme.post_meta.page.date_type)
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar.fa-fw(aria-hidden="true")
|
||||
=date(page.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.post.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar.fa-fw(aria-hidden="true")]#[=date(page[date_type], config.date_format)]
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
each item, index in article.categories.data
|
||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fa.fa-angle-right(aria-hidden="true")
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
span.article-meta__separator |
|
||||
each item, index in article.tags.data
|
||||
i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
if (index < article.tags.data.length - 1)
|
||||
span.article-meta__link -
|
||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
.more_setting
|
||||
a.more.more--border.more--primary.more--animated(href=url_for(link) + '#more' style="margin-top: 14px")= _p('read_more')
|
||||
else
|
||||
.content!= article.description
|
||||
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
section#rightside.rightside
|
||||
if theme.readmode.enable && is_post()
|
||||
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
|
||||
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||
if theme.translate && theme.translate.enable
|
||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default
|
||||
if theme.nightshift.enable
|
||||
i#nightshift.fa.fa-moon-o.nightshift(title=_p('rightside.night_mode_title'))
|
||||
#rightside-config-hide
|
||||
if theme.readmode.enable && is_post()
|
||||
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
|
||||
if is_post()
|
||||
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||
if theme.translate && theme.translate.enable
|
||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
|
||||
if theme.darkmode.enable && theme.darkmode.button
|
||||
- var lightModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-sun' : 'fa fa-sun-o'
|
||||
- var darkModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-moon' : 'fa fa-moon-o'
|
||||
- var display_mode = theme.display_mode == 'dark' ? lightModeIcon : darkModeIcon
|
||||
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
|
||||
#rightside-config-show
|
||||
#rightside_config(title=_p("rightside.setting"))
|
||||
i.fa.fa-cog(aria-hidden="true")
|
||||
if is_post() && page.comments !== false && isComment
|
||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||
i.scroll_to_comment.fa.fa-comments
|
||||
if is_post() && page.toc != false && theme.toc.enable
|
||||
i#mobile-toc-button.fa.fa-list-ul.close(title=_p("rightside.toc") aria-hidden="true")
|
||||
i.fa.fa-arrow-up#go-up(title=_p("rightside.back_to_top") aria-hidden="true")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#local-input-panel
|
||||
#local-search-input
|
||||
.local-search-box
|
||||
input(placeholder=_p("local_search.input_placeholder")).local-search-box--input
|
||||
input(placeholder=_p("local_search.input_placeholder") type="text").local-search-box--input
|
||||
hr
|
||||
#local-search-results
|
||||
#local-hits
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
a(class="a2a_button_" + name)
|
||||
|
||||
a.a2a_dd(href="https://www.addtoany.com/share")
|
||||
script(async src="https://static.addtoany.com/menu/page.js")
|
||||
script(async src=url_for(theme.CDN.addtoany))
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if (theme.sharejs && theme.sharejs.enable)
|
||||
.social-share(data-image= page.cover|| theme.avatar data-sites= theme.sharejs.sites)
|
||||
link(rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css")
|
||||
script(src="https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js")
|
||||
.social-share(data-image= page.cover|| theme.avatar.img data-sites= theme.sharejs.sites)
|
||||
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||
script(src=url_for(theme.CDN.sharejs))
|
||||
@@ -1,7 +1,4 @@
|
||||
|
||||
- var sidebar_class = theme.auto_open_sidebar.enable === true ? 'auto_open' : ''
|
||||
|
||||
#sidebar(class=sidebar_class)
|
||||
#sidebar
|
||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
||||
-
|
||||
let tocNumber
|
||||
@@ -16,5 +13,9 @@
|
||||
span.progress-notice= _p('sidebar.have_read')
|
||||
span.progress-num 0
|
||||
span.progress-percentage %
|
||||
div.sidebar-toc__progress-bar
|
||||
div.sidebar-toc__content!=toc(page.content, {list_number: tocNumber})
|
||||
div.sidebar-toc__progress-bar
|
||||
if (page.encrypt == true)
|
||||
div.sidebar-toc__content.toc-div-class(style="display:none")!=toc(page.origin, {list_number: tocNumber})
|
||||
else
|
||||
div.sidebar-toc__content!=toc(page.content, {list_number: tocNumber})
|
||||
|
||||
1
layout/includes/third-party/canvas-nest.pug
vendored
Normal file
1
layout/includes/third-party/canvas-nest.pug
vendored
Normal file
@@ -0,0 +1 @@
|
||||
script#canvas_nest(color=theme.canvas_nest.color opacity=theme.canvas_nest.opacity zIndex=theme.canvas_nest.zIndex count=theme.canvas_nest.count mobile=`${theme.canvas_nest.mobile}` src=url_for(theme.CDN.canvas_nest))
|
||||
@@ -1 +1 @@
|
||||
script(id="ribbon" src=url_for('https://cdn.jsdelivr.net/gh/jerryc127/CDN@latest/js/piao.js'))
|
||||
script(id="ribbon_piao" mobile=`${theme.canvas_ribbon_piao.mobile}` src=url_for(theme.CDN.canvas_ribbon_piao))
|
||||
@@ -1,3 +1,3 @@
|
||||
script(id="ribbon" src=url_for('/js/third-party/canvas-ribbon.js') size=theme.canvas_ribbon.size
|
||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||
script(defer id="ribbon" src=url_for(theme.CDN.canvas_ribbon) size=theme.canvas_ribbon.size
|
||||
alpha=theme.canvas_ribbon.alpha zIndex=theme.canvas_ribbon.zIndex mobile=`${theme.canvas_ribbon.mobile}` data-click=`${theme.canvas_ribbon.click_to_change}`)
|
||||
|
||||
|
||||
7
layout/includes/third-party/katex.pug
vendored
7
layout/includes/third-party/katex.pug
vendored
@@ -1,7 +0,0 @@
|
||||
link(rel="stylesheet" type="text/css" href=theme.katex.cdn.css)
|
||||
script(src='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.js')
|
||||
link(rel="stylesheet" type="text/css" href='https://cdn.jsdelivr.net/npm/katex-copytex@latest/dist/katex-copytex.min.css')
|
||||
script.
|
||||
$(function () {
|
||||
$('span.katex-display').wrap('<div class="katex-wrap"></div>')
|
||||
})
|
||||
13
layout/includes/third-party/pangu.pug
vendored
Normal file
13
layout/includes/third-party/pangu.pug
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
script(src=url_for(theme.CDN.pangu))
|
||||
if theme.pangu.field === 'post'
|
||||
if is_post()
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.spacingElementById('content-inner')
|
||||
})
|
||||
else if theme.pangu.field === 'page'
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.spacingElementById('content-inner')
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.card_widget.card-announcement
|
||||
.card-widget.card-announcement
|
||||
.card-content
|
||||
.item_headline
|
||||
.item-headline
|
||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content= theme.announcement.content
|
||||
.announcement_content!= theme.announcement.content
|
||||
@@ -1,6 +1,6 @@
|
||||
.card_widget.card-archives
|
||||
.card-widget.card-archives
|
||||
.card-content
|
||||
.item_headline
|
||||
.item-headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
span= _p('aside.card_archives')
|
||||
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
|
||||
@@ -1,41 +1,36 @@
|
||||
.card_widget.card-author
|
||||
.card-widget.card-info
|
||||
.card-content
|
||||
.post_data
|
||||
.data-item.text-center
|
||||
img.lozad(src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
p.author-info__name.text-center= config.author
|
||||
p.author-info__description.text-center= config.description
|
||||
.card-info-avatar.is-center
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
|
||||
.author-info__name= config.author
|
||||
.author-info__description= config.description
|
||||
|
||||
.post_data.data_config
|
||||
.card-info-data
|
||||
if site.posts.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
p.headline= _p('aside.articles')
|
||||
p.length_num= 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
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
p.headline= _p('aside.tags')
|
||||
p.length_num= 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
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
p.headline= _p('aside.categories')
|
||||
p.length_num= 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
|
||||
|
||||
.post_data.text-center
|
||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
||||
|
||||
|
||||
.card-info-bookmark.is-center
|
||||
a#bookmark-it.bookmark.button--primary.button--animated(href="javascript:;" title= _p('aside.card_bookmark') target="_self")
|
||||
i.fa.fa-bookmark(aria-hidden="true")
|
||||
span= _p('aside.card_bookmark') || 'Follow Me'
|
||||
|
||||
if(theme.social)
|
||||
.post_data.data_config
|
||||
#aside-social-icons
|
||||
.card-info-social-icons.is-center
|
||||
each url, icon in theme.social
|
||||
a.social-icon.data-item(href=url target="_blank")
|
||||
i(class=icon)
|
||||
a.social-icon(href=url target="_blank")
|
||||
i(class=icon aria-hidden="true")
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
if site.categories.length
|
||||
.card_widget.card-categories
|
||||
.card-widget.card-categories
|
||||
.card-content
|
||||
.item_headline
|
||||
.item-headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
span= _p('aside.card_categories')
|
||||
ul.aside_category_item
|
||||
ul.aside-category-item
|
||||
mixin displayCategories(parent = undefined)
|
||||
- site.categories.find({ parent }).sort("name").each(function(category) {
|
||||
- var childCount = site.categories.find({ parent: category._id }).count();
|
||||
li.aside_category_list
|
||||
a.aside_category_list_link(href=url_for(category.path))
|
||||
span.aside_category_list_name= category.name
|
||||
span.aside_category_list_length= category.length
|
||||
li.aside-category-list
|
||||
a.aside-category-list_link(href=url_for(category.path))
|
||||
span.aside-category-list_name= category.name
|
||||
span.aside-category-list_length= category.length
|
||||
|
||||
if childCount > 0
|
||||
ul.aside_category_item.child
|
||||
ul.aside-category-item.child
|
||||
+displayCategories(category._id)
|
||||
- })
|
||||
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
.card_widget.card-recent-post
|
||||
.card-widget.card-recent-post
|
||||
.card-content
|
||||
.item_headline
|
||||
.item-headline
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside_recent_item
|
||||
.aside-recent-item
|
||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||
.aside_recent_post
|
||||
.aside-recent-post
|
||||
- var link = article.link || article.path
|
||||
- var title = article.title || _p('no_title')
|
||||
- var no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-aside-cover' : ''
|
||||
- var post_cover = article.cover
|
||||
|
||||
a(href=url_for(link))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = random_cover()
|
||||
.aside_post_cover
|
||||
if (post_cover)
|
||||
if post_cover && theme.cover.aside_enable
|
||||
.aside-post-cover
|
||||
if theme.lazyload.enable
|
||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||
else
|
||||
img.aside_post_bg(src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
else
|
||||
if theme.lazyload.enable
|
||||
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
else
|
||||
img.aside_post_bg(src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
div#aside_title
|
||||
.aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
if (theme.post_meta.date_type)
|
||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
||||
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
||||
img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||
.aside-post-title(class=no_cover)
|
||||
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
if (theme.post_meta.page.date_type)
|
||||
- var date_type = theme.post_meta.page.date_type == 'updated' ? 'updated' : 'date'
|
||||
time.aside-post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
||||
|
||||
- })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if site.tags.length
|
||||
.card_widget.card-tags
|
||||
.card-widget.card-tags
|
||||
.card-content
|
||||
.item_headline
|
||||
.item-headline
|
||||
i.fa.fa-tags(aria-hidden="true")
|
||||
span= _p('aside.card_tags')
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
.card_widget.card-webinfo
|
||||
- var webinfoIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'fas fa-chart-line' : 'fa fa-line-chart'
|
||||
.card-widget.card-webinfo
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-line-chart(aria-hidden="true")
|
||||
.item-headline
|
||||
i(class=webinfoIcon aria-hidden="true")
|
||||
span= _p('aside.card_webinfo.headline')
|
||||
.webinfo
|
||||
.webinfo_item
|
||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
||||
.webinfo_article_count= site.posts.length
|
||||
.webinfo-item
|
||||
.webinfo-article-name= _p('aside.card_webinfo.article_name') + " :"
|
||||
.webinfo-article-count= site.posts.length
|
||||
if theme.runtimeshow.enable
|
||||
.webinfo_item
|
||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo_runtime_count.webinfo_runtime_count
|
||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
||||
|
||||
.webinfo-item
|
||||
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo-runtime-count.webinfo-runtime-count(start_date=theme.runtimeshow.start_date)
|
||||
if theme.busuanzi.site_uv
|
||||
.webinfo_item
|
||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||
.webinfo-item
|
||||
.webinfo-site-uv-name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo-site-uv-count#busuanzi_value_site_uv
|
||||
if theme.busuanzi.site_pv
|
||||
.webinfo_item
|
||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||
.webinfo-item
|
||||
.webinfo-site-name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo-site-pv-count#busuanzi_value_site_pv
|
||||
|
||||
|
||||
17
layout/includes/widget/index.pug
Normal file
17
layout/includes/widget/index.pug
Normal file
@@ -0,0 +1,17 @@
|
||||
if theme.aside.enable
|
||||
if page.aside !== false
|
||||
#aside_content.aside_content
|
||||
if theme.aside.card_author
|
||||
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_announcement
|
||||
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_recent_post
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_categories
|
||||
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_tags
|
||||
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_archives
|
||||
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_webinfo
|
||||
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
|
||||
@@ -3,6 +3,4 @@ extends includes/layout.pug
|
||||
block content
|
||||
#recent-posts.recent-posts
|
||||
include includes/recent-posts.pug
|
||||
include includes/pagination.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
include includes/pagination.pug
|
||||
14
layout/page-tags.pug
Normal file
14
layout/page-tags.pug
Normal file
@@ -0,0 +1,14 @@
|
||||
.tag-cloud
|
||||
.tag-cloud__title= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud__amount= site.tags.length
|
||||
.tag-cloud-tags
|
||||
- site.tags.sort('path').each(function (tags){
|
||||
- var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
|
||||
- var color = "rgb(" + Math.floor(Math.random() * 201) + ", " + Math.floor(Math.random() * 201) +", " + Math.floor(Math.random() * 201) +")"; // 0,0,0 -> 200,200,200
|
||||
a(href=url_for(tags.path) style='font-size:' + fontSize + ';color:' + color)=tags.name
|
||||
-})
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
|
||||
|
||||
@@ -2,24 +2,11 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if page.type === 'tags'
|
||||
.tag-cloud
|
||||
.tag-cloud__title= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud__amount= site.tags.length
|
||||
.tag-cloud-tags!= tags(site.tags)
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
|
||||
include page-tags.pug
|
||||
else if page.type === 'link'
|
||||
include flink.pug
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
else if page.type === 'categories'
|
||||
#post-content.category-content
|
||||
.category-content
|
||||
.category-lists
|
||||
.category__title= _p('page.category')
|
||||
| -
|
||||
@@ -27,14 +14,8 @@ block content
|
||||
div!= list_categories()
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
else
|
||||
article#page
|
||||
h1= page.title
|
||||
.article-container!= page.content
|
||||
include includes/pagination.pug
|
||||
#page
|
||||
#article-container!= page.content
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
include includes/comments/index.pug
|
||||
@@ -1,76 +1,21 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block top_img
|
||||
- var top_img = page.top_img || page.cover || theme.post_meta.top_img || theme.post_img || theme.top_img || config.top_img
|
||||
- var bg_img = top_img !== true ? `background-image: url(${top_img})` : ''
|
||||
div#top-container(style=bg_img)
|
||||
include ./includes/header.pug
|
||||
#post-info
|
||||
#post-title
|
||||
.posttitle=page.title || _p('no_title')
|
||||
#post-meta
|
||||
if (theme.post_meta.date_type)
|
||||
if (theme.post_meta.date_type === 'both')
|
||||
time.post-meta__date
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var date_type = theme.post_meta.date_type === 'updated' ? 'updated' : 'date'
|
||||
time.post-meta__date #[i.fa.fa-calendar(aria-hidden="true")] #[=date(page[date_type], config.date_format)]
|
||||
|
||||
if (theme.post_meta.categories && page.categories.data.length > 0)
|
||||
if (theme.post_meta.date_type)
|
||||
span.post-meta__separator.mobile_hidden |
|
||||
span.mobile_hidden
|
||||
each item, index in page.categories.data
|
||||
i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.fa.fa-angle-right(aria-hidden="true")
|
||||
if (theme.wordcount && theme.wordcount.enable)
|
||||
.post-meta-wordcount
|
||||
span= _p('post.wordcount') + ': '
|
||||
span.word-count= wordcount(page.content)
|
||||
span.post-meta__separator |
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
if theme.busuanzi.page_pv
|
||||
span.post-meta__separator |
|
||||
span= _p('post.page_pv') + ': '
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
|
||||
block content
|
||||
article#post(class="")
|
||||
#post-content.article-container!= page.content
|
||||
if (theme.post_copyright && theme.post_copyright.enable)
|
||||
.post-copyright
|
||||
.post-copyright__author
|
||||
span.post-copyright-meta= _p('post.copyright.author') + ": "
|
||||
span.post-copyright-info
|
||||
a(href=`mailto:${config.email}`) #[=config.author]
|
||||
.post-copyright__type
|
||||
span.post-copyright-meta= _p('post.copyright.link') + ": "
|
||||
span.post-copyright-info
|
||||
a(href=url_for(page.permalink)) #[=page.permalink]
|
||||
.post-copyright__notice
|
||||
span.post-copyright-meta= _p('post.copyright.copyright_notice') + ": "
|
||||
span.post-copyright-info!= _p('post.copyright.copyright_content', theme.post_copyright.license_url, theme.post_copyright.license, config.url, config.title)
|
||||
|
||||
.tag_share
|
||||
if (theme.post_meta.tags)
|
||||
.post-meta__tag-list
|
||||
each item, index in page.tags.data
|
||||
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
||||
include includes/share/index.pug
|
||||
#article-container!=page.content
|
||||
include includes/post/post-copyright.pug
|
||||
.tag_share
|
||||
if (theme.post_meta.post.tags)
|
||||
.post-meta__tag-list
|
||||
each item, index in page.tags.data
|
||||
a(href=url_for(item.path)).post-meta__tags #[=item.name]
|
||||
!=partial('includes/share/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.reward.enable
|
||||
include includes/reward.pug
|
||||
include includes/pagination.pug
|
||||
|
||||
if theme.related_post && theme.related_post.enable
|
||||
!= related_posts(page,site.posts)
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
if theme.reward.enable
|
||||
!=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
|
||||
include includes/pagination.pug
|
||||
|
||||
if theme.related_post && theme.related_post.enable
|
||||
!= related_posts(page,site.posts)
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
@@ -1,10 +1,14 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#tag
|
||||
.article-sort-title= _p('page.tag') + ' - ' + page.tag
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
#aside_content.aside_content
|
||||
include includes/aside.pug
|
||||
if theme.tag_ui == 'index'
|
||||
include ./includes/mixins/UI.pug
|
||||
#recent-posts.recent-posts
|
||||
+UI_NEW(page.posts)
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#tag
|
||||
.article-sort-title= _p('page.tag') + ' - ' + page.tag
|
||||
+articleSort(page.posts)
|
||||
include includes/pagination.pug
|
||||
5
package.json
Normal file
5
package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "2.2.0",
|
||||
"description": "A Hexo Theme: Butterfly"
|
||||
}
|
||||
8
scripts/events/404.js
Normal file
8
scripts/events/404.js
Normal file
@@ -0,0 +1,8 @@
|
||||
hexo.extend.generator.register('404', function(locals){
|
||||
if (!hexo.theme.config.error_404.enable) return
|
||||
return {
|
||||
path: '404.html',
|
||||
data: locals.posts,
|
||||
layout: ['404']
|
||||
}
|
||||
});
|
||||
63
scripts/filters/hide-post.js
Normal file
63
scripts/filters/hide-post.js
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* global hexo
|
||||
* from printempw/hexo-hide-posts
|
||||
* modify by Jerry
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var public_generators = [];
|
||||
|
||||
hexo.extend.filter.register('before_generate', function () {
|
||||
this._bindLocals();
|
||||
|
||||
const all_posts = this.locals.get('posts');
|
||||
const hidden_posts = all_posts.find({
|
||||
'hide': true
|
||||
});
|
||||
const normal_posts = all_posts.filter(post => !post['hide']);
|
||||
|
||||
this.locals.set('all_posts', all_posts);
|
||||
this.locals.set('hidden_posts', hidden_posts);
|
||||
this.locals.set('posts', normal_posts);
|
||||
});
|
||||
|
||||
hexo.extend.filter.register('after_init', function () {
|
||||
|
||||
const original = {};
|
||||
for (const name in hexo.extend.generator.list()) {
|
||||
original[name] = hexo.extend.generator.get(name);
|
||||
}
|
||||
|
||||
hexo.extend.generator.register('post', async function (locals) {
|
||||
const fg = original.post.bind(this);
|
||||
|
||||
const generated_public = await fg(locals);
|
||||
const generated_hidden = await fg(Object.assign({}, locals, {
|
||||
posts: locals.hidden_posts
|
||||
}));
|
||||
|
||||
// Remove post.prev and post.next for hidden posts
|
||||
generated_hidden.forEach(ele => {
|
||||
ele.data.prev = ele.data.next = null;
|
||||
});
|
||||
|
||||
return generated_public.concat(generated_hidden);
|
||||
});
|
||||
|
||||
// Then we hack into other generators if necessary
|
||||
public_generators.filter(
|
||||
name => Object.keys(original).includes(name)
|
||||
).forEach(name => {
|
||||
// Overwrite original generator
|
||||
hexo.extend.generator.register(name, function (locals) {
|
||||
const fg = original[name].bind(this);
|
||||
|
||||
return fg(Object.assign({}, locals, {
|
||||
posts: new locals.posts.constructor(
|
||||
locals.posts.data.concat(locals.hidden_posts.data)
|
||||
)
|
||||
}));
|
||||
});
|
||||
});
|
||||
});
|
||||
30
scripts/filters/post-lazyload.js
Normal file
30
scripts/filters/post-lazyload.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('hexo-fs');
|
||||
const url_for = require('hexo-util').url_for.bind(hexo);
|
||||
|
||||
function lazyProcess(htmlContent) {
|
||||
var bg = url_for(hexo.theme.config.lodding_bg.post);
|
||||
return htmlContent.replace(/<img(\s*?)src="(.*?)"(.*?)>/gi, (str, p1, p2, p3) => {
|
||||
if (/data-src/gi.test(str)) {
|
||||
return str;
|
||||
}
|
||||
if (/class="(.*?)"/gi.test(str)){
|
||||
str = str.replace(/class="(.*?)"/gi, (classStr, p1) => {
|
||||
return classStr.replace(p1, `${p1} lazyload`);
|
||||
})
|
||||
str = str.replace(p2, `${bg}`)
|
||||
return str.replace(p3, `${p3} data-src="${p2}"`);
|
||||
}
|
||||
str = str.replace(p2, `${bg}`)
|
||||
return str.replace(p3, `${p3} class="lazyload" data-src="${p2}"`);
|
||||
});
|
||||
}
|
||||
|
||||
var processPost = function(data) {
|
||||
if (!hexo.theme.config.lazyload.enable) return;
|
||||
data.content = lazyProcess.call(this, data.content);
|
||||
return data;
|
||||
};
|
||||
|
||||
hexo.extend.filter.register('after_post_render', processPost);
|
||||
23
scripts/filters/random-cover.js
Normal file
23
scripts/filters/random-cover.js
Normal file
@@ -0,0 +1,23 @@
|
||||
hexo.extend.filter.register("before_post_render", function(data) {
|
||||
if (data.cover == false) {
|
||||
data.randomcover = random_cover();
|
||||
return data;
|
||||
}
|
||||
data.cover = data.cover || random_cover();
|
||||
return data;
|
||||
});
|
||||
|
||||
var random_cover = function() {
|
||||
var cover;
|
||||
var num;
|
||||
if (!Array.isArray(hexo.theme.config.cover.default_cover)) {
|
||||
cover = hexo.theme.config.cover.default_cover;
|
||||
return cover;
|
||||
} else {
|
||||
num = Math.floor(
|
||||
Math.random() * hexo.theme.config.cover.default_cover.length
|
||||
);
|
||||
cover = hexo.theme.config.cover.default_cover[num];
|
||||
return cover;
|
||||
}
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
hexo.extend.tag.register('gallery', args => {
|
||||
const url = args[0]
|
||||
const title = args[1] || 'No title'
|
||||
return `
|
||||
<div
|
||||
class="gallery-item"
|
||||
style="background-image: url('${url}')"
|
||||
data-title="${title}"
|
||||
data-url="${url}"
|
||||
>
|
||||
<div class="gallery-item__title">
|
||||
${title}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
103
scripts/helpers/list-archives.js
Normal file
103
scripts/helpers/list-archives.js
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
|
||||
hexo.extend.helper.register("list_archives", function(options = {}) {
|
||||
const { config } = this;
|
||||
const archiveDir = config.archive_dir;
|
||||
const { timezone } = config;
|
||||
const lang = this.page.lang || this.page.language || config.language;
|
||||
let { format } = options;
|
||||
const type = options.type || "monthly";
|
||||
const { style = "list", transform, separator = ", " } = options;
|
||||
const showCount = Object.prototype.hasOwnProperty.call(options, "show_count")
|
||||
? options.show_count
|
||||
: true;
|
||||
const order = options.order || -1;
|
||||
const limit = 8;
|
||||
let result = "";
|
||||
|
||||
var more_button;
|
||||
if (lang === "zh-CN") {
|
||||
more_button = "查看更多";
|
||||
} else if (lang === "zh-TW") {
|
||||
more_button = "查看更多";
|
||||
} else {
|
||||
more_button = "More";
|
||||
}
|
||||
|
||||
if (!format) {
|
||||
format = type === "monthly" ? "MMMM YYYY" : "YYYY";
|
||||
}
|
||||
|
||||
const posts = this.site.posts.sort("date", order);
|
||||
if (!posts.length) return result;
|
||||
|
||||
const data = [];
|
||||
let length = 0;
|
||||
|
||||
posts.forEach(post => {
|
||||
// Clone the date object to avoid pollution
|
||||
let date = post.date.clone();
|
||||
|
||||
if (timezone) date = date.tz(timezone);
|
||||
if (lang) date = date.locale(lang);
|
||||
|
||||
const year = date.year();
|
||||
const month = date.month() + 1;
|
||||
const name = date.format(format);
|
||||
const lastData = data[length - 1];
|
||||
|
||||
if (!lastData || lastData.name !== name) {
|
||||
length = data.push({
|
||||
name,
|
||||
year,
|
||||
month,
|
||||
count: 1
|
||||
});
|
||||
} else {
|
||||
lastData.count++;
|
||||
}
|
||||
});
|
||||
|
||||
const link = item => {
|
||||
let url = `${archiveDir}/${item.year}/`;
|
||||
|
||||
if (type === "monthly") {
|
||||
if (item.month < 10) url += "0";
|
||||
url += `${item.month}/`;
|
||||
}
|
||||
|
||||
return this.url_for(url);
|
||||
};
|
||||
|
||||
result += `<ul class="archive-list">`;
|
||||
|
||||
for (let i = 0, len = data.length; i < Math.min(len, limit); i++) {
|
||||
const item = data[i];
|
||||
|
||||
result += `<li class="archive-list-item">`;
|
||||
|
||||
result += `<a class="archive-list-link" href="${link(item)}">`;
|
||||
result += `<span class="archive-list-date">`;
|
||||
result += transform ? transform(item.name) : item.name;
|
||||
result += `</span>`;
|
||||
|
||||
if (showCount) {
|
||||
result += `<span class="archive-list-count">${item.count}</span>`;
|
||||
}
|
||||
result += "</a>";
|
||||
result += "</li>";
|
||||
}
|
||||
|
||||
if (data.length > limit) {
|
||||
result += `<li class="archive-list-item">`;
|
||||
result +=
|
||||
`<a class="archive-list-link-more" href="` +
|
||||
"/" +
|
||||
`${archiveDir}" >`;
|
||||
result += more_button;
|
||||
result += "</a>";
|
||||
result += "</li>";
|
||||
}
|
||||
result += "</ul>";
|
||||
return result;
|
||||
});
|
||||
90
scripts/helpers/related-post.js
Normal file
90
scripts/helpers/related-post.js
Normal file
@@ -0,0 +1,90 @@
|
||||
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
var relatedPosts = [];
|
||||
currentPost.tags.forEach(function (tag) {
|
||||
allPosts.forEach(function (post) {
|
||||
if (isTagRelated(tag.name, post.tags)) {
|
||||
var relatedPost = {
|
||||
title: post.title,
|
||||
path: post.path,
|
||||
cover: post.cover,
|
||||
randomcover: post.randomcover,
|
||||
weight: 1,
|
||||
updated: post.updated,
|
||||
created: post.date
|
||||
};
|
||||
var index = findItem(relatedPosts, 'path', post.path);
|
||||
if (index != -1) {
|
||||
relatedPosts[index].weight += 1;
|
||||
} else {
|
||||
if (currentPost.path != post.path) {
|
||||
relatedPosts.push(relatedPost);
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
if (relatedPosts.length == 0) {
|
||||
return ''
|
||||
};
|
||||
var result = "";
|
||||
const hexoConfig = hexo.theme.config.rootConfig;
|
||||
const config = hexo.theme.config;
|
||||
|
||||
var limit_num = config.related_post.limit || 6
|
||||
var date_type = config.related_post.date_type || 'created'
|
||||
var headline_lang = this._p('post.recommend')
|
||||
|
||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||
var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
||||
var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
|
||||
|
||||
if (relatedPosts.length > 0) {
|
||||
result += '<div class="relatedPosts">'
|
||||
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + ' ' + headline_lang + '</span></div>'
|
||||
result += '<div class="relatedPosts_list">'
|
||||
|
||||
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
|
||||
var cover = relatedPosts[i].cover === false ? relatedPosts[i].randomcover : relatedPosts[i].cover
|
||||
result += '<div class="relatedPosts_item"><a href="' + hexoConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
|
||||
result += '<img class="relatedPosts_cover ' + lazy_class + '"' + lazy_src + '="' + cover + '">';
|
||||
if (date_type == 'created') {
|
||||
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i>' + ' ' + this.date(relatedPosts[i].created,hexoConfig.date_format) + '</div>'
|
||||
} else {
|
||||
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-history fa-fw" aria-hidden="true"></i>' + ' ' + this.date(relatedPosts[i].updated,hexoConfig.date_format) + '</div>'
|
||||
}
|
||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
||||
result += '</div></a></div>'
|
||||
};
|
||||
|
||||
result += '</div><div class="clear_both"></div></div>'
|
||||
return result;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function isTagRelated(tagName, TBDtags) {
|
||||
var result = false;
|
||||
TBDtags.forEach(function (tag) {
|
||||
if (tagName == tag.name) {
|
||||
result = true;
|
||||
};
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
function findItem(arrayToSearch, attr, val) {
|
||||
for (var i = 0; i < arrayToSearch.length; i++) {
|
||||
if (arrayToSearch[i][attr] == val) {
|
||||
return i
|
||||
};
|
||||
};
|
||||
return -1;
|
||||
}
|
||||
|
||||
function compare(attr) {
|
||||
return function (a, b) {
|
||||
var val1 = a[attr];
|
||||
var val2 = b[attr];
|
||||
return val2 - val1;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
'use strict';
|
||||
let cheerio;
|
||||
hexo.extend.filter.register('after_post_render', data => {
|
||||
var theme = hexo.theme.config;
|
||||
if (!theme.lazyload.enable) return;
|
||||
|
||||
if (!cheerio) cheerio = require('cheerio');
|
||||
|
||||
const $ = cheerio.load(data.content, {decodeEntities: false});
|
||||
const images = $('img');
|
||||
if (!images.length) return;
|
||||
|
||||
images.each((i, o) => {
|
||||
let src = $(o).attr('src');
|
||||
$(o).attr('data-src', src).removeAttr('src');
|
||||
$(o).addClass('lozad');
|
||||
});
|
||||
|
||||
data.content = $.html();
|
||||
}, 0);
|
||||
@@ -1,13 +0,0 @@
|
||||
hexo.extend.helper.register('random_cover', function () {
|
||||
var cover;
|
||||
var num;
|
||||
if (!Array.isArray(hexo.theme.config.default_cover)) {
|
||||
cover = hexo.theme.config.default_cover
|
||||
return cover
|
||||
} else {
|
||||
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
|
||||
cover = hexo.theme.config.default_cover[num];
|
||||
return cover
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1,99 +0,0 @@
|
||||
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
var relatedPosts = [];
|
||||
currentPost.tags.forEach(function (tag) {
|
||||
allPosts.forEach(function (post) {
|
||||
if (isTagRelated(tag.name, post.tags)) {
|
||||
var relatedPost = {
|
||||
title: post.title,
|
||||
path: post.path,
|
||||
cover: post.cover,
|
||||
weight: 1
|
||||
};
|
||||
var index = findItem(relatedPosts, 'path', post.path);
|
||||
if (index != -1) {
|
||||
relatedPosts[index].weight += 1;
|
||||
} else {
|
||||
if (currentPost.path != post.path) {
|
||||
relatedPosts.push(relatedPost);
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
});
|
||||
if (relatedPosts.length == 0) { return '' };
|
||||
var result = "";
|
||||
var limit_num = hexo.theme.config.related_post.limit || 6
|
||||
var lang = hexo.theme.config.rootConfig.language;
|
||||
var headline_lang;
|
||||
if (lang === 'zh-CN') {
|
||||
headline_lang = '相关推荐';
|
||||
} else if ( lang === 'zh-TW') {
|
||||
headline_lang = '相關推薦';
|
||||
} else {
|
||||
headline_lang = 'Recommend';
|
||||
}
|
||||
|
||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||
var lazy_src = hexo.theme.config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
||||
var lazy_class = hexo.theme.config.lazyload.enable ? lazy_class = 'lozad' : lazy_class = ''
|
||||
|
||||
if (relatedPosts.length > 0) {
|
||||
result += '<div class="relatedPosts">'
|
||||
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + ' ' + headline_lang + '</span></div>'
|
||||
result += '<div class="relatedPosts_list">'
|
||||
|
||||
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
|
||||
|
||||
var cover = relatedPosts[i].cover || random_cover()
|
||||
|
||||
result += '<div class="relatedPosts_item"><a href="' + hexo.theme.config.rootConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
|
||||
result += '<img class="relatedPosts_cover '+ lazy_class + '"' + lazy_src + '="' + cover + '">';
|
||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
||||
result += '</a></div>'
|
||||
};
|
||||
|
||||
result += '</div><div class="clear_both"></div></div>'
|
||||
return result;
|
||||
|
||||
}
|
||||
});
|
||||
hexo.extend.helper.register('echo', function(path){
|
||||
return path;
|
||||
});
|
||||
function isTagRelated (tagName, TBDtags) {
|
||||
var result = false;
|
||||
TBDtags.forEach(function (tag) {
|
||||
if (tagName == tag.name) {
|
||||
result = true;
|
||||
};
|
||||
})
|
||||
return result;
|
||||
}
|
||||
function findItem (arrayToSearch, attr, val) {
|
||||
for (var i = 0; i < arrayToSearch.length; i++) {
|
||||
if (arrayToSearch[i][attr] == val) {
|
||||
return i
|
||||
};
|
||||
};
|
||||
return -1;
|
||||
}
|
||||
function compare (attr) {
|
||||
return function (a, b) {
|
||||
var val1 = a[attr];
|
||||
var val2 = b[attr];
|
||||
return val2 - val1;
|
||||
}
|
||||
}
|
||||
|
||||
function random_cover() {
|
||||
var post_cover;
|
||||
var num;
|
||||
if (!Array.isArray(hexo.theme.config.default_cover)) {
|
||||
post_cover = hexo.theme.config.default_cover
|
||||
return post_cover
|
||||
} else {
|
||||
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
|
||||
post_cover = hexo.theme.config.default_cover[num];
|
||||
return post_cover
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
hexo.extend.helper.register('tags', function (site_tags) {
|
||||
var result = "";
|
||||
site_tags.sort('path').each(function (tags) {
|
||||
var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
|
||||
var color =
|
||||
"rgb(" +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
")"; // 0,0,0 -> 200,200,200
|
||||
result += '<a href="' + hexo.theme.config.rootConfig.root + tags.path + '" style="font-size:' + fontSize + ';color:' + color + '">' + tags.name + '</a>'
|
||||
})
|
||||
return result;
|
||||
})
|
||||
27
scripts/tags/gallery.js
Normal file
27
scripts/tags/gallery.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const url_for = require('hexo-util').url_for.bind(hexo);
|
||||
|
||||
function gallery(args, content) {
|
||||
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function galleryGroup(args){
|
||||
const name = args[0]
|
||||
const desrc = args[1]
|
||||
const url = url_for(args[2])
|
||||
const img = url_for(args[3])
|
||||
|
||||
return `
|
||||
<figure class="gallery-group">
|
||||
<img class="gallery-group-img" src='${img}'>
|
||||
<figcaption>
|
||||
<div class="gallery-group-name">${name}</div>
|
||||
<p>${desrc}</p>
|
||||
<a href='${url}'></a>
|
||||
</figcaption>
|
||||
</figure>
|
||||
`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('gallery', gallery, {ends: true});
|
||||
hexo.extend.tag.register('galleryGroup', galleryGroup);
|
||||
33
scripts/tags/hide.js
Normal file
33
scripts/tags/hide.js
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
/**
|
||||
* {% hideInline content,display,bg,color %}
|
||||
* content不能包含當引號,可用 '
|
||||
*/
|
||||
function hideInline(args) {
|
||||
args = args.join(' ').split(',')
|
||||
let content = args[0].trim()
|
||||
let display = args[1] || 'Click'
|
||||
let bg = args[2] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
|
||||
let color = args[3] || '#fff'
|
||||
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
|
||||
</a><span class="hide-content">${content}</span></span>`
|
||||
}
|
||||
|
||||
/**
|
||||
* {% hideBlock display,bg,color %}
|
||||
* content
|
||||
* {% endhideBlock %}
|
||||
*/
|
||||
function hideBlock(args,content) {
|
||||
args = args.join(' ').split(',')
|
||||
let display = args[0] || 'Click'
|
||||
let bg = args[1] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
|
||||
let color = args[2] || '#fff'
|
||||
|
||||
return `<div class="hide-block"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
|
||||
</a><span class="hide-content">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}</span></div>`
|
||||
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('hideInline', hideInline);
|
||||
hexo.extend.tag.register('hideBlock', hideBlock, {ends: true});
|
||||
7
scripts/tags/mermaid.js
Normal file
7
scripts/tags/mermaid.js
Normal file
@@ -0,0 +1,7 @@
|
||||
function mermaid(args, content) {
|
||||
return `<div class="mermaid">
|
||||
${content}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('mermaid', mermaid, {ends: true});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user