mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
Compare commits
23 Commits
7
.github/ISSUE_TEMPLATE.md
vendored
7
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,8 +1,15 @@
|
||||
<!--
|
||||
IMPORTANT: Please follow the template to create a new issue.
|
||||
重要:請依照該模板來提交。
|
||||
|
||||
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
|
||||
如果你是由舊版本升級到新版,運行時出現報錯,請首先把config裏新的內容複製到舊的butterfly設置去
|
||||
|
||||
If you are a problem when visit the website, please open your browser 'developer tools (shortcut F12)' and check the console if there is an error, include your website address in the feedback
|
||||
如果你是線上訪問出現問題,請檢查瀏覽器‘開發人員工具(快捷鍵F12)’的console是否有報錯,反饋時附上你的網站
|
||||
-->
|
||||
|
||||
|
||||
## I want to create a new issue <!-- 我想要建立一個新的issue -->
|
||||
|
||||
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->
|
||||
|
||||
18
README.md
18
README.md
@@ -1,19 +1,17 @@
|
||||
# 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://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.3.5-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/
|
||||
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||
|
||||
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
|
||||
|
||||
## Installation
|
||||
|
||||
Stable branch:
|
||||
Stable branch [recommend]:
|
||||
|
||||
```
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
@@ -37,7 +35,15 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Bu
|
||||
|
||||
## Documentation
|
||||
|
||||
Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
|
||||
Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW` and `zh-CN`
|
||||
|
||||
You can also join the Chat Group.
|
||||
|
||||
[ 💬 Join QQ Group [recommend]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||
|
||||
[ 💬 Join Telegram Group](https://t.me/hexo_butterfly)
|
||||
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
||||
16
README_CN.md
16
README_CN.md
@@ -1,20 +1,17 @@
|
||||
# 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://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.3.5-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/
|
||||
|
||||
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/)
|
||||
|
||||
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
|
||||
|
||||
## 安裝
|
||||
|
||||
在你的博客根目錄裡
|
||||
在你的博客根目錄裡安裝穩定版【推薦】
|
||||
|
||||
```
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
@@ -39,7 +36,14 @@ theme: Butterfly
|
||||
|
||||
可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15)
|
||||
|
||||
你也可以加入群組
|
||||
|
||||
[ 💬 QQ群 [推薦]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb)
|
||||
|
||||
[ 💬Telegram群](https://t.me/hexo_butterfly)
|
||||
|
||||
## 截圖
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
169
_config.yml
169
_config.yml
@@ -15,10 +15,6 @@ menu:
|
||||
- Music || /music/ || fa fa-music
|
||||
- Movie || /movies/ || fa fa-film
|
||||
|
||||
# Favicon
|
||||
# ---------------
|
||||
favicon: /img/favicon.ico
|
||||
|
||||
# PWA
|
||||
# See https://github.com/JLHwung/hexo-offline
|
||||
# ---------------
|
||||
@@ -49,12 +45,12 @@ copy:
|
||||
|
||||
# social settings
|
||||
# formal:
|
||||
# icon: link
|
||||
# icon: link || the description
|
||||
# ---------------
|
||||
social:
|
||||
fa fa-github: https://github.com/jerryc127
|
||||
fa fa-envelope: mailto:xxxxxxxx@gmail.com
|
||||
fa fa-rss: /atom.xml
|
||||
fa fa-github: https://github.com/jerryc127 || Github
|
||||
fa fa-envelope: mailto:xxxxxxx@gmail.com || Email
|
||||
fa fa-rss: /atom.xml || RSS
|
||||
|
||||
#### search ####
|
||||
# Algolia search
|
||||
@@ -67,10 +63,10 @@ algolia_search:
|
||||
labels:
|
||||
input_placeholder: Search for Posts
|
||||
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"
|
||||
hits_stats: '${hits} results found in ${time} ms'
|
||||
|
||||
# Local search
|
||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#本地搜索
|
||||
# Please see doc for more details: https://docs.jerryc.me/config.html#本地搜索
|
||||
# ---------------
|
||||
local_search:
|
||||
enable: false
|
||||
@@ -79,7 +75,7 @@ local_search:
|
||||
hits_empty: "We didn't find any results for the search: ${query}" # if there are no result
|
||||
|
||||
# MathJax
|
||||
# Please see doc for more details: https://jerryc.me/posts/21cfbf15/#MathJax
|
||||
# Please see doc for more details: https://docs.jerryc.me/config.html#mathjax
|
||||
# ---------------
|
||||
mathjax:
|
||||
enable: false
|
||||
@@ -104,6 +100,10 @@ mermaid:
|
||||
# built-in themes: default/forest/dark/neutral
|
||||
theme: default
|
||||
|
||||
# Favicon
|
||||
# ---------------
|
||||
favicon: /img/favicon.png
|
||||
|
||||
# Post info settings
|
||||
# ---------------
|
||||
avatar:
|
||||
@@ -114,7 +114,7 @@ avatar:
|
||||
index_img:
|
||||
|
||||
# if the banner of page not setting,it will show the top_img
|
||||
default_top_img: /img/index.jpg
|
||||
default_top_img: https://i.loli.net/2020/05/01/IuWi8QbHvzjlOPw.jpg
|
||||
|
||||
# the banner image of archive page
|
||||
archive_img:
|
||||
@@ -144,7 +144,7 @@ cover:
|
||||
position: both
|
||||
# 當沒有設置cover時,默認的封面顯示
|
||||
default_cover:
|
||||
- /img/post.jpg
|
||||
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||
|
||||
# if the photo link cannot connect,it will show that
|
||||
lodding_bg:
|
||||
@@ -155,7 +155,7 @@ lodding_bg:
|
||||
# A simple 404 page
|
||||
error_404:
|
||||
enable: false
|
||||
subtitle: "Page Not Found"
|
||||
subtitle: 'Page Not Found'
|
||||
background:
|
||||
|
||||
post_meta:
|
||||
@@ -168,9 +168,12 @@ post_meta:
|
||||
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://docs.jerryc.me/config.html#字數統計
|
||||
wordcount:
|
||||
enable: false
|
||||
post_wordcount: true
|
||||
min2read: true
|
||||
total_wordcount: true
|
||||
|
||||
toc:
|
||||
enable: true
|
||||
@@ -218,7 +221,7 @@ addtoany:
|
||||
disqus:
|
||||
enable: false
|
||||
shortname:
|
||||
count: false # top_img顯示評論數
|
||||
count: false # dispaly comment count in top_img
|
||||
|
||||
# Disqus.js版評論系統,應對大陸長城的折中方案,兼容原版:https://github.com/SukkaW/DisqusJS
|
||||
# API 申請地址:https://disqus.com/api/applications/
|
||||
@@ -231,7 +234,7 @@ disqusjs:
|
||||
api: https://disqus.skk.moe/disqus/ #一般情況下無需修改 API 地址
|
||||
admin:
|
||||
adminLabel:
|
||||
count: true # top_img顯示評論數
|
||||
count: false # dispaly comment count in top_img
|
||||
|
||||
laibili:
|
||||
enable: false
|
||||
@@ -249,24 +252,27 @@ gitalk:
|
||||
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顯示評論數
|
||||
count: false # dispaly comment count in 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
|
||||
notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki
|
||||
verify: false # valine verify code (true/false)
|
||||
notify: false # valine mail notify (true/false) Deprecated in v1.4.0+
|
||||
verify: false # valine verify code (true/false) Deprecated in v1.4.0+
|
||||
pageSize: 10 # comment list page size
|
||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||
lang: en # i18n: zh-cn/en
|
||||
lang: en # i18n: zh-CN/zh-TW/en/ja
|
||||
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
|
||||
guest_info: nick,mail,link #valine comment header info
|
||||
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顯示評論數
|
||||
emojiCDN: # emoji CDN
|
||||
enableQQ: false # enable the Nickname box to automatically get QQ Nickname and QQ Avatar
|
||||
requiredFields: nick,mail # required fields nick/mail/link
|
||||
bg: # valine background
|
||||
count: false # dispaly comment count in top_img
|
||||
|
||||
# utterances
|
||||
# https://utteranc.es/
|
||||
@@ -279,6 +285,17 @@ utterances:
|
||||
light_theme: github-light
|
||||
dark_theme: photon-dark
|
||||
|
||||
# Facebook Comments Plugin
|
||||
# https://developers.facebook.com/docs/plugins/comments/
|
||||
facebook_comments:
|
||||
enable: false
|
||||
app_id:
|
||||
user_id: # optional
|
||||
pageSize: 10 # The number of comments to show
|
||||
order_by: social # social/time/reverse_time
|
||||
lang: en_US # Language en_US/zh_CN/zh_TW and so on
|
||||
count: false
|
||||
|
||||
##### Footer Settings ####
|
||||
# ------------------------------------
|
||||
since: 2020
|
||||
@@ -313,6 +330,13 @@ google_adsense:
|
||||
client:
|
||||
enable_page_level_ads: true
|
||||
|
||||
# 廣告插入位置
|
||||
# 適用於開啓手動廣告的配置
|
||||
# ad:
|
||||
# index:
|
||||
# aside:
|
||||
# post:
|
||||
|
||||
#### 站長驗證 ####
|
||||
# Google Webmaster tools verification setting
|
||||
# See: https://www.google.com/webmasters/
|
||||
@@ -347,6 +371,14 @@ related_post:
|
||||
limit: 6 # 顯示推薦文章數目
|
||||
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||
|
||||
# figcaption
|
||||
# 圖片描述文字
|
||||
photofigcaption: false
|
||||
|
||||
# anchor
|
||||
# when you scroll in post, the url will update according to header id.
|
||||
anchor: false
|
||||
|
||||
#### 美化/效果 ####
|
||||
#--------------------------------
|
||||
|
||||
@@ -411,7 +443,7 @@ canvas_ribbon_piao:
|
||||
# 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.)
|
||||
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.
|
||||
@@ -437,8 +469,9 @@ click_heart:
|
||||
ClickShowText:
|
||||
enable: false
|
||||
text:
|
||||
- 本人
|
||||
- 超帥
|
||||
- I
|
||||
- LOVE
|
||||
- YOU
|
||||
fontSize: 15px
|
||||
|
||||
# 網站顯示模式
|
||||
@@ -449,8 +482,9 @@ display_mode: light
|
||||
# 美化頁面顯示
|
||||
beautify:
|
||||
enable: false
|
||||
field: post # site/post
|
||||
title-prefix-icon: '\f0c1'
|
||||
title-prefix-icon-color: "#F47466"
|
||||
title-prefix-icon-color: '#F47466'
|
||||
|
||||
# 全局字體
|
||||
font:
|
||||
@@ -479,8 +513,8 @@ subtitle:
|
||||
loop: false
|
||||
# source調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用金山詞霸的每日一句(簡體)
|
||||
# source: 2 調用一言網的一句話(簡體) #https://hitokoto.cn/
|
||||
# source: 1 調用搏天api的隨機語錄(簡體) https://api.btstu.cn/
|
||||
# source: 2 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 3 調用一句網(簡體) http://yijuzhan.com/
|
||||
# source: 4 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
@@ -496,6 +530,9 @@ subtitle:
|
||||
fontawesome_v5:
|
||||
enable: false
|
||||
|
||||
# 加載動畫 Loading Animation
|
||||
preloader: false
|
||||
|
||||
#### 側邊欄 ####
|
||||
#-------------------------------------
|
||||
# 側邊欄顯示設置
|
||||
@@ -503,18 +540,30 @@ aside:
|
||||
enable: true
|
||||
mobile: true # 手機頁面( 顯示寬度 < 768px )是否顯示aside內容
|
||||
position: right # left or right
|
||||
card_author: true
|
||||
card_announcement: true
|
||||
card_recent_post: true
|
||||
card_categories: true
|
||||
card_tags: true
|
||||
card_archives: true
|
||||
card_author:
|
||||
enable: true
|
||||
description:
|
||||
card_announcement:
|
||||
enable: true
|
||||
content: This is my Blog
|
||||
card_recent_post:
|
||||
enable: true
|
||||
limit: 5 # if set 0 will show all
|
||||
card_categories:
|
||||
enable: true
|
||||
limit: 8 # if set 0 will show all
|
||||
card_tags:
|
||||
enable: true
|
||||
limit: 40 # if set 0 will show all
|
||||
color: false
|
||||
card_archives:
|
||||
enable: true
|
||||
type: monthly # yearly or monthly
|
||||
format: MMMM YYYY # eg: YYYY年MM月
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
limit: 8 # if set 0 will show all
|
||||
card_webinfo: true
|
||||
|
||||
# 網站公告
|
||||
announcement:
|
||||
content: 感謝訪問本站,若喜歡請收藏 ^_^
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
# 訪問人數
|
||||
busuanzi:
|
||||
@@ -541,11 +590,11 @@ translate:
|
||||
#延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0
|
||||
translateDelay: 0
|
||||
#博客網址
|
||||
cookieDomain: "https://xxx/"
|
||||
cookieDomain: 'https://xxx/'
|
||||
#當文字是簡體時,按鈕顯示的文字
|
||||
msgToTraditionalChinese: "繁"
|
||||
msgToTraditionalChinese: '繁'
|
||||
#當文字是繁體時,按鈕顯示的文字
|
||||
msgToSimplifiedChinese: "簡"
|
||||
msgToSimplifiedChinese: '簡'
|
||||
|
||||
#閲讀模式
|
||||
readmode:
|
||||
@@ -584,8 +633,8 @@ fancybox:
|
||||
snackbar:
|
||||
enable: false
|
||||
position: bottom-left
|
||||
bg_light: "#49b1f5" #light mode時彈窗背景
|
||||
bg_dark: "#2d3035" #dark mode時彈窗背景
|
||||
bg_light: '#49b1f5' #light mode時彈窗背景
|
||||
bg_dark: '#2d3035' #dark mode時彈窗背景
|
||||
|
||||
#百度推送
|
||||
baidu_push:
|
||||
@@ -618,9 +667,8 @@ note:
|
||||
light_bg_offset: 0
|
||||
|
||||
# 圖片懶加載
|
||||
# https://github.com/aFarkas/lazysizes
|
||||
lazyload:
|
||||
enable: true
|
||||
# https://github.com/ApoorvSaxena/lozad.js
|
||||
lazyload: false
|
||||
|
||||
# 避免重複網址分散seo
|
||||
canonical: true
|
||||
@@ -639,21 +687,23 @@ 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
|
||||
# inject
|
||||
# 插入代码到头部</head>之前 和 尾部</body>之前
|
||||
inject:
|
||||
head:
|
||||
# - <link rel="stylesheet" href="xxxxx">
|
||||
bottom:
|
||||
# - <script src="xxxx"></script>
|
||||
|
||||
# CDN
|
||||
# 非必要不要修改
|
||||
CDN:
|
||||
# main
|
||||
main_css: /css/index.css
|
||||
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
||||
main: /js/main.js
|
||||
utils: /js/utils.js
|
||||
|
||||
# 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
|
||||
@@ -689,7 +739,7 @@ CDN:
|
||||
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
|
||||
lazyload: https://cdn.jsdelivr.net/npm/lozad/dist/lozad.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
|
||||
@@ -715,4 +765,5 @@ CDN:
|
||||
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
|
||||
|
||||
@@ -61,13 +61,15 @@ aside:
|
||||
card_tags: Tags
|
||||
card_archives: Archives
|
||||
card_recent_post: Recent Post
|
||||
card_bookmark: Add to bookmark
|
||||
card_bookmark: Bookmark
|
||||
card_webinfo:
|
||||
headline: Info
|
||||
article_name: Article
|
||||
runtime_name: Run time
|
||||
site_wordcount: Total Count
|
||||
site_uv_name: UV
|
||||
site_pv_name: PV
|
||||
more_button: More
|
||||
|
||||
donate: Donate
|
||||
share: Share
|
||||
@@ -103,3 +105,4 @@ Snackbar:
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
error_title: Page not found
|
||||
loading: Loading...
|
||||
|
||||
@@ -61,13 +61,15 @@ aside:
|
||||
card_tags: Tags
|
||||
card_archives: Archives
|
||||
card_recent_post: Recent Post
|
||||
card_bookmark: Add to bookmark
|
||||
card_bookmark: Bookmark
|
||||
card_webinfo:
|
||||
headline: Info
|
||||
article_name: Article
|
||||
runtime_name: Run time
|
||||
site_wordcount: Total Count
|
||||
site_uv_name: UV
|
||||
site_pv_name: PV
|
||||
more_button: More
|
||||
|
||||
donate: Donate
|
||||
share: Share
|
||||
@@ -103,3 +105,4 @@ Snackbar:
|
||||
night_to_day: Light Mode Activated Manually
|
||||
|
||||
error_title: Page not found
|
||||
loading: Loading...
|
||||
|
||||
@@ -68,8 +68,10 @@ aside:
|
||||
headline: 网站资讯
|
||||
article_name: 文章数目
|
||||
runtime_name: 已运行时间
|
||||
site_wordcount: 本站总字数
|
||||
site_uv_name: 本站访客数
|
||||
site_pv_name: 本站总访问量
|
||||
more_button: 查看更多
|
||||
|
||||
donate: 打赏
|
||||
share: 分享
|
||||
@@ -105,3 +107,4 @@ Snackbar:
|
||||
night_to_day: 你已切换为浅色模式
|
||||
|
||||
error_title: 页面没有找到
|
||||
loading: 加载中...
|
||||
@@ -9,7 +9,7 @@ footer:
|
||||
copy:
|
||||
success: 複製成功
|
||||
error: 複製錯誤
|
||||
noSupport: 瀏覽器不支持
|
||||
noSupport: 瀏覽器不支援
|
||||
|
||||
page:
|
||||
articles: 文章總覽
|
||||
@@ -24,28 +24,28 @@ post:
|
||||
created: 發表於
|
||||
updated: 更新於
|
||||
wordcount: 字數總計
|
||||
min2read: "閲讀時長: %s 分鐘"
|
||||
page_pv: 閲讀量
|
||||
min2read: "閱讀時長: %s 分鐘"
|
||||
page_pv: 閱讀量
|
||||
comments: 評論數
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章鏈接
|
||||
link: 文章連結
|
||||
copyright_notice: 版權聲明
|
||||
copyright_content: '本博客所有文章除特別聲明外,均採用
|
||||
copyright_content: '本部落格所有文章除特別聲明外,均採用
|
||||
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 相關推薦
|
||||
|
||||
search: 搜索
|
||||
search: 搜尋
|
||||
algolia_search:
|
||||
input_placeholder: 搜索文章
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: "找不到您查詢的內容:${query}"
|
||||
hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
|
||||
|
||||
local_search:
|
||||
label: 本地搜索
|
||||
input_placeholder: 搜索文章
|
||||
label: 本地搜尋
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: "找不到您查詢的內容:${query}"
|
||||
powered: "提供支持"
|
||||
powered: "提供支援"
|
||||
by: 由
|
||||
|
||||
pagination:
|
||||
@@ -67,33 +67,35 @@ aside:
|
||||
card_webinfo:
|
||||
headline: 網站資訊
|
||||
article_name: 文章數目
|
||||
runtime_name: 已運行時間
|
||||
runtime_name: 已執行時間
|
||||
site_wordcount: 本站總字數
|
||||
site_uv_name: 本站訪客數
|
||||
site_pv_name: 本站總訪問量
|
||||
more_button: 檢視更多
|
||||
|
||||
donate: 打賞
|
||||
share: 分享
|
||||
bookmark:
|
||||
title: 添加書籤
|
||||
title: 新增書籤
|
||||
|
||||
rightside:
|
||||
readmode_title: 閲讀模式
|
||||
font_plus_title: 放大字體
|
||||
font_minus_title: 縮小字體
|
||||
readmode_title: 閱讀模式
|
||||
font_plus_title: 放大字型
|
||||
font_minus_title: 縮小字型
|
||||
translate_title: 簡繁轉換
|
||||
night_mode_title: 夜間模式
|
||||
back_to_top: 回到頂部
|
||||
toc: 目錄
|
||||
scroll_to_comment: 直達評論
|
||||
setting: 設置
|
||||
setting: 設定
|
||||
|
||||
runtime_unit: 天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 鏈接
|
||||
link: 連結
|
||||
source: 來源
|
||||
info: 著作權歸作者所有。商業轉載請聯繫作者獲得授權,非商業轉載請註明出處。
|
||||
info: 著作權歸作者所有。商業轉載請聯絡作者獲得授權,非商業轉載請註明出處。
|
||||
|
||||
Snackbar:
|
||||
bookmark:
|
||||
@@ -105,5 +107,5 @@ Snackbar:
|
||||
night_to_day: 你已切換為淺色模式
|
||||
|
||||
error_title: 頁面沒有找到
|
||||
|
||||
loading: 載入中...
|
||||
|
||||
|
||||
@@ -1,87 +1,24 @@
|
||||
- var top_img = theme.error_404.background || theme.default_top_img
|
||||
- var bg_img = `background-image: url(${url_for(top_img)})`
|
||||
|
||||
doctype html
|
||||
html(lang=config.language data-theme=theme.display_mode)
|
||||
head
|
||||
- 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
|
||||
|
||||
include includes/head.pug
|
||||
body
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
|
||||
include includes/mobile-sidebar/index.pug
|
||||
|
||||
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))
|
||||
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||
include includes/additional-js.pug
|
||||
include includes/search/index.pug
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if theme.category_ui == 'index'
|
||||
include ./includes/mixins/UI.pug
|
||||
include ./includes/mixins/post-ui.pug
|
||||
#recent-posts.recent-posts.category_ui
|
||||
+UI_NEW(page.posts)
|
||||
+postUI
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
#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
|
||||
if site.data.link
|
||||
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=url_for(item.link) title=item.name target="_blank")
|
||||
if theme.lazyload
|
||||
img(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
|
||||
else
|
||||
img(src=url_for(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,3 +1,7 @@
|
||||
script(src=url_for(theme.CDN.jquery))
|
||||
script(src=url_for(theme.CDN.utils))
|
||||
script(src=url_for(theme.CDN.main))
|
||||
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
|
||||
@@ -38,8 +42,8 @@ if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
if theme.instantpage.enable
|
||||
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload) async="")
|
||||
if theme.lazyload
|
||||
script(src=url_for(theme.CDN.lazyload))
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart && theme.click_heart.enable
|
||||
@@ -62,4 +66,9 @@ if theme.mermaid.enable
|
||||
include ./math/mermaid.pug
|
||||
|
||||
if is_home()
|
||||
include index-js.pug
|
||||
include ./head/subtitle.pug
|
||||
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||
@@ -12,12 +12,13 @@ script.
|
||||
(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);
|
||||
}
|
||||
if is_post() && theme.disqus.count
|
||||
script.
|
||||
function getDisqusCount() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js';
|
||||
s.id = 'dsq-count-scr';
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
@@ -13,11 +13,12 @@ script.
|
||||
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);
|
||||
if is_post() && theme.disqusjs.count
|
||||
script.
|
||||
function getDisqusCount() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://!{theme.disqusjs.shortname}.disqus.com/count.js';
|
||||
s.id = 'dsq-count-scr';
|
||||
(d.head || d.body).appendChild(s);
|
||||
}
|
||||
window.addEventListener('load', getDisqusCount, false);
|
||||
|
||||
12
layout/includes/comments/facebook_comments.pug
Normal file
12
layout/includes/comments/facebook_comments.pug
Normal file
@@ -0,0 +1,12 @@
|
||||
#fb-root
|
||||
script(async defer crossorigin="anonymous" src=`https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v6.0`)
|
||||
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
|
||||
data-href=urlNoIndex()
|
||||
data-numposts= theme.facebook_comments.pageSize || 10
|
||||
data-order-by= theme.facebook_comments.order_by || 'social'
|
||||
data-width="100%")
|
||||
|
||||
if theme.darkmode.enable
|
||||
script.
|
||||
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
|
||||
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)
|
||||
@@ -8,7 +8,7 @@ script.
|
||||
admin: ['!{theme.gitalk.admin}'],
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
language: '!{theme.gitalk.language}',
|
||||
perPage: '!{theme.gitalk.perPage}',
|
||||
perPage: !{theme.gitalk.perPage},
|
||||
distractionFreeMode: !{theme.gitalk.distractionFreeMode},
|
||||
pagerDirection: '!{theme.gitalk.pagerDirection}',
|
||||
createIssueManually: !{theme.gitalk.createIssueManually},
|
||||
@@ -17,7 +17,11 @@ script.
|
||||
gitalk.render('gitalk-container')
|
||||
|
||||
function commentCount(n){
|
||||
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
||||
try {
|
||||
document.getElementsByClassName('gitalk-comment-count')[0].innerHTML= n
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
- 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
|
||||
- var fb = theme.facebook_comments && theme.facebook_comments.enable
|
||||
- var isComment = d || dj || l || gt || v || u || fb
|
||||
|
||||
if isComment
|
||||
hr
|
||||
@@ -24,3 +25,5 @@ if isComment
|
||||
include ./valine.pug
|
||||
else if u
|
||||
include ./utterances.pug
|
||||
else if fb
|
||||
include ./facebook_comments.pug
|
||||
@@ -1,19 +1,21 @@
|
||||
script#utterances_comment(src=theme.CDN.utterances
|
||||
repo=theme.utterances.repo
|
||||
issue-term=theme.utterances.issue_term
|
||||
theme=theme.utterances.light_theme
|
||||
theme= theme.display_mode === 'dark' ? theme.utterances.dark_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');
|
||||
}
|
||||
if theme.darkmode.enable
|
||||
script.
|
||||
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
document.getElementById('utterances_comment').setAttribute('theme',themeNow)
|
||||
|
||||
function utterancesTheme () {
|
||||
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
const message = {
|
||||
type: 'set-theme',
|
||||
theme: theme
|
||||
};
|
||||
const iframe = document.querySelector('.utterances-frame');
|
||||
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||
}
|
||||
|
||||
@@ -1,23 +1,37 @@
|
||||
- let emojiMaps = '""'
|
||||
if site.data.valine
|
||||
- emojiMaps = JSON.stringify(site.data.valine)
|
||||
|
||||
#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;
|
||||
var requestSetting = function (from,set) {
|
||||
var from = from
|
||||
var setting = set.split(',').filter(function(item){
|
||||
return from.indexOf(item) > -1
|
||||
});
|
||||
setting = setting.length == 0 ? from :setting;
|
||||
return setting
|
||||
}
|
||||
|
||||
var guestInfo = requestSetting(['nick','mail','link'],'#{ theme.valine.guest_info }')
|
||||
var requiredFields = requestSetting(['nick','mail','link'],'#{ theme.valine.requiredFields }')
|
||||
|
||||
window.valine = new Valine({
|
||||
el:'#vcomment',
|
||||
notify: #{theme.valine.notify},
|
||||
verify: #{theme.valine.verify},
|
||||
appId: '#{theme.valine.appId}',
|
||||
appKey: '#{theme.valine.appKey}',
|
||||
notify: #{theme.valine.notify},
|
||||
verify: #{theme.valine.verify},
|
||||
placeholder: '#{theme.valine.placeholder}',
|
||||
avatar: '#{theme.valine.avatar}',
|
||||
meta: guest_info,
|
||||
meta: guestInfo,
|
||||
pageSize: '#{theme.valine.pageSize}',
|
||||
lang: '#{theme.valine.lang}',
|
||||
recordIP: #{theme.valine.recordIP},
|
||||
serverURLs: '#{theme.valine.serverURLs}'
|
||||
serverURLs: '#{theme.valine.serverURLs}',
|
||||
emojiCDN: '#{theme.valine.emojiCDN}',
|
||||
emojiMaps: !{emojiMaps},
|
||||
enableQQ: #{theme.valine.enableQQ},
|
||||
requiredFields: requiredFields
|
||||
});
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
- var pageTitle = page.title || config.title || ''
|
||||
- var pageTitle
|
||||
- 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
|
||||
- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||||
- else if (is_year()) pageTitle += ': ' + page.year
|
||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error_title')
|
||||
- else pageTitle = page.title || config.title || ''
|
||||
|
||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||
- pageTitle ? '' : pageTitle = config.title || ''
|
||||
|
||||
- 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 pageDescription = page_description()
|
||||
- var pageKeywords
|
||||
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||||
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var without_html = url.replace('index.html', '')
|
||||
|
||||
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)
|
||||
meta(name="description" content!=pageDescription)
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
@@ -31,11 +34,9 @@ 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")
|
||||
if theme.douban
|
||||
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
|
||||
meta(name="referrer" content="no-referrer")
|
||||
|
||||
//- 預解析
|
||||
!=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
|
||||
@@ -55,8 +56,8 @@ 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))
|
||||
//- main css
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
|
||||
|
||||
if theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
|
||||
@@ -70,7 +71,7 @@ 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)
|
||||
link(rel="canonical" href=urlNoIndex())
|
||||
|
||||
if is_post()
|
||||
if(page.prev)
|
||||
@@ -96,4 +97,8 @@ if theme.blog_title_font.font_link
|
||||
|
||||
//- global config
|
||||
!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
|
||||
|
||||
include ./head/config_site.pug
|
||||
include ./head/noscript.pug
|
||||
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
@@ -4,14 +4,16 @@
|
||||
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: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:url" content=urlNoIndex())
|
||||
meta(property="og:site_name" content=config.title)
|
||||
meta(property="og:description" content=pageDescription)
|
||||
meta(property="og:description" content!=pageDescription)
|
||||
meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||
meta(property="article:published_time" content=date_xml(page.date))
|
||||
meta(property="article:modified_time" content=date_xml(page.updated))
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
if (theme.facebook_comments.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
if theme.facebook_comments.app_id
|
||||
meta(property="fb:app_id" content=theme.facebook_comments.app_id )
|
||||
if theme.facebook_comments.user_id
|
||||
meta(property="fb:admins" content=theme.facebook_comments.user_id)
|
||||
|
||||
if (theme.disqusjs && theme.disqusjs.enable && page.comments !== false && !is_tag() && !is_category() && !is_archive() && !is_home())
|
||||
link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
copyright = JSON.stringify({
|
||||
languages: {
|
||||
author: _p("copy_copyright.author") + ': ' + config.author,
|
||||
link: _p("copy_copyright.link") + ': ' + without_html,
|
||||
link: _p("copy_copyright.link") + ': ',
|
||||
source: _p("copy_copyright.source") + ': ' + config.title,
|
||||
info: _p("copy_copyright.info")
|
||||
}
|
||||
@@ -62,7 +62,6 @@
|
||||
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")
|
||||
},
|
||||
@@ -76,16 +75,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
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}',
|
||||
@@ -98,22 +87,24 @@ script.
|
||||
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},
|
||||
runtime: !{theme.runtimeshow.enable},
|
||||
copyright: !{copyright},
|
||||
ClickShowText: !{ClickShowText},
|
||||
medium_zoom: !{medium_zoom},
|
||||
fancybox: !{fancybox},
|
||||
medium_zoom: !{theme.medium_zoom.enable},
|
||||
fancybox: !{theme.fancybox.enable},
|
||||
Snackbar: !{Snackbar},
|
||||
baiduPush: !{baiduPush},
|
||||
highlightCopy: !{highlightCopy},
|
||||
highlightLang: !{highlightLang},
|
||||
highlightShrink: !{highlightShrink},
|
||||
isFontAwesomeV5: !{isFontAwesomeV5}
|
||||
baiduPush: !{theme.baidu_push && theme.baidu_push.enable},
|
||||
highlightCopy: !{theme.highlight_copy},
|
||||
highlightLang: !{theme.highlight_lang},
|
||||
highlightShrink: '!{theme.highlight_shrink}',
|
||||
isFontAwesomeV5: !{theme.fontawesome_v5 && theme.fontawesome_v5.enable},
|
||||
isPhotoFigcaption: !{theme.photofigcaption},
|
||||
islazyload: !{theme.lazyload},
|
||||
isanchor: !{theme.anchor}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
script.
|
||||
var GLOBAL_CONFIG_SITE = {
|
||||
isPost: !{is_post()},
|
||||
isHome: !{is_home()}
|
||||
}
|
||||
isHome: !{is_home()},
|
||||
isSidebar: !{is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
script.
|
||||
const autoChangeMode = '#{theme.darkmode.autoChangeMode}'
|
||||
var 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
|
||||
var isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
var isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
var isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
|
||||
var hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||
|
||||
if (t === undefined){
|
||||
if (isLightMode) activateLightMode()
|
||||
else if (isDarkMode) activateDarkMode()
|
||||
else if (isNotSpecified || hasNoSupport){
|
||||
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
|
||||
now = new Date();
|
||||
hour = now.getHours();
|
||||
isNight = hour < 6 || hour >= 18
|
||||
var now = new Date()
|
||||
var hour = now.getHours()
|
||||
var isNight = hour < 6 || hour >= 18
|
||||
isNight ? activateDarkMode() : activateLightMode()
|
||||
}
|
||||
} else if (t == 'light') activateLightMode()
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||
link(rel="dns-prefetch" href="//cdn.jsdelivr.net")
|
||||
|
||||
if theme.google_analytics
|
||||
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
|
||||
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="https://hm.baidu.com")
|
||||
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
||||
|
||||
if theme.tencent_analytics
|
||||
link(rel="preconnect" href="http://ta.qq.com")
|
||||
link(rel="dns-prefetch" href="http://ta.qq.com")
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
|
||||
link(rel="dns-prefetch" href="https://fonts.googleapis.com")
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
link(rel="dns-prefetch" href="//busuanzi.ibruce.info")
|
||||
|
||||
9
layout/includes/head/noscript.pug
Normal file
9
layout/includes/head/noscript.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
noscript.
|
||||
<style>
|
||||
#page-header {
|
||||
opacity: 1
|
||||
}
|
||||
.justified-gallery img{
|
||||
opacity: 1
|
||||
}
|
||||
</style>
|
||||
130
layout/includes/head/subtitle.pug
Normal file
130
layout/includes/head/subtitle.pug
Normal file
@@ -0,0 +1,130 @@
|
||||
if theme.subtitle.enable
|
||||
- var source = theme.subtitle.source
|
||||
- var subtitleEffect = theme.subtitle.effect
|
||||
|
||||
if subtitleEffect
|
||||
script(src=url_for(theme.CDN.typed))
|
||||
|
||||
if source == '1'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',)
|
||||
.then(function (res) {
|
||||
return res.json()
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var both = sub.unshift(data.text)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.text
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '2'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
fetch('https://v1.hitokoto.cn')
|
||||
.then(function (res) {
|
||||
return res.json()
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + data.from
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var both = sub.unshift(data.hitokoto, from)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '3'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
loadScript('http://yijuzhan.com/api/word.php?m=js', function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
var con = str[0]
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + str[1]
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var both = sub.unshift(con, from)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = con
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '4'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
loadScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
jinrishici.load(function (result) {
|
||||
if (subtitleEffect) {
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var content = result.data.content
|
||||
var both = sub.unshift(content)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = result.data.content
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else
|
||||
script.
|
||||
var subtitleEffect = !{subtitleEffect}
|
||||
if (subtitleEffect) {
|
||||
var typed = new Typed("#subtitle", {
|
||||
strings: '!{theme.subtitle.sub}'.split(","),
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
})
|
||||
} else {
|
||||
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
#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')
|
||||
span.pull_right.menus
|
||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||
#search_button
|
||||
a.site-page.social-icon.search
|
||||
i.fa.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||
|
||||
span.toggle-menu.close
|
||||
a.site-page
|
||||
i.fa.fa-bars.fa-fw(aria-hidden="true")
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ if theme.douban
|
||||
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 bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : ''
|
||||
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
@@ -33,9 +33,7 @@ if theme.douban
|
||||
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")
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll_down
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
else if is_post()
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
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])
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if !Array.isArray(value)
|
||||
.menus_item
|
||||
a.site-page(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
i.fa-fw(class=trim(value.split('||')[1]))
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page
|
||||
if label.split('||')[1]
|
||||
i.fa-fw(class=trim(label.split('||')[1]) 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])))
|
||||
if i.split('||')[2]
|
||||
i.fa-fw(class=trim(i.split('||')[2]))
|
||||
span=' '+trim(i.split('||')[0])
|
||||
@@ -1,65 +1,91 @@
|
||||
#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)
|
||||
#post-meta
|
||||
.meta-firstline
|
||||
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)
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
time.post-meta__date
|
||||
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date))
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated))
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- var date_type = data_type_update ? 'updated' : 'date'
|
||||
- var date_icon = data_type_update ? 'fa-history' :'fa-calendar'
|
||||
- var data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
time.post-meta__date(title=data_info + ' ' + full_date(page[date_type]))
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
=' ' + data_info + ' ' + date(page[date_type], config.date_format)
|
||||
|
||||
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||
span.post-meta__categories
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta__separator |
|
||||
|
||||
each item, index in page.categories.data
|
||||
i.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.post-meta__separator(aria-hidden="true")
|
||||
|
||||
.meta-secondline
|
||||
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||
if (postWordcount)
|
||||
span.post-meta-wordcount
|
||||
if theme.wordcount.post_wordcount
|
||||
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
|
||||
i.post-meta__icon(class=wordCountIcon aria-hidden="true")
|
||||
span= _p('post.wordcount') + ':'
|
||||
span.word-count= wordcount(page.content)
|
||||
if theme.wordcount.min2read
|
||||
span.post-meta__separator |
|
||||
if theme.wordcount.min2read
|
||||
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
|
||||
i.post-meta__icon(class=readCountIcon aria-hidden="true")
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
|
||||
.meta-thirdline
|
||||
span.post-meta-pv-cv
|
||||
if (postWordcount && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
if theme.busuanzi.page_pv
|
||||
i.fa.fa-eye.post-meta__icon.fa-fw(aria-hidden="true")
|
||||
i.fa.fa-eye.post-meta__icon(aria-hidden="true")
|
||||
span=_p('post.page_pv') + ':'
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
span.post-meta-commentcount
|
||||
- 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)
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(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)
|
||||
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(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)
|
||||
else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon.fa-fw(class=commentCount aria-hidden="true")
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-comment-count.comment-count
|
||||
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
span= _p('post.comments') + ':'
|
||||
a.comment-count(href=url_for(page.path) + '#post-comment')
|
||||
span.fb-comments-count(data-href=urlNoIndex())
|
||||
4
layout/includes/header/social.pug
Normal file
4
layout/includes/header/social.pug
Normal file
@@ -0,0 +1,4 @@
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=trim(url.split('||')[0]) target="_blank"
|
||||
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
|
||||
i(class=icon aria-hidden="true")
|
||||
@@ -1,116 +0,0 @@
|
||||
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,17 +1,20 @@
|
||||
- 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 data-theme=theme.display_mode)
|
||||
head
|
||||
include ./head.pug
|
||||
body
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
canvas.fireworks
|
||||
|
||||
!=partial('includes/mobile-sidebar/index', {}, {cache:theme.fragment_cache})
|
||||
if (is_post() && page.toc != false && theme.toc.enable)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
|
||||
include ./sidebar.pug
|
||||
|
||||
include ./sidebar.pug
|
||||
|
||||
#body-wrap
|
||||
if theme.background
|
||||
- var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
|
||||
@@ -36,11 +39,7 @@ html(lang=config.language data-theme=theme.display_mode)
|
||||
- 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
|
||||
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
|
||||
each item in theme.CDN_USE.js
|
||||
script(src=url_for(item))
|
||||
include ./additional-js.pug
|
||||
|
||||
|
||||
|
||||
|
||||
6
layout/includes/loading/loading-js.pug
Normal file
6
layout/includes/loading/loading-js.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
script.
|
||||
var endLoading = function () {
|
||||
document.body.style.overflow = 'auto';
|
||||
document.getElementById('loading-box').classList.add("loaded")
|
||||
}
|
||||
window.addEventListener('load',endLoading)
|
||||
9
layout/includes/loading/loading.pug
Normal file
9
layout/includes/loading/loading.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
#loading-box
|
||||
.loading-left-bg
|
||||
.loading-right-bg
|
||||
.spinner-box
|
||||
.configure-border-1
|
||||
.configure-core
|
||||
.configure-border-2
|
||||
.configure-core
|
||||
.loading-word= _p('loading')
|
||||
@@ -11,10 +11,10 @@ mixin articleSort(posts)
|
||||
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) + `'`)
|
||||
img(src=url_for(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)
|
||||
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
||||
.article-sort-item__title= article.title || 'No Title'
|
||||
- })
|
||||
@@ -1,32 +1,44 @@
|
||||
mixin UI_NEW(posts)
|
||||
- posts.each(function(article,index){
|
||||
mixin postUI(posts)
|
||||
each article , index in page.posts.data
|
||||
.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 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}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
if theme.lazyload
|
||||
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||
else
|
||||
img.post_bg(src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
img.post_bg(src=url_for(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 (is_home() && (article.top || article.sticky > 0))
|
||||
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.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date))
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
=date(article.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
i.fa.fa-history.fa-fw(aria-hidden="true")
|
||||
=date(page.updated, config.date_format)
|
||||
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
=date(article.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)]
|
||||
- var data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||
- var date_type = data_type_updated ? 'updated' : 'date'
|
||||
- var date_icon = data_type_updated ? 'fa-history' :'fa-calendar'
|
||||
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created')
|
||||
time.post-meta__date(title=date_title + ' ' + full_date(article[date_type]))
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
=date(article[date_type], config.date_format)
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
@@ -50,4 +62,7 @@ mixin UI_NEW(posts)
|
||||
.content!= expert
|
||||
else
|
||||
.content!= article.description
|
||||
- })
|
||||
|
||||
if theme.ad && theme.ad.index
|
||||
if (index + 1) % 3 == 0
|
||||
.recent-post-item.ad_height!=theme.ad.index
|
||||
@@ -23,5 +23,4 @@
|
||||
.headline= _p('aside.categories')
|
||||
.length_num= site.categories.length
|
||||
hr
|
||||
.menus_items
|
||||
include ../header/menu_item.pug
|
||||
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||
|
||||
@@ -17,10 +17,10 @@ else
|
||||
.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}'` )
|
||||
if theme.lazyload
|
||||
img.prev_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||
else
|
||||
img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
img.prev_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||
.pagination-info
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info=page.prev.title
|
||||
@@ -30,10 +30,10 @@ else
|
||||
- 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}'`)
|
||||
if theme.lazyload
|
||||
img.next_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||
else
|
||||
img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
img.next_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||
.pagination-info
|
||||
.label=_p('pagination.next')
|
||||
.next_info=page.next.title
|
||||
@@ -6,6 +6,6 @@
|
||||
ul.reward-all
|
||||
each item in theme.reward.QR_code
|
||||
li.reward-item
|
||||
img.lazyload.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||
.post-qr-code__desc=(item.itemlist||item).text
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
each article , index in page.posts.data
|
||||
.recent-post-item
|
||||
- var link = article.link || article.path
|
||||
- var title = article.title || _p('no_title')
|
||||
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius'
|
||||
- var post_cover = article.cover
|
||||
- var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg.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
|
||||
else
|
||||
.content!= article.description
|
||||
|
||||
|
||||
@@ -18,6 +18,6 @@ section#rightside.rightside
|
||||
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
|
||||
if is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||
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")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if (theme.sharejs && theme.sharejs.enable)
|
||||
.social-share(data-image= page.cover|| theme.avatar.img data-sites= theme.sharejs.sites)
|
||||
.social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites)
|
||||
link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css))
|
||||
script(src=url_for(theme.CDN.sharejs))
|
||||
@@ -1,12 +1,16 @@
|
||||
#sidebar
|
||||
- const showToc = is_post() && page.toc != false && theme.toc.enable
|
||||
-
|
||||
let tocNumber
|
||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
||||
else tocNumber = true
|
||||
-
|
||||
if(showToc)
|
||||
- let showToc = is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||
- let autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
|
||||
|
||||
-
|
||||
let tocNumber
|
||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
||||
else tocNumber = true
|
||||
-
|
||||
|
||||
if(showToc)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
|
||||
#sidebar
|
||||
.sidebar-toc
|
||||
div.sidebar-toc__title= _p('sidebar.catalog')
|
||||
div.sidebar-toc__progress
|
||||
|
||||
2
layout/includes/widget/card_ad.pug
Normal file
2
layout/includes/widget/card_ad.pug
Normal file
@@ -0,0 +1,2 @@
|
||||
.card-widget.card-ad
|
||||
!= theme.ad.aside
|
||||
@@ -3,4 +3,4 @@
|
||||
.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.aside.card_announcement.content
|
||||
@@ -3,4 +3,9 @@
|
||||
.item-headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
span= _p('aside.card_archives')
|
||||
!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
|
||||
- let type = theme.aside.card_archives.type || 'monthly'
|
||||
- let format = theme.aside.card_archives.format || 'MMMM YYYY'
|
||||
- let order = theme.aside.card_archives.order || -1
|
||||
- let limit = theme.aside.card_archives.limit === 0 ? 0 : theme.aside.card_archives.limit || 8
|
||||
!= aside_archives({ type:type, format: format, order: order, limit: limit })
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.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
|
||||
.author-info__description= theme.aside.card_author.description || config.description
|
||||
|
||||
.card-info-data
|
||||
if site.posts.length
|
||||
@@ -31,6 +31,4 @@
|
||||
|
||||
if(theme.social)
|
||||
.card-info-social-icons.is-center
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=url target="_blank")
|
||||
i(class=icon aria-hidden="true")
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
|
||||
@@ -4,20 +4,6 @@ if site.categories.length
|
||||
.item-headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
span= _p('aside.card_categories')
|
||||
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
|
||||
|
||||
if childCount > 0
|
||||
ul.aside-category-item.child
|
||||
+displayCategories(category._id)
|
||||
- })
|
||||
|
||||
+displayCategories()
|
||||
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 })
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside-recent-item
|
||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||
- site.posts.sort('date', -1).limit(postLimit).each(function(article){
|
||||
.aside-recent-post
|
||||
- var link = article.link || article.path
|
||||
- var title = article.title || _p('no_title')
|
||||
@@ -14,14 +15,12 @@
|
||||
a(href=url_for(link))
|
||||
if post_cover && theme.cover.aside_enable
|
||||
.aside-post-cover
|
||||
if theme.lazyload.enable
|
||||
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)
|
||||
if theme.lazyload
|
||||
img.aside-post-bg(data-src=url_for(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=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||
img.aside-post-bg(src=url_for(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)]
|
||||
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||
|
||||
- })
|
||||
|
||||
@@ -4,4 +4,9 @@ if site.tags.length
|
||||
.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: '#99a9bf'})
|
||||
|
||||
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
|
||||
if theme.aside.card_tags.color
|
||||
.card-tag-cloud!=cloudTags({source: site.tags, minfontsize: 16, maxfontsize: 22, limit: tagLimit})
|
||||
else
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 22, amount: tagLimit , color: true, start_color: '#999', end_color: '#99a9bf'})
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
.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.wordcount.enable && theme.wordcount.total_wordcount
|
||||
.webinfo-item
|
||||
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :"
|
||||
.webinfo-site-wordcount=totalcount(site)
|
||||
if theme.busuanzi.site_uv
|
||||
.webinfo-item
|
||||
.webinfo-site-uv-name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
if theme.aside.enable
|
||||
if page.aside !== false
|
||||
#aside_content.aside_content
|
||||
if theme.aside.card_author
|
||||
if theme.aside.card_author.enable
|
||||
!=partial('includes/widget/card_author', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_announcement
|
||||
if theme.aside.card_announcement.enable
|
||||
!=partial('includes/widget/card_announcement', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_recent_post
|
||||
if theme.aside.card_recent_post.enable
|
||||
!=partial('includes/widget/card_recent_post', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_categories
|
||||
if theme.ad && theme.ad.aside
|
||||
!=partial('includes/widget/card_ad', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_categories.enable
|
||||
!=partial('includes/widget/card_categories', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_tags
|
||||
if theme.aside.card_tags.enable
|
||||
!=partial('includes/widget/card_tags', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_archives
|
||||
if theme.aside.card_archives.enable
|
||||
!=partial('includes/widget/card_archives', {}, {cache:theme.fragment_cache})
|
||||
if theme.aside.card_webinfo
|
||||
!=partial('includes/widget/card_webinfo', {}, {cache:theme.fragment_cache})
|
||||
@@ -1,6 +1,7 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
include ./includes/mixins/post-ui.pug
|
||||
#recent-posts.recent-posts
|
||||
include includes/recent-posts.pug
|
||||
+postUI
|
||||
include includes/pagination.pug
|
||||
@@ -1,14 +0,0 @@
|
||||
.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,7 +2,14 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if page.type === 'tags'
|
||||
include page-tags.pug
|
||||
.tag-cloud
|
||||
.tag-cloud__title= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud__amount= site.tags.length
|
||||
.tag-cloud-tags
|
||||
!=cloudTags({source: site.tags, minfontsize: 15, maxfontsize: 30, limit: 0})
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
else if page.type === 'link'
|
||||
include flink.pug
|
||||
else if page.type === 'categories'
|
||||
|
||||
@@ -2,7 +2,7 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
article#post(class="")
|
||||
#article-container!=page.content
|
||||
#article-container.post-content!=page.content
|
||||
include includes/post/post-copyright.pug
|
||||
.tag_share
|
||||
if (theme.post_meta.post.tags)
|
||||
@@ -13,8 +13,12 @@ block content
|
||||
|
||||
if theme.reward.enable
|
||||
!=partial('includes/post/reward', {}, {cache:theme.fragment_cache})
|
||||
include includes/pagination.pug
|
||||
|
||||
//- ad
|
||||
if theme.ad && theme.ad.post
|
||||
.post-ad!=theme.ad.post
|
||||
|
||||
include includes/pagination.pug
|
||||
if theme.related_post && theme.related_post.enable
|
||||
!= related_posts(page,site.posts)
|
||||
if page.comments !== false
|
||||
|
||||
@@ -2,9 +2,9 @@ extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if theme.tag_ui == 'index'
|
||||
include ./includes/mixins/UI.pug
|
||||
include ./includes/mixins/post-ui.pug
|
||||
#recent-posts.recent-posts
|
||||
+UI_NEW(page.posts)
|
||||
+postUI
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
|
||||
17
package.json
17
package.json
@@ -1,5 +1,18 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "2.2.0",
|
||||
"description": "A Hexo Theme: Butterfly"
|
||||
"version": "2.3.5",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
},
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"keywords": [
|
||||
"hexo",
|
||||
"theme",
|
||||
"butterfly",
|
||||
"Card UI Design"
|
||||
],
|
||||
"repository": "https://github.com/jerryc127/hexo-theme-butterfly.git",
|
||||
"author": "Jerry <wong@jerryc.me>",
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
hexo.extend.generator.register('404', function(locals){
|
||||
/**
|
||||
* Butterfly
|
||||
* 404 error page
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.generator.register('404', function (locals) {
|
||||
if (!hexo.theme.config.error_404.enable) return
|
||||
return {
|
||||
path: '404.html',
|
||||
data: locals.posts,
|
||||
layout: ['404']
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.on('generateBefore', function () {
|
||||
const rootConfig = hexo.config
|
||||
if (hexo.locals.get) {
|
||||
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* 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)
|
||||
)
|
||||
}));
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
'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);
|
||||
22
scripts/filters/post_lazyload.js
Normal file
22
scripts/filters/post_lazyload.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* lazyload
|
||||
* replace src to data-src
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
function lazyProcess (htmlContent) {
|
||||
var bg = hexo.theme.config.lodding_bg.post ? urlFor(hexo.theme.config.lodding_bg.post) : 'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
|
||||
return htmlContent.replace(/(<img .*?src=)/ig, `$1 ${bg} data-src=`)
|
||||
}
|
||||
|
||||
var processPost = function (data) {
|
||||
if (!hexo.theme.config.lazyload) return
|
||||
data.content = lazyProcess.call(this, data.content)
|
||||
return data
|
||||
}
|
||||
|
||||
hexo.extend.filter.register('after_post_render', processPost)
|
||||
@@ -1,23 +0,0 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
34
scripts/filters/random_cover.js
Normal file
34
scripts/filters/random_cover.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* ramdom cover
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.filter.register('before_post_render', function (data) {
|
||||
if (data.cover === false) {
|
||||
data.randomcover = randomCover()
|
||||
return data
|
||||
}
|
||||
data.cover = data.cover || randomCover()
|
||||
return data
|
||||
})
|
||||
|
||||
var randomCover = function () {
|
||||
var theme = hexo.theme.config
|
||||
var cover
|
||||
var num
|
||||
|
||||
if (theme.cover.default_cover) {
|
||||
if (!Array.isArray(theme.cover.default_cover)) {
|
||||
cover = theme.cover.default_cover
|
||||
return cover
|
||||
} else {
|
||||
num = Math.floor(Math.random() * theme.cover.default_cover.length)
|
||||
cover = theme.cover.default_cover[num]
|
||||
return cover
|
||||
}
|
||||
} else {
|
||||
return theme.default_top_img
|
||||
}
|
||||
}
|
||||
112
scripts/helpers/aside_archives.js
Normal file
112
scripts/helpers/aside_archives.js
Normal file
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* for aside archives
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.helper.register('aside_archives', function (options = {}) {
|
||||
const { config } = this
|
||||
const archiveDir = config.archive_dir
|
||||
const { timezone } = config
|
||||
const lang = toMomentLocale(this.page.lang || this.page.language || config.language)
|
||||
let { format } = options
|
||||
const type = options.type || 'monthly'
|
||||
const { transform } = options
|
||||
const showCount = Object.prototype.hasOwnProperty.call(options, 'show_count') ? options.show_count : true
|
||||
const order = options.order || -1
|
||||
const compareFunc = type === 'monthly'
|
||||
? (yearA, monthA, yearB, monthB) => yearA === yearB && monthA === monthB
|
||||
: (yearA, monthA, yearB, monthB) => yearA === yearB
|
||||
const limit = options.limit
|
||||
const moreButton = this._p('aside.more_button')
|
||||
let result = ''
|
||||
|
||||
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)
|
||||
|
||||
const year = date.year()
|
||||
const month = date.month() + 1
|
||||
const lastData = data[length - 1]
|
||||
|
||||
if (!lastData || !compareFunc(lastData.year, lastData.month, year, month)) {
|
||||
if (lang) date = date.locale(lang)
|
||||
const name = date.format(format)
|
||||
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="card-archive-list">'
|
||||
|
||||
const len = data.length
|
||||
const Judge = limit === 0 ? len : Math.min(len, limit)
|
||||
|
||||
for (let i = 0; i < Judge; i++) {
|
||||
const item = data[i]
|
||||
|
||||
result += '<li class="card-archive-list-item">'
|
||||
|
||||
result += `<a class="card-archive-list-link" href="${link(item)}">`
|
||||
result += '<span class="card-archive-list-date">'
|
||||
result += transform ? transform(item.name) : item.name
|
||||
result += '</span>'
|
||||
|
||||
if (showCount) {
|
||||
result += `<span class="card-archive-list-count">${item.count}</span>`
|
||||
}
|
||||
result += '</a>'
|
||||
result += '</li>'
|
||||
}
|
||||
|
||||
if (len > Judge) {
|
||||
result += '<li class="card-archive-list-item more is-center">'
|
||||
result += `<a class="card-archive-list-link-more" href="${this.url_for(archiveDir)}">
|
||||
<span>${moreButton}</span><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>`
|
||||
}
|
||||
result += '</ul>'
|
||||
return result
|
||||
})
|
||||
|
||||
var toMomentLocale = function (lang) {
|
||||
if (lang === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
// moment.locale('') equals moment.locale('en')
|
||||
// moment.locale(null) equals moment.locale('en')
|
||||
if (!lang || lang === 'en' || lang === 'default') {
|
||||
return 'en'
|
||||
}
|
||||
return lang.toLowerCase().replace('_', '-')
|
||||
}
|
||||
97
scripts/helpers/aside_categories.js
Normal file
97
scripts/helpers/aside_categories.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* for aside categories
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
hexo.extend.helper.register('aside_categories', function (categories, options) {
|
||||
if (
|
||||
!options &&
|
||||
(!categories || !Object.prototype.hasOwnProperty.call(categories, 'length'))
|
||||
) {
|
||||
options = categories
|
||||
categories = this.site.categories
|
||||
}
|
||||
|
||||
if (!categories || !categories.length) return ''
|
||||
options = options || {}
|
||||
const { config } = this
|
||||
const showCount = Object.prototype.hasOwnProperty.call(options, 'show_count')
|
||||
? options.show_count
|
||||
: true
|
||||
const depth = options.depth ? parseInt(options.depth, 10) : 0
|
||||
const orderby = options.orderby || 'name'
|
||||
const order = options.order || 1
|
||||
const categoryDir = this.url_for(config.category_dir)
|
||||
const limit = options.limit === 0 ? categories.length : options.limit
|
||||
const buttonLabel = this._p('aside.more_button')
|
||||
const prepareQuery = (parent) => {
|
||||
const query = {}
|
||||
if (parent) {
|
||||
query.parent = parent
|
||||
} else {
|
||||
query.parent = {
|
||||
$exists: false,
|
||||
}
|
||||
}
|
||||
return categories
|
||||
.find(query)
|
||||
.sort(orderby, order)
|
||||
.filter((cat) => cat.length)
|
||||
}
|
||||
|
||||
const hierarchicalList = (t, level, parent) => {
|
||||
let result = ''
|
||||
if (t > 0) {
|
||||
prepareQuery(parent).forEach((cat, i) => {
|
||||
if (t > 0) {
|
||||
t = t - 1
|
||||
let child
|
||||
if (!depth || level + 1 < depth) {
|
||||
var childList = hierarchicalList(t, level + 1, cat._id)
|
||||
child = childList[0]
|
||||
t = childList[1]
|
||||
}
|
||||
|
||||
result += '<li class="card-category-list-item">'
|
||||
|
||||
result += `<a class="card-category-list-link" href="${this.url_for(
|
||||
cat.path
|
||||
)}">`
|
||||
result += `<span class="card-category-list-name">${cat.name}</span>`
|
||||
|
||||
if (showCount) {
|
||||
result += `<span class="card-category-list-count">${cat.length}</span>`
|
||||
}
|
||||
|
||||
result += '</a>'
|
||||
result += '</li>'
|
||||
|
||||
if (child) {
|
||||
result += `<ul class="card-category-list child">${child}</ul>`
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return [result, t]
|
||||
}
|
||||
|
||||
const list = hierarchicalList(limit, 0)
|
||||
|
||||
var moreButton = function () {
|
||||
var moreHtml = ''
|
||||
if (categories.length <= limit) return ''
|
||||
moreHtml += '<li class="card-category-list-item more is-center">'
|
||||
moreHtml += `<a class="card-category-list-link-more" href="${categoryDir}">
|
||||
<span>${buttonLabel}</span><i class="fa fa-angle-right" aria-hidden="true"></i></a></li>`
|
||||
|
||||
return moreHtml
|
||||
}
|
||||
|
||||
return `<ul class="card-category-list">
|
||||
${list[0]}
|
||||
${moreButton()}
|
||||
</ul>`
|
||||
})
|
||||
@@ -1,103 +0,0 @@
|
||||
"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;
|
||||
});
|
||||
58
scripts/helpers/page.js
Normal file
58
scripts/helpers/page.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* @example
|
||||
* page_description()
|
||||
* injectHtml(data)
|
||||
* cloudTags(source, minfontsize, maxfontsize, limit)
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const { stripHTML, escapeHTML } = require('hexo-util')
|
||||
|
||||
hexo.extend.helper.register('page_description', function () {
|
||||
const { config, page } = this
|
||||
let description = page.description || page.content || page.title || config.description
|
||||
|
||||
if (description) {
|
||||
description = escapeHTML(stripHTML(description).substring(0, 200)
|
||||
.trim()
|
||||
).replace(/\n/g, ' ')
|
||||
return description
|
||||
}
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('injectHtml', function (data) {
|
||||
let result = ''
|
||||
if (!data) return ''
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
result += data[i]
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('cloudTags', function (options = {}) {
|
||||
const env = this
|
||||
const source = options.source
|
||||
const minfontsize = options.minfontsize
|
||||
const maxfontsize = options.maxfontsize
|
||||
const limit = options.limit
|
||||
|
||||
let result = ''
|
||||
const tagLimit = limit === 0 ? source.length : limit
|
||||
source.sort('name').limit(tagLimit).forEach(function (tags) {
|
||||
var fontSize = Math.floor(Math.random() * (maxfontsize - minfontsize) + minfontsize) + 'px'
|
||||
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='${env.url_for(tags.path)}' style='font-size:${fontSize}; color:${color}'>${tags.name}</a>`
|
||||
})
|
||||
return result
|
||||
})
|
||||
|
||||
hexo.extend.helper.register('urlNoIndex', function () {
|
||||
const { permalink } = hexo.config
|
||||
let url = this.url.replace(/index\.html$/, '')
|
||||
if (!permalink.endsWith('.html')) {
|
||||
url = url.replace(/\.html$/, '')
|
||||
}
|
||||
return url
|
||||
})
|
||||
@@ -1,90 +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,
|
||||
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;
|
||||
}
|
||||
}
|
||||
123
scripts/helpers/related_post.js
Normal file
123
scripts/helpers/related_post.js
Normal file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* Butterfly
|
||||
* Related Posts
|
||||
* According the tag
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
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 limitNum = config.related_post.limit || 6
|
||||
var dateType = config.related_post.date_type || 'created'
|
||||
var headlineLang = this._p('post.recommend')
|
||||
var lazySrc = config.lazyload ? 'data-src' : 'src'
|
||||
|
||||
relatedPosts = relatedPosts.sort(compare('weight'))
|
||||
|
||||
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>' +
|
||||
' ' +
|
||||
headlineLang +
|
||||
'</span></div>'
|
||||
result += '<div class="relatedPosts_list">'
|
||||
|
||||
for (var i = 0; i < Math.min(relatedPosts.length, limitNum); 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" ' +
|
||||
lazySrc +
|
||||
'="' +
|
||||
cover +
|
||||
'">'
|
||||
if (dateType === '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,11 +1,18 @@
|
||||
const url_for = require('hexo-util').url_for.bind(hexo);
|
||||
/**
|
||||
* Butterfly
|
||||
* galleryGroup and allery
|
||||
*/
|
||||
|
||||
function gallery(args, content) {
|
||||
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
||||
</div>`;
|
||||
'use strict'
|
||||
|
||||
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){
|
||||
function galleryGroup (args) {
|
||||
const name = args[0]
|
||||
const desrc = args[1]
|
||||
const url = url_for(args[2])
|
||||
@@ -23,5 +30,5 @@ function galleryGroup(args){
|
||||
`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('gallery', gallery, {ends: true});
|
||||
hexo.extend.tag.register('galleryGroup', galleryGroup);
|
||||
hexo.extend.tag.register('gallery', gallery, { ends: true })
|
||||
hexo.extend.tag.register('galleryGroup', galleryGroup)
|
||||
|
||||
@@ -1,33 +1,71 @@
|
||||
|
||||
/**
|
||||
* {% hideInline content,display,bg,color %}
|
||||
* content不能包含當引號,可用 '
|
||||
* Butterfly
|
||||
* @example
|
||||
* hideInline
|
||||
* {% hideInline content,display,bg,color %}
|
||||
* content不能包含當引號,可用 '
|
||||
* hideBlock
|
||||
* {% hideBlock display,bg,color %}
|
||||
* content
|
||||
* {% endhideBlock %}
|
||||
* hideToggle
|
||||
* {% hideToggle display,bg,color %}
|
||||
* content
|
||||
* {% endhideToggle %}
|
||||
*/
|
||||
function hideInline(args) {
|
||||
|
||||
'use strict'
|
||||
|
||||
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>`
|
||||
var content = args[0]
|
||||
var display = args[1] || 'Click'
|
||||
var bg = args[2] || false
|
||||
var color = args[3] || false
|
||||
var group = 'style="'
|
||||
|
||||
if (bg) group += `background-color: ${bg};`
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" ${group}>${display}
|
||||
</a><span class="hide-content">${content}</span></span>`
|
||||
}
|
||||
|
||||
/**
|
||||
* {% hideBlock display,bg,color %}
|
||||
* content
|
||||
* {% endhideBlock %}
|
||||
*/
|
||||
function hideBlock(args,content) {
|
||||
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'
|
||||
var display = args[0] || 'Click'
|
||||
var bg = args[1] || false
|
||||
var color = args[2] || false
|
||||
var group = 'style="'
|
||||
|
||||
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>`
|
||||
if (bg) group += `background-color: ${bg};`
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<div class="hide-block"><a class="hide-button button--primary button--animated" ${group}>${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});
|
||||
function hideToggle (args, content) {
|
||||
args = args.join(' ').split(',')
|
||||
var display = args[0]
|
||||
var bg = args[1] || false
|
||||
var color = args[2] || false
|
||||
var group = 'style="'
|
||||
var border = ''
|
||||
|
||||
if (bg) {
|
||||
border = `style="border: 1px solid ${bg}"`
|
||||
group += `background-color: ${bg};`
|
||||
}
|
||||
if (color) group += `color: ${color}`
|
||||
group += '"'
|
||||
|
||||
return `<div class="hide-toggle" ${border}><div class="hide-button toggle-title" ${group}><i class="fa fa-caret-right fa-fw"></i><span>${display}</span></div>
|
||||
<div class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</div></div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('hideInline', hideInline)
|
||||
hexo.extend.tag.register('hideBlock', hideBlock, { ends: true })
|
||||
hexo.extend.tag.register('hideToggle', hideToggle, { ends: true })
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
function mermaid(args, content) {
|
||||
/**
|
||||
* Butterfly
|
||||
* mermaid
|
||||
* https://github.com/mermaid-js/mermaid
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
function mermaid (args, content) {
|
||||
return `<div class="mermaid">
|
||||
${content}
|
||||
</div>`;
|
||||
</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('mermaid', mermaid, {ends: true});
|
||||
hexo.extend.tag.register('mermaid', mermaid, { ends: true })
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* transplant from hexo-theme-next
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
'use strict'
|
||||
|
||||
function postNote(args, content) {
|
||||
function postNote (args, content) {
|
||||
return `<div class="note ${args.join(' ')}">
|
||||
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
|
||||
</div>`;
|
||||
${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}
|
||||
</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('note', postNote, {ends: true});
|
||||
hexo.extend.tag.register('subnote', postNote, {ends: true});
|
||||
hexo.extend.tag.register('note', postNote, { ends: true })
|
||||
hexo.extend.tag.register('subnote', postNote, { ends: true })
|
||||
|
||||
@@ -62,7 +62,7 @@ h6
|
||||
left: $sidebar-icon-left
|
||||
z-index: 100
|
||||
font-size: $sidebar-icon-size
|
||||
opacity: 0
|
||||
// opacity: 0
|
||||
cursor: pointer
|
||||
transition: all .2s
|
||||
|
||||
@@ -143,6 +143,9 @@ table
|
||||
.is_visible
|
||||
display: block !important
|
||||
|
||||
.is-visible-inline
|
||||
display: inline-block !important
|
||||
|
||||
.is_invisible
|
||||
display: none !important
|
||||
|
||||
@@ -187,6 +190,13 @@ img[src=''],
|
||||
img:not([src])
|
||||
opacity: 0
|
||||
|
||||
.img-alt
|
||||
margin: -.5rem 0 .5rem
|
||||
color: $font-black
|
||||
|
||||
&:hover
|
||||
text-decoration: none !important
|
||||
|
||||
// hexo tag video
|
||||
.video-container
|
||||
position: relative
|
||||
@@ -203,39 +213,18 @@ img:not([src])
|
||||
width: 100%
|
||||
height: 100%
|
||||
|
||||
// tag-hide
|
||||
.hide-inline,
|
||||
.hide-block
|
||||
& > .hide-button
|
||||
position: relative
|
||||
z-index: 1
|
||||
display: inline-block
|
||||
padding: 0 1rem
|
||||
background: $tag-hide-bg
|
||||
text-align: center
|
||||
cursor: pointer
|
||||
|
||||
&:hover
|
||||
text-decoration: none !important
|
||||
|
||||
& > .hide-content
|
||||
display: none
|
||||
|
||||
.hide-inline
|
||||
& > .hide-button
|
||||
margin: 0 .3rem
|
||||
|
||||
& > .hide-content
|
||||
margin: 0 .3rem
|
||||
|
||||
.hide-block
|
||||
margin: 0 0 .8rem
|
||||
|
||||
.comment_headling
|
||||
margin-bottom: 10px
|
||||
font-weight: 700
|
||||
font-size: 20px
|
||||
|
||||
.post-ad
|
||||
margin: 2rem 0
|
||||
|
||||
.ad_height
|
||||
display: block !important
|
||||
height: auto !important
|
||||
|
||||
#content-inner,
|
||||
#footer
|
||||
animation: main 1s
|
||||
@@ -243,17 +232,17 @@ img:not([src])
|
||||
#nav
|
||||
animation: nav-effect 1s
|
||||
|
||||
#page-header
|
||||
animation: header-effect 1s
|
||||
|
||||
#site_title,
|
||||
#site_subtitle
|
||||
animation: titlescale 1s
|
||||
|
||||
canvas,
|
||||
canvas:not(#ribbon-canvas),
|
||||
#web_bg
|
||||
animation: to_show 4s
|
||||
|
||||
#ribbon-canvas
|
||||
animation: ribbon_to_show 4s
|
||||
|
||||
.card-announcement-animation
|
||||
color: #FF0000
|
||||
animation: announ_animation .8s linear infinite
|
||||
@@ -280,10 +269,10 @@ if hexo-config('avatar.effect') == true
|
||||
|
||||
.tocOpenMobile
|
||||
.sidebar-toc__title
|
||||
animation: tocsidebarRtoL .5s
|
||||
animation: tocsidebarRtoL .4s
|
||||
|
||||
.sidebar-toc__progress
|
||||
animation: tocsidebarRtoL .5s
|
||||
animation: tocsidebarRtoL .6s
|
||||
|
||||
.sidebar-toc__content
|
||||
animation: tocsidebarRtoL .7s
|
||||
@@ -310,18 +299,6 @@ if hexo-config('avatar.effect') == true
|
||||
opacity: 1
|
||||
transform: translateY(0)
|
||||
|
||||
@keyframes header-effect
|
||||
0%
|
||||
opacity: 0
|
||||
|
||||
50%
|
||||
opacity: 0
|
||||
transform: translateY(-50px)
|
||||
|
||||
100%
|
||||
opacity: 1
|
||||
transform: translateY(0)
|
||||
|
||||
@keyframes headerNoOpacity
|
||||
0%
|
||||
transform: translateY(-50px)
|
||||
@@ -363,6 +340,13 @@ if hexo-config('avatar.effect') == true
|
||||
100%
|
||||
opacity: 1
|
||||
|
||||
@keyframes ribbon_to_show
|
||||
0%
|
||||
opacity: 0
|
||||
|
||||
100%
|
||||
opacity: hexo-config('canvas_ribbon.alpha')
|
||||
|
||||
@keyframes avatar_turn_around
|
||||
from
|
||||
transform: rotate(0)
|
||||
|
||||
@@ -271,6 +271,3 @@ blockquote
|
||||
background: darken($highlight-background, 5)
|
||||
color: $highlight-foreground
|
||||
font-size: 14px
|
||||
|
||||
.highlight-close
|
||||
height: 0 !important
|
||||
@@ -16,14 +16,13 @@
|
||||
|
||||
.card-info
|
||||
img
|
||||
display: inline-block
|
||||
width: 110px
|
||||
height: 110px
|
||||
border-radius: 70px
|
||||
transition: all .3s
|
||||
transition: all .5s
|
||||
|
||||
&:hover
|
||||
transform: rotate(540deg)
|
||||
transform: rotate(360deg)
|
||||
|
||||
.author-info
|
||||
&__name
|
||||
@@ -34,23 +33,24 @@
|
||||
margin-top: -.3rem
|
||||
|
||||
.card-info-data
|
||||
display: table
|
||||
padding: .7rem 0
|
||||
width: 100%
|
||||
table-layout: fixed
|
||||
|
||||
& > .card-info-data-item
|
||||
display: inline-block
|
||||
width: 33.3%
|
||||
display: table-cell
|
||||
|
||||
a
|
||||
.headline
|
||||
display: block
|
||||
overflow: hidden
|
||||
color: $font-black
|
||||
// text-transform: uppercase
|
||||
text-overflow: ellipsis
|
||||
white-space: nowrap
|
||||
font-size: .7rem
|
||||
|
||||
.length_num
|
||||
margin-top: -.3rem
|
||||
color: $dark-black
|
||||
font-size: 1rem
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
display: block
|
||||
background-color: $light-blue
|
||||
color: $button-color
|
||||
text-transform: uppercase
|
||||
line-height: 1.6rem
|
||||
|
||||
span
|
||||
@@ -92,7 +91,8 @@
|
||||
|
||||
.card-tag-cloud
|
||||
a
|
||||
word-break: keep-all
|
||||
display: inline-block
|
||||
padding: 0 .1rem
|
||||
|
||||
&:hover
|
||||
color: $light-blue !important
|
||||
@@ -147,20 +147,20 @@
|
||||
.aside-post_title
|
||||
height: auto
|
||||
|
||||
.card-archives ul.archive-list,
|
||||
.card-categories ul.aside-category-item
|
||||
.card-archives ul.card-archive-list,
|
||||
.card-categories ul.card-category-list
|
||||
margin: 0
|
||||
padding: .2rem 0 0
|
||||
list-style: none
|
||||
|
||||
.card-archives ul.archive-list > .archive-list-item,
|
||||
.card-categories ul.aside-category-item > .aside-category-list
|
||||
padding: .2rem 1rem
|
||||
.card-archives ul.card-archive-list > .card-archive-list-item,
|
||||
.card-categories ul.card-category-list > .card-category-list-item
|
||||
padding: .15rem 1rem
|
||||
cursor: pointer
|
||||
transition: all .3s
|
||||
transition: all .5s
|
||||
|
||||
&:hover
|
||||
padding: .2rem .85rem
|
||||
padding: .15rem .85rem
|
||||
background-color: $light-blue
|
||||
|
||||
a
|
||||
@@ -180,15 +180,21 @@
|
||||
width: 20%
|
||||
text-align: right
|
||||
|
||||
&.more
|
||||
span
|
||||
padding-right: .3rem
|
||||
width: auto !important
|
||||
transition: .5s
|
||||
|
||||
&:hover
|
||||
span
|
||||
padding-right: .6rem
|
||||
|
||||
.card-categories
|
||||
.aside-category-item
|
||||
.card-category-list
|
||||
&.child
|
||||
padding: 0 0 0 1.2rem
|
||||
|
||||
.card-archives
|
||||
.archive-list-link-more
|
||||
justify-content: center
|
||||
|
||||
.card-webinfo
|
||||
.webinfo
|
||||
padding: .2rem 1rem
|
||||
|
||||
@@ -52,6 +52,9 @@
|
||||
border-radius: 35px
|
||||
transition: all .3s
|
||||
|
||||
.img-alt
|
||||
display: none
|
||||
|
||||
.md-links-title
|
||||
overflow: hidden
|
||||
padding: 16px 10px 0 0
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
margin: 0 .5rem
|
||||
color: $light-grey
|
||||
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
|
||||
font-size: .9rem
|
||||
font-size: 1rem
|
||||
cursor: pointer
|
||||
|
||||
#scroll_down
|
||||
@@ -101,6 +101,12 @@
|
||||
-webkit-box-orient: vertical
|
||||
|
||||
#post-meta
|
||||
font-size: 95%
|
||||
|
||||
> .meta-secondline,
|
||||
> .meta-thirdline
|
||||
display: inline
|
||||
|
||||
.word-count,
|
||||
#busuanzi_value_page_pv,
|
||||
.comment-count
|
||||
@@ -113,9 +119,6 @@
|
||||
&__icon
|
||||
margin-right: .2rem
|
||||
|
||||
&-pv-cv
|
||||
display: inline-block
|
||||
|
||||
a
|
||||
color: $light-grey
|
||||
transition: all .3s ease-out
|
||||
@@ -133,16 +136,22 @@
|
||||
height: 58px
|
||||
border: none
|
||||
font-size: 18px
|
||||
opacity: 0
|
||||
transition: all .5s
|
||||
|
||||
&:not(.fixed)
|
||||
.menus
|
||||
padding-right: 0 !important
|
||||
|
||||
.toggle-menu
|
||||
display: none
|
||||
padding: .1rem 0 0 .3rem
|
||||
vertical-align: top
|
||||
|
||||
&:hover
|
||||
color: $white
|
||||
|
||||
&.is_visible
|
||||
&.is-visible-inline
|
||||
.site-page
|
||||
font-size: inherit
|
||||
|
||||
@@ -160,11 +169,6 @@
|
||||
box-shadow: 0 5px 6px -5px alpha($grey, .6)
|
||||
transition: transform .2s ease-in-out, opacity .2s ease-in-out
|
||||
|
||||
&.open-sidebar
|
||||
.menus,
|
||||
#search_button
|
||||
display: none
|
||||
|
||||
a,
|
||||
#site-name,
|
||||
.toggle-menu
|
||||
@@ -186,71 +190,76 @@
|
||||
font-weight: bold
|
||||
cursor: pointer
|
||||
|
||||
.menus_item
|
||||
position: relative
|
||||
display: inline-block
|
||||
padding: 0 0 0 .7rem
|
||||
.menus_items
|
||||
display: inline
|
||||
|
||||
&:hover
|
||||
.menus_item_child
|
||||
display: block
|
||||
|
||||
.menus-expand
|
||||
transform: rotate(180deg) !important
|
||||
|
||||
.menus-expand
|
||||
padding: 4px
|
||||
transition: all .3s
|
||||
transform: rotate(0)
|
||||
|
||||
& > a
|
||||
&:after
|
||||
position: absolute
|
||||
bottom: 0
|
||||
left: 0
|
||||
z-index: -1
|
||||
width: 0
|
||||
height: 3px
|
||||
background-color: lighten($theme-color, 30%)
|
||||
content: ''
|
||||
transition: all .3s ease-in-out
|
||||
.menus_item
|
||||
position: relative
|
||||
display: inline-block
|
||||
padding: 0 0 0 .7rem
|
||||
|
||||
&:hover
|
||||
.menus_item_child
|
||||
display: block
|
||||
|
||||
.menus-expand
|
||||
transform: rotate(180deg) !important
|
||||
|
||||
.menus-expand
|
||||
padding: 4px
|
||||
transition: all .3s
|
||||
transform: rotate(0)
|
||||
|
||||
& > a
|
||||
&:after
|
||||
width: 100%
|
||||
|
||||
.menus_item_child
|
||||
position: absolute
|
||||
right: 0
|
||||
display: none
|
||||
margin-top: 8px
|
||||
padding: 0
|
||||
width: max-content
|
||||
background-color: alpha($white, .8)
|
||||
box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
|
||||
animation: sub_menus .3s .1s ease both
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: -8px
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 20px
|
||||
content: ''
|
||||
|
||||
li
|
||||
padding: 1px 10px
|
||||
list-style: none
|
||||
text-align: center
|
||||
position: absolute
|
||||
bottom: 0
|
||||
left: 0
|
||||
z-index: -1
|
||||
width: 0
|
||||
height: 3px
|
||||
background-color: lighten($theme-color, 30%)
|
||||
content: ''
|
||||
transition: all .3s ease-in-out
|
||||
|
||||
&:hover
|
||||
background: $theme-color
|
||||
&:after
|
||||
width: 100%
|
||||
|
||||
a
|
||||
color: $font-black
|
||||
text-shadow: none
|
||||
.menus_item_child
|
||||
position: absolute
|
||||
right: 0
|
||||
display: none
|
||||
margin-top: 8px
|
||||
padding: 0
|
||||
width: max-content
|
||||
background-color: alpha($white, .8)
|
||||
box-shadow: 0 5px 20px -4px rgba($dark-black, .5)
|
||||
animation: sub_menus .3s .1s ease both
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: -8px
|
||||
left: 0
|
||||
width: 100%
|
||||
height: 20px
|
||||
content: ''
|
||||
|
||||
li
|
||||
list-style: none
|
||||
|
||||
&:hover
|
||||
background: $theme-color
|
||||
|
||||
a
|
||||
display: inline-block
|
||||
padding: .3rem .7rem
|
||||
width: 100%
|
||||
color: $font-black
|
||||
text-shadow: none
|
||||
|
||||
#search_button
|
||||
display: inline
|
||||
padding: 0 0 0 .7rem
|
||||
|
||||
.site-page
|
||||
@@ -295,11 +304,17 @@
|
||||
& > #post-meta
|
||||
font-size: 90%
|
||||
|
||||
& > span
|
||||
.post-meta__categories
|
||||
display: none
|
||||
|
||||
.post-meta-pv-cv
|
||||
.meta-thirdline
|
||||
display: block
|
||||
|
||||
.post-meta__separator:first-child
|
||||
display: none
|
||||
.post-meta-pv-cv
|
||||
.post-meta__separator:first-child
|
||||
display: none
|
||||
|
||||
if !hexo-config('busuanzi.page_pv')
|
||||
.post-meta-commentcount
|
||||
.post-meta__separator
|
||||
display: none
|
||||
94
source/css/_layout/loadding.styl
Normal file
94
source/css/_layout/loadding.styl
Normal file
@@ -0,0 +1,94 @@
|
||||
if hexo-config('preloader')
|
||||
loading-bg()
|
||||
position: fixed
|
||||
z-index: 1000
|
||||
width: 50%
|
||||
height: 100%
|
||||
background-color: $preloader-bg
|
||||
transition: all .5s
|
||||
|
||||
#loading-box
|
||||
.loading-left-bg
|
||||
loading-bg()
|
||||
|
||||
.loading-right-bg
|
||||
loading-bg()
|
||||
right: 0
|
||||
|
||||
.spinner-box
|
||||
position: fixed
|
||||
z-index: 1001
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: center
|
||||
width: 100%
|
||||
height: 100vh
|
||||
|
||||
.configure-border-1
|
||||
position: absolute
|
||||
padding: 3px
|
||||
width: 115px
|
||||
height: 115px
|
||||
background: #ffab91
|
||||
animation: configure-clockwise 3s ease-in-out 0s infinite alternate
|
||||
|
||||
.configure-border-2
|
||||
left: -115px
|
||||
padding: 3px
|
||||
width: 115px
|
||||
height: 115px
|
||||
background: rgb(63, 249, 220)
|
||||
transform: rotate(45deg)
|
||||
animation: configure-xclockwise 3s ease-in-out 0s infinite alternate
|
||||
|
||||
.loading-word
|
||||
position: absolute
|
||||
color: $white
|
||||
font-size: .8rem
|
||||
|
||||
.configure-core
|
||||
width: 100%
|
||||
height: 100%
|
||||
background-color: $preloader-bg
|
||||
|
||||
&.loaded
|
||||
.loading-left-bg
|
||||
transform: translate(-100%, 0)
|
||||
|
||||
.loading-right-bg
|
||||
transform: translate(100%, 0)
|
||||
|
||||
.spinner-box
|
||||
display: none
|
||||
|
||||
@keyframes configure-clockwise
|
||||
0%
|
||||
transform: rotate(0)
|
||||
|
||||
25%
|
||||
transform: rotate(90deg)
|
||||
|
||||
50%
|
||||
transform: rotate(180deg)
|
||||
|
||||
75%
|
||||
transform: rotate(270deg)
|
||||
|
||||
100%
|
||||
transform: rotate(360deg)
|
||||
|
||||
@keyframes configure-xclockwise
|
||||
0%
|
||||
transform: rotate(45deg)
|
||||
|
||||
25%
|
||||
transform: rotate(-45deg)
|
||||
|
||||
50%
|
||||
transform: rotate(-135deg)
|
||||
|
||||
75%
|
||||
transform: rotate(-225deg)
|
||||
|
||||
100%
|
||||
transform: rotate(-315deg)
|
||||
@@ -27,19 +27,22 @@
|
||||
text-align: center
|
||||
|
||||
img
|
||||
display: inline-block
|
||||
padding: 0
|
||||
width: 110px
|
||||
height: 110px
|
||||
border-radius: 70px
|
||||
transition: all .3s
|
||||
transition: all .5s
|
||||
|
||||
&:hover
|
||||
transform: rotate(360deg)
|
||||
|
||||
.mobile_post_data
|
||||
display: table
|
||||
padding: .6rem .5rem 0
|
||||
width: 100%
|
||||
table-layout: fixed
|
||||
|
||||
.mobile_data_item
|
||||
display: inline-block
|
||||
width: 33.3%
|
||||
display: table-cell
|
||||
|
||||
.mobile_data_link
|
||||
& > a > div
|
||||
@@ -54,15 +57,13 @@
|
||||
.headline
|
||||
display: block
|
||||
color: $font-black
|
||||
// text-transform: uppercase
|
||||
font-size: .7rem
|
||||
|
||||
hr
|
||||
margin: 1rem auto
|
||||
|
||||
.menus_items
|
||||
margin-bottom: 5rem
|
||||
padding: 0 .5rem
|
||||
padding: 0 .5rem 2rem
|
||||
|
||||
.site-page
|
||||
position: relative
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
|
||||
& > time
|
||||
color: $theme-meta-color
|
||||
cursor: pointer
|
||||
|
||||
& > .article-meta
|
||||
color: $theme-meta-color
|
||||
@@ -129,7 +130,7 @@
|
||||
display: -webkit-box
|
||||
overflow: hidden
|
||||
margin-top: .3rem
|
||||
height: 85px
|
||||
// height: 85px
|
||||
word-break: break-word
|
||||
-webkit-line-clamp: 3
|
||||
-webkit-box-orient: vertical
|
||||
@@ -269,7 +270,7 @@
|
||||
-webkit-box-orient: vertical
|
||||
|
||||
&:hover
|
||||
color: $light-blue
|
||||
color: $light-blue !important
|
||||
transform: translateX(20px)
|
||||
|
||||
&__img
|
||||
@@ -379,3 +380,9 @@
|
||||
.layout_page
|
||||
& > div:first-child:not(.recent-posts)
|
||||
width: 100% !important
|
||||
|
||||
// ie10-ios11使用
|
||||
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active)
|
||||
.recent-post-info
|
||||
.content
|
||||
height: 90px
|
||||
|
||||
@@ -1,147 +1,157 @@
|
||||
#article-container
|
||||
if hexo-config('beautify.enable')
|
||||
headStyle(fontsize)
|
||||
padding-left: unit(fontsize + .4, 'rem')
|
||||
beautify()
|
||||
headStyle(fontsize)
|
||||
padding-left: unit(fontsize + .4, 'rem')
|
||||
|
||||
code
|
||||
font-size: unit(fontsize, 'rem')
|
||||
code
|
||||
font-size: unit(fontsize, 'rem')
|
||||
|
||||
&:before
|
||||
margin-left: unit((-(fontsize + .2)), 'rem')
|
||||
font-size: unit(fontsize, 'rem')
|
||||
|
||||
&:hover
|
||||
padding-left: unit(fontsize + .6, 'rem')
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6
|
||||
cursor: pointer
|
||||
transition: all .2s ease-out
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: calc(50% - .35rem)
|
||||
color: $title-prefix-icon-color
|
||||
content: $title-prefix-icon
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
line-height: 1
|
||||
transition: all .2s ease-out
|
||||
text-rendering: auto
|
||||
-webkit-font-smoothing: antialiased
|
||||
|
||||
if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
|
||||
font-weight: 600
|
||||
font-family: 'Font Awesome 5 Free'
|
||||
else
|
||||
font-weight: normal
|
||||
font-family: FontAwesome
|
||||
|
||||
&:hover
|
||||
&:before
|
||||
margin-left: unit((-(fontsize + .2)), 'rem')
|
||||
font-size: unit(fontsize, 'rem')
|
||||
color: $light-blue
|
||||
|
||||
h1
|
||||
headStyle(1)
|
||||
|
||||
h2
|
||||
headStyle(.9)
|
||||
|
||||
h3
|
||||
headStyle(.8)
|
||||
|
||||
h4
|
||||
headStyle(.7)
|
||||
|
||||
h5
|
||||
headStyle(.6)
|
||||
|
||||
h6
|
||||
headStyle(.6)
|
||||
|
||||
ol,
|
||||
ul
|
||||
margin-top: .4rem
|
||||
padding: 0 0 0 .8rem
|
||||
list-style: none
|
||||
counter-reset: li
|
||||
|
||||
p
|
||||
margin: 0 0 .5rem
|
||||
|
||||
ol,
|
||||
ul
|
||||
padding-left: .5rem
|
||||
|
||||
li
|
||||
position: relative
|
||||
margin: .2rem 0
|
||||
padding: .1rem .5rem .1rem 1.5rem
|
||||
|
||||
&:hover
|
||||
padding-left: unit(fontsize + .6, 'rem')
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6
|
||||
cursor: pointer
|
||||
transition: all .2s ease-out
|
||||
&:before
|
||||
transform: rotate(360deg)
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: calc(50% - .35rem)
|
||||
color: $title-prefix-icon-color
|
||||
content: $title-prefix-icon
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
line-height: 1
|
||||
transition: all .2s ease-out
|
||||
text-rendering: auto
|
||||
-webkit-font-smoothing: antialiased
|
||||
top: 0
|
||||
left: 0
|
||||
background: $light-blue
|
||||
color: $card-bg
|
||||
cursor: pointer
|
||||
transition: all .3s ease-out
|
||||
|
||||
if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
|
||||
font-weight: 600
|
||||
font-family: 'Font Awesome 5 Free'
|
||||
else
|
||||
font-weight: normal
|
||||
font-family: FontAwesome
|
||||
ol
|
||||
> li
|
||||
&:before
|
||||
margin-top: .2rem
|
||||
width: w = 1.2rem
|
||||
height: h = w
|
||||
border-radius: .5 * w
|
||||
content: counter(li)
|
||||
counter-increment: li
|
||||
text-align: center
|
||||
font-size: .6rem
|
||||
line-height: h
|
||||
|
||||
ul
|
||||
> li
|
||||
&:hover
|
||||
&:before
|
||||
color: $light-blue
|
||||
border-color: $theme-button-hover-color
|
||||
|
||||
h1
|
||||
headStyle(1)
|
||||
&:before
|
||||
$w = .3rem
|
||||
top: 10px
|
||||
margin-left: .45rem
|
||||
width: w = $w
|
||||
height: h = w
|
||||
border: .5 * w solid $light-blue
|
||||
border-radius: w
|
||||
background: transparent
|
||||
content: ''
|
||||
line-height: h
|
||||
|
||||
h2
|
||||
headStyle(.9)
|
||||
no-beautify()
|
||||
ol,
|
||||
ul
|
||||
margin-top: .4rem
|
||||
|
||||
h3
|
||||
headStyle(.8)
|
||||
|
||||
h4
|
||||
headStyle(.7)
|
||||
|
||||
h5
|
||||
headStyle(.6)
|
||||
|
||||
h6
|
||||
headStyle(.6)
|
||||
p
|
||||
margin: 0 0 .5rem
|
||||
|
||||
ol,
|
||||
ul
|
||||
margin-top: .4rem
|
||||
padding: 0 0 0 .8rem
|
||||
list-style: none
|
||||
counter-reset: li
|
||||
padding-left: .5rem
|
||||
|
||||
p
|
||||
margin: 0 0 .5rem
|
||||
li
|
||||
position: relative
|
||||
margin: .3rem 0
|
||||
padding-left: .3rem
|
||||
|
||||
ol,
|
||||
ul
|
||||
padding-left: .5rem
|
||||
#article-container
|
||||
if hexo-config('beautify.enable') && hexo-config('beautify.field') == 'site'
|
||||
beautify()
|
||||
else if hexo-config('beautify.enable') && hexo-config('beautify.field') == 'post'
|
||||
no-beautify()
|
||||
|
||||
li
|
||||
position: relative
|
||||
margin: .2rem 0
|
||||
padding: .1rem .5rem .1rem 1.5rem
|
||||
|
||||
&:hover
|
||||
&:before
|
||||
transform: rotate(360deg)
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: 0
|
||||
left: 0
|
||||
background: $light-blue
|
||||
color: $card-bg
|
||||
cursor: pointer
|
||||
transition: all .3s ease-out
|
||||
|
||||
ol
|
||||
> li
|
||||
&:before
|
||||
margin-top: .2rem
|
||||
width: w = 1.2rem
|
||||
height: h = w
|
||||
border-radius: .5 * w
|
||||
content: counter(li)
|
||||
counter-increment: li
|
||||
text-align: center
|
||||
font-size: .6rem
|
||||
line-height: h
|
||||
|
||||
ul
|
||||
> li
|
||||
&:hover
|
||||
&:before
|
||||
border-color: $theme-button-hover-color
|
||||
|
||||
&:before
|
||||
$w = .3rem
|
||||
top: 10px
|
||||
margin-left: .45rem
|
||||
width: w = $w
|
||||
height: h = w
|
||||
border: .5 * w solid $light-blue
|
||||
border-radius: w
|
||||
background: transparent
|
||||
content: ''
|
||||
line-height: h
|
||||
&.post-content
|
||||
beautify()
|
||||
else
|
||||
ol,
|
||||
ul
|
||||
margin-top: .4rem
|
||||
counter-reset: li
|
||||
|
||||
p
|
||||
margin: 0 0 .5rem
|
||||
|
||||
ol,
|
||||
ul
|
||||
padding-left: .5rem
|
||||
|
||||
li
|
||||
position: relative
|
||||
margin: .3rem 0
|
||||
padding-left: .3rem
|
||||
no-beautify()
|
||||
|
||||
a
|
||||
color: $a-link-color
|
||||
@@ -163,9 +173,6 @@ a.fancybox
|
||||
width: 100%
|
||||
text-align: center
|
||||
|
||||
p
|
||||
margin: 0 0 .8rem
|
||||
|
||||
img
|
||||
max-width: 100%
|
||||
transition: all .2s
|
||||
@@ -328,6 +335,9 @@ img
|
||||
img
|
||||
margin: 0 auto .8rem
|
||||
|
||||
p
|
||||
margin: 0 0 .8rem
|
||||
|
||||
@media screen and (max-width: 1024px)
|
||||
.layout_post
|
||||
width: auto
|
||||
@@ -338,3 +348,14 @@ img
|
||||
|
||||
& > #post
|
||||
padding: 1.8rem .7rem
|
||||
|
||||
// adjust the layout width in big screen
|
||||
@media screen and (min-width: $lr)
|
||||
.layout_post
|
||||
max-width: 1300px
|
||||
|
||||
.layout_page
|
||||
max-width: 1500px
|
||||
|
||||
&.hide-aside
|
||||
max-width: 1300px
|
||||
@@ -1,28 +1,25 @@
|
||||
if hexo-config('valine.enable')
|
||||
// valine
|
||||
#vcomment
|
||||
button
|
||||
padding: .3rem 1rem
|
||||
padding: .3rem .8rem
|
||||
border-color: $button-color
|
||||
background-color: $light-blue
|
||||
color: $button-color
|
||||
font-size: .7rem
|
||||
transition: all .3s
|
||||
|
||||
&:hover
|
||||
background-color: $theme-button-hover-color
|
||||
|
||||
textarea
|
||||
if hexo-config('valine.bg')
|
||||
if hexo-config('valine.bg')
|
||||
textarea
|
||||
background: url(hexo-config('valine.bg')) 100% 100% no-repeat
|
||||
|
||||
.info
|
||||
display: none
|
||||
|
||||
.vimg
|
||||
border: 0
|
||||
transition: all .3s
|
||||
|
||||
&:hover
|
||||
transform: rotate(540deg)
|
||||
transform: rotate(360deg)
|
||||
|
||||
.vat
|
||||
padding: 0 .8rem
|
||||
@@ -30,6 +27,7 @@ if hexo-config('valine.enable')
|
||||
border-radius: 5px
|
||||
color: $light-blue
|
||||
font-size: .7125rem
|
||||
transition: all .3s
|
||||
|
||||
&:hover
|
||||
background-color: $light-blue
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if hexo-config('darkmode.enable')
|
||||
if hexo-config('darkmode.enable') || hexo-config('display_mode') == 'dark'
|
||||
[data-theme='dark']
|
||||
body
|
||||
background-color: darken(#121212, 2)
|
||||
@@ -39,25 +39,43 @@ if hexo-config('darkmode.enable')
|
||||
.article-title
|
||||
color: alpha(#FFFFFF, .8) !important
|
||||
|
||||
#page-header
|
||||
&.fixed
|
||||
background: alpha(#121212, .8)
|
||||
box-shadow: 0 5px 6px -5px rgba(133, 133, 133, 0)
|
||||
// 頭部
|
||||
#nav
|
||||
&:before
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
background-color: alpha($dark-black, .7)
|
||||
content: ''
|
||||
|
||||
.toggle-menu,
|
||||
#site-name,
|
||||
& > #page-header
|
||||
a
|
||||
color: alpha(#FFFFFF, .8)
|
||||
color: alpha(#FFFFFF, .8) !important
|
||||
|
||||
.menus_item_child
|
||||
background-color: lighten(#121212, 5) !important
|
||||
|
||||
li
|
||||
&:hover
|
||||
background: lighten(#121212, 20)
|
||||
&.fixed
|
||||
background: alpha(#121212, .8)
|
||||
box-shadow: 0 5px 6px -5px rgba(133, 133, 133, 0)
|
||||
|
||||
.toggle-menu,
|
||||
#site-name,
|
||||
a
|
||||
color: alpha(#FFFFFF, .6)
|
||||
color: alpha(#FFFFFF, .8)
|
||||
|
||||
.menus_item_child
|
||||
background-color: lighten(#121212, 5) !important
|
||||
|
||||
li
|
||||
&:hover
|
||||
background: lighten(#121212, 20) !important
|
||||
|
||||
a
|
||||
color: alpha(#FFFFFF, .8)
|
||||
|
||||
#site_subtitle
|
||||
& > span
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
// 代碼框
|
||||
#article-container pre,
|
||||
@@ -109,6 +127,9 @@ if hexo-config('darkmode.enable')
|
||||
.post-copyright-info
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
&:after
|
||||
background: #121212
|
||||
|
||||
// 音樂播放器
|
||||
.aplayer
|
||||
filter: brightness(.7)
|
||||
@@ -120,11 +141,11 @@ if hexo-config('darkmode.enable')
|
||||
& > i,
|
||||
& > a,
|
||||
& > div
|
||||
background-color: lighten(#121212, 5) !important
|
||||
color: alpha(#FFFFFF, .6) !important
|
||||
background-color: lighten(#121212, 5)
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
&:hover
|
||||
background: lighten(#121212, 20) !important
|
||||
background: lighten(#121212, 20)
|
||||
|
||||
// 打賞按鈕
|
||||
.post-reward
|
||||
@@ -138,8 +159,8 @@ if hexo-config('darkmode.enable')
|
||||
border-top: 13px solid lighten(#121212, 10) !important
|
||||
|
||||
.md-links-item:before,
|
||||
.aside-category-list:hover,
|
||||
.archive-list-item:hover,
|
||||
.card-category-list-item:hover,
|
||||
.card-archive-list-item:hover,
|
||||
#bookmark-it
|
||||
background-color: lighten(#121212, 10) !important
|
||||
|
||||
@@ -156,33 +177,21 @@ if hexo-config('darkmode.enable')
|
||||
.headline,
|
||||
.length_num,
|
||||
.aside-post_title,
|
||||
.aside-category-list_link,
|
||||
.archive-list-link,
|
||||
.social-icon
|
||||
.card-category-list-link,
|
||||
.card-archive-list-link,
|
||||
.social-icon,
|
||||
.card-category-list-link-more,
|
||||
.card-archive-list-link-more
|
||||
color: alpha(#FFFFFF, .6) !important
|
||||
|
||||
.button--animated:before
|
||||
background: lighten(#121212, 20) !important
|
||||
background: lighten(#121212, 20)
|
||||
|
||||
// 頭部
|
||||
#nav
|
||||
&:before
|
||||
position: absolute
|
||||
top: 0
|
||||
right: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
background-color: alpha($dark-black, .7)
|
||||
content: ''
|
||||
|
||||
#nav span,
|
||||
#nav i,
|
||||
#page-header a,
|
||||
#page-header .toggle-menu,
|
||||
#post-meta,
|
||||
#post-meta a,
|
||||
#footer-wrap,
|
||||
#footer-wrap a
|
||||
#footer-wrap a,
|
||||
.img-alt
|
||||
color: alpha(#FFFFFF, .6) !important
|
||||
|
||||
.posttitle,
|
||||
@@ -215,11 +224,13 @@ if hexo-config('darkmode.enable')
|
||||
color: alpha(#FFFFFF, .8) !important
|
||||
|
||||
// 時間軸界面
|
||||
.article-sort-item__title
|
||||
color: alpha(#FFFFFF, .6)
|
||||
.article-sort
|
||||
&-item__title
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
&:hover
|
||||
color: #49b1f5
|
||||
&-item:before,
|
||||
&-title:before
|
||||
background: #121212
|
||||
|
||||
// 手機 MENU,TOC
|
||||
#mobile-sidebar
|
||||
@@ -245,6 +256,10 @@ if hexo-config('darkmode.enable')
|
||||
filter: brightness(.7)
|
||||
color: #4c4948
|
||||
|
||||
// hide-tags
|
||||
.hide-button
|
||||
filter: brightness(.7)
|
||||
|
||||
// 第三方
|
||||
// 插件 hexo-blog-encrypt
|
||||
#hexo-blog-encrypt
|
||||
@@ -255,6 +270,9 @@ if hexo-config('darkmode.enable')
|
||||
input
|
||||
background-color: #121212
|
||||
|
||||
.mermaid
|
||||
filter: brightness(.7)
|
||||
|
||||
if hexo-config('gitalk') && hexo-config('gitalk.enable')
|
||||
#gitalk-container
|
||||
.gt-header-textarea,
|
||||
@@ -268,61 +286,16 @@ if hexo-config('darkmode.enable')
|
||||
fill: alpha(#FFFFFF, .6) !important
|
||||
|
||||
if hexo-config('valine') && hexo-config('valine.enable')
|
||||
// 評論
|
||||
#vcomment
|
||||
p,
|
||||
a,
|
||||
textarea,
|
||||
.vemoji-btn,
|
||||
.vpreview-btn,
|
||||
input,
|
||||
path,
|
||||
.vcount,
|
||||
.vnum,
|
||||
.vtime,
|
||||
.vsys,
|
||||
.vsys,
|
||||
.vnick
|
||||
color: alpha(#FFFFFF, .6) !important
|
||||
|
||||
.vsys
|
||||
background: rgb(97, 106, 107) !important
|
||||
|
||||
.vbtn,
|
||||
.vat
|
||||
border: 1px solid alpha(#FFFFFF, .6)
|
||||
background: lighten(#121212, 5) !important
|
||||
background: #121212 !important
|
||||
color: alpha(#FFFFFF, .6) !important
|
||||
|
||||
&:hover
|
||||
background: lighten(#121212, 20) !important
|
||||
|
||||
.vwrap
|
||||
border: 1px solid alpha(#FFFFFF, .6)
|
||||
|
||||
input
|
||||
border-bottom: 1px dashed #616a6b
|
||||
|
||||
.vh
|
||||
border-bottom: 1px dashed #616a6b
|
||||
|
||||
pre
|
||||
border: 1px solid alpha(#FFFFFF, .6)
|
||||
background-color: #121212
|
||||
|
||||
code
|
||||
background: transparent
|
||||
|
||||
code
|
||||
background-color: #2c2c2c
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
.vcontent.expand:before
|
||||
background: linear-gradient(180deg, hsla(0, 0, 0, 0), hsl(218, 8%, 19%))
|
||||
|
||||
.vcontent.expand:after
|
||||
background: hsla(204, 5%, 22%, 1)
|
||||
|
||||
if hexo-config('local_search') && hexo-config('local_search.enable')
|
||||
#local-search
|
||||
background: #121212
|
||||
@@ -366,5 +339,12 @@ if hexo-config('darkmode.enable')
|
||||
blockquote
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
.mermaid
|
||||
filter: brightness(.7)
|
||||
if hexo-config('preloader')
|
||||
#loading-box
|
||||
.loading-left-bg,
|
||||
.loading-right-bg,
|
||||
.configure-core
|
||||
background-color: darken(#121212, 2)
|
||||
|
||||
.loading-word
|
||||
color: alpha(#FFFFFF, .6)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
[data-theme='light']
|
||||
$light-redmode-bg = #fff
|
||||
|
||||
.read-mode
|
||||
background: #fff
|
||||
background: $light-redmode-bg
|
||||
|
||||
#nav.post-bg
|
||||
a
|
||||
@@ -17,12 +19,12 @@ if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
|
||||
blockquote
|
||||
border-left: .2rem solid #ddd
|
||||
background-color: transparent
|
||||
background-color: $light-redmode-bg
|
||||
|
||||
ol,
|
||||
li
|
||||
&:before
|
||||
background: transparent
|
||||
background: $light-redmode-bg
|
||||
color: #4c4948
|
||||
|
||||
ul
|
||||
@@ -32,28 +34,40 @@ if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
|
||||
hr
|
||||
border: 2px dashed #d6dbdf
|
||||
background: transparent
|
||||
background: $light-redmode-bg
|
||||
|
||||
&:before
|
||||
color: darken(#d6dbdf, 10)
|
||||
|
||||
.hide-toggle
|
||||
border: 1px solid darken(#d6dbdf, 10) !important
|
||||
|
||||
.hide-button
|
||||
background: darken(#d6dbdf, 10) !important
|
||||
background: $light-redmode-bg !important
|
||||
color: #4c4948 !important
|
||||
|
||||
.hide-inline,
|
||||
.hide-block
|
||||
& >.hide-button
|
||||
border: 1px solid darken(#d6dbdf, 10)
|
||||
|
||||
& > .button--animated:before
|
||||
background: $light-redmode-bg
|
||||
|
||||
.note
|
||||
border: 2px solid #eee
|
||||
border-left-color: transparent
|
||||
background-color: transparent
|
||||
background-color: $light-redmode-bg
|
||||
|
||||
#mobile-sidebar-menus,
|
||||
#rightside i,
|
||||
#rightside i:not(.fa-cog),
|
||||
#rightside a,
|
||||
#rightside #rightside_config
|
||||
background: darken(#d6dbdf, 10) !important
|
||||
background: darken(#d6dbdf, 20) !important
|
||||
|
||||
[data-theme='dark']
|
||||
$dark-readmode-bg = #0d0d0d
|
||||
|
||||
.read-mode
|
||||
background: #0d0d0d
|
||||
background: $dark-readmode-bg
|
||||
|
||||
#article-container
|
||||
code
|
||||
@@ -61,12 +75,12 @@ if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
|
||||
blockquote
|
||||
border-left: .2rem solid rgba(255, 255, 255, .6)
|
||||
background-color: transparent
|
||||
background-color: $dark-readmode-bg
|
||||
|
||||
ol,
|
||||
li
|
||||
&:before
|
||||
background: transparent
|
||||
background: $dark-readmode-bg
|
||||
color: rgba(255, 255, 255, .6)
|
||||
|
||||
ul
|
||||
@@ -74,15 +88,27 @@ if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
&:before
|
||||
border: .15rem solid rgba(255, 255, 255, .6)
|
||||
|
||||
.note
|
||||
border: 2px solid rgba(255, 255, 255, .6)
|
||||
border-left-color: transparent
|
||||
filter: none
|
||||
background-color: transparent
|
||||
color: rgba(255, 255, 255, .6)
|
||||
.hide-toggle
|
||||
border: 1px solid rgba(255, 255, 255, .6) !important
|
||||
|
||||
.hide-button
|
||||
background: #1f1f1f !important
|
||||
background: $dark-readmode-bg !important
|
||||
filter: none
|
||||
color: rgba(255, 255, 255, .6) !important
|
||||
|
||||
.hide-inline,
|
||||
.hide-block
|
||||
& >.hide-button
|
||||
border: 1px solid rgba(255, 255, 255, .6)
|
||||
|
||||
& > .button--animated:before
|
||||
background: $dark-readmode-bg !important
|
||||
|
||||
.note
|
||||
border: 2px solid rgba(255, 255, 255, .6)
|
||||
filter: none
|
||||
background-color: $dark-readmode-bg
|
||||
color: rgba(255, 255, 255, .6)
|
||||
|
||||
.read-mode
|
||||
#body-wrap
|
||||
@@ -114,10 +140,6 @@ if hexo-config('readmode') && hexo-config('readmode.enable')
|
||||
.highlight
|
||||
display: block !important
|
||||
|
||||
#rightside
|
||||
#darkmode
|
||||
display: none
|
||||
|
||||
& > canvas
|
||||
display: none !important
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
&:hover
|
||||
color: $search-color
|
||||
|
||||
em
|
||||
color: $search-keyword-highlight
|
||||
font-weight: bold
|
||||
|
||||
.ais-pagination.pagination
|
||||
margin: .8rem 0 0
|
||||
padding: 0
|
||||
|
||||
@@ -50,4 +50,5 @@
|
||||
height: 100%
|
||||
|
||||
.search-result-list
|
||||
max-height: 100% !important
|
||||
max-height: 75vh !important
|
||||
padding-bottom: 2rem
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
|
||||
.local-search__hit-item
|
||||
position: relative
|
||||
padding-left: 1.5rem
|
||||
padding-left: 1.3rem
|
||||
line-height: 1.7
|
||||
|
||||
&:hover
|
||||
&:before
|
||||
@@ -27,7 +28,7 @@
|
||||
&:before
|
||||
$w = .3rem
|
||||
position: absolute
|
||||
top: .4rem
|
||||
top: .3rem
|
||||
left: 0
|
||||
width: w = $w
|
||||
height: h = w
|
||||
@@ -41,12 +42,21 @@
|
||||
a
|
||||
display: block
|
||||
color: $font-black
|
||||
font-weight: 600
|
||||
font-size: 14px
|
||||
cursor: pointer
|
||||
|
||||
&:hover
|
||||
color: $search-color
|
||||
|
||||
.search-result
|
||||
margin: 0 0 .4rem
|
||||
word-break: break-all
|
||||
|
||||
.search-keyword
|
||||
color: $search-keyword-highlight
|
||||
font-weight: bold
|
||||
|
||||
.local-search-stats__hr
|
||||
display: none !important
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ figure.gallery-group
|
||||
background: $dark-black
|
||||
-webkit-transform: translate3d(0, 0, 0)
|
||||
|
||||
@media screen and (max-width: 600px)
|
||||
width: calc(100% - .4rem)
|
||||
|
||||
&:hover
|
||||
img
|
||||
opacity: .4
|
||||
@@ -100,10 +103,9 @@ figure.gallery-group
|
||||
img
|
||||
opacity: 0
|
||||
|
||||
.img-alt
|
||||
display: none
|
||||
|
||||
.fancybox
|
||||
width: auto
|
||||
text-align: inherit
|
||||
|
||||
@media screen and (max-width: 600px)
|
||||
figure.gallery-group
|
||||
width: calc(100% - .4rem)
|
||||
53
source/css/_tags/hide.styl
Normal file
53
source/css/_tags/hide.styl
Normal file
@@ -0,0 +1,53 @@
|
||||
// tag-hide
|
||||
.hide-inline,
|
||||
.hide-block
|
||||
& > a.hide-button
|
||||
position: relative
|
||||
z-index: 1
|
||||
display: inline-block
|
||||
padding: 0 1rem
|
||||
background: $tag-hide-bg
|
||||
color: $white !important
|
||||
text-align: center
|
||||
cursor: pointer
|
||||
|
||||
&:hover
|
||||
text-decoration: none !important
|
||||
|
||||
&.open
|
||||
display: none
|
||||
|
||||
& > .hide-content
|
||||
display: none
|
||||
|
||||
.hide-inline
|
||||
& > .hide-button
|
||||
margin: 0 .3rem
|
||||
|
||||
& > .hide-content
|
||||
margin: 0 .3rem
|
||||
|
||||
.hide-block
|
||||
margin: 0 0 .8rem
|
||||
|
||||
.hide-toggle
|
||||
margin-bottom: 1rem
|
||||
border: 1px solid $tag-hide-toggle-bg
|
||||
|
||||
& > .hide-button
|
||||
padding: .3rem .5rem
|
||||
background: $tag-hide-toggle-bg
|
||||
color: $font-color
|
||||
cursor: pointer
|
||||
|
||||
& > i
|
||||
font-size: 1.2em
|
||||
transition: all .3s
|
||||
|
||||
&.open
|
||||
i
|
||||
transform: rotate(90deg)
|
||||
|
||||
& > .hide-content
|
||||
display: none
|
||||
margin: 1.5rem 1.2rem
|
||||
@@ -5,6 +5,7 @@
|
||||
@import '_global'
|
||||
@import '_highlight/highlight'
|
||||
@import '_layout/*'
|
||||
@import '_tags/*'
|
||||
@import '_mode/*'
|
||||
|
||||
// search
|
||||
|
||||
@@ -39,6 +39,7 @@ $rem = 20px
|
||||
$text-line-height = 2
|
||||
$sm = 768px
|
||||
$bg = 1024px
|
||||
$lr = 2000px
|
||||
$web-bg = convert(hexo-config('background'))
|
||||
$index_top_img_height = convert(hexo-config('index_top_img_height')) || 100vh
|
||||
$index_site_info_top = convert(hexo-config('index_site_info_top')) || 43%
|
||||
@@ -78,12 +79,14 @@ $reward-pop-up-color = #858585
|
||||
// search
|
||||
$search-bg = #f6f8fa
|
||||
$search-color = $theme-color
|
||||
$search-keyword-highlight = #F47466
|
||||
//gallery
|
||||
$gallery-color = #fff
|
||||
// tag-hide
|
||||
$tag-hide-bg = $theme-color
|
||||
|
||||
|
||||
$tag-hide-toggle-bg = #f0f0f0
|
||||
//preloader
|
||||
$preloader-bg = #37474f
|
||||
|
||||
// Note colors
|
||||
// --------------------------------------------------
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user