Compare commits

..

2 Commits

133 changed files with 2788 additions and 3809 deletions

View File

@@ -1,15 +1,8 @@
<!-- <!--
IMPORTANT: Please follow the template to create a new issue. IMPORTANT: Please follow the template to create a new issue.
重要:請依照該模板來提交。 重要:請依照該模板來提交。
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
如果你是由舊版本升級到新版運行時出現報錯請首先把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 --> ## I want to create a new issue <!-- 我想要建立一個新的issue -->
<!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) --> <!-- Check all with "x" especially FAQ & Documentation!! (使用 "x" 選擇) -->

View File

@@ -1,33 +1,35 @@
# hexo-theme-butterfly # hexo-theme-butterfly
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></a> <a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.2.5-blue"/></a>
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></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://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> <a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/) Demo: https://demo.jerryc.me/
JerryC: https://jerryc.me/
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme. Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
## Installation ## Installation
Stable branch [recommend]: Stable branch:
``` ```
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
``` ```
Dev branch: Dev branch:
``` ```
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
``` ```
## Configuration ## Configuration
Set theme in the hexo work folder's root config file `_config.yml`: Set theme in the hexo work folder's root config file `_config.yml`:
> theme: butterfly > theme: Butterfly
If you don't have pug & stylus renderer, try this: If you don't have pug & stylus renderer, try this:
@@ -35,15 +37,7 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
## Documentation ## Documentation
Find in [Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/). it supports `zh-TW` and `zh-CN` Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW`
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 ## Screenshots

View File

@@ -1,49 +1,45 @@
# hexo-theme-butterfly # hexo-theme-butterfly
<a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-3.0.0-blue"/></a> <a href="https://github.com/jerryc127/hexo-theme-butterfly/releases"><img alt="Version" src="https://img.shields.io/badge/release-2.2.5-blue"/></a>
<a href="https://jerryc.me"><img alt="Author" src="https://img.shields.io/badge/author-JerryC-blur"/></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://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> <a href="https://nodejs.org/"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0+-blur"/></a>
Demo: 👍 [Butterfly](https://demo.jerryc.me/) || 🤞 [JerryC](https://jerryc.me/) Demo: https://demo.jerryc.me/
JerryC: https://jerryc.me/
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題 一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
## 安裝 ## 安裝
在你的博客根目錄裡安裝穩定版【推薦】 在你的博客根目錄裡
``` ```
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
``` ```
如果想要安裝比較新的dev分支可以 如果想要安裝比較新的dev分支可以
``` ```
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
``` ```
## 應用主題 ## 應用主題
修改hexo配置文件`_config.yml`,把主題改為`Butterfly` 修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
``` ```
theme: butterfly theme: Butterfly
``` ```
>如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus >如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save or yarn add hexo-renderer-pug hexo-renderer-stylus
## 文檔 ## 文檔
可查看[Butterfly Docs](https://demo.jerryc.me/posts/21cfbf15/) 可查看[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)
## 截圖 ## 截圖
![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png) ![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png)
![image](https://user-images.githubusercontent.com/16351105/58887457-3cc4b500-8718-11e9-9417-2bdea603c92e.png) ![image](https://user-images.githubusercontent.com/16351105/58887457-3cc4b500-8718-11e9-9417-2bdea603c92e.png)

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ post:
created: Created created: Created
updated: Updated updated: Updated
wordcount: Word count wordcount: Word count
min2read: 'Reading time: %s min' min2read: "Reading time: %s min"
page_pv: Post View page_pv: Post View
comments: Comments comments: Comments
copyright: copyright:
@@ -32,13 +32,13 @@ post:
link: Link link: Link
copyright_notice: Copyright Notice copyright_notice: Copyright Notice
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.' copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
recommend: Related Articles recommend: Recommend
search: Search search: Search
algolia_search: algolia_search:
input_placeholder: Search for Posts input_placeholder: Search for Posts
hits_empty: "We didn't find any results for the search: ${query}." hits_empty: "We didn't find any results for the search: ${query}."
hits_stats: '${hits} results found in ${time} ms' hits_stats: "${hits} results found in ${time} ms"
local_search: local_search:
label: Local search label: Local search
@@ -61,7 +61,7 @@ aside:
card_tags: Tags card_tags: Tags
card_archives: Archives card_archives: Archives
card_recent_post: Recent Post card_recent_post: Recent Post
card_bookmark: Bookmark card_bookmark: Add to bookmark
card_webinfo: card_webinfo:
headline: Info headline: Info
article_name: Article article_name: Article
@@ -69,7 +69,6 @@ aside:
site_wordcount: Total Count site_wordcount: Total Count
site_uv_name: UV site_uv_name: UV
site_pv_name: PV site_pv_name: PV
more_button: More
donate: Donate donate: Donate
share: Share share: Share
@@ -78,13 +77,13 @@ bookmark:
rightside: rightside:
readmode_title: Read Mode readmode_title: Read Mode
font_plus_title: Increase Font Size font_plus_title: Increase font size
font_minus_title: Decrease Font Size font_minus_title: Decrease font size
translate_title: Switch Between Traditional Chinese And Simplified Chinese translate_title: Traditional Chinese and Simplified Chinese Conversion
night_mode_title: Switch Between Light And Dark Mode night_mode_title: Dark Mode
back_to_top: Back To Top back_to_top: Back to top
toc: Table Of Contents toc: Table of Contents
scroll_to_comment: Scroll To Comments scroll_to_comment: Scroll to comment
setting: Setting setting: Setting
runtime_unit: days runtime_unit: days
@@ -104,8 +103,4 @@ Snackbar:
day_to_night: Dark Mode Activated Manually day_to_night: Dark Mode Activated Manually
night_to_day: Light Mode Activated Manually night_to_day: Light Mode Activated Manually
loading: Loading... error_title: Page not found
error404:
error_title: Page not found
back_button: Go back home

View File

@@ -24,7 +24,7 @@ post:
created: Created created: Created
updated: Updated updated: Updated
wordcount: Word count wordcount: Word count
min2read: 'Reading time: %s min' min2read: "Reading time: %s min"
page_pv: Post View page_pv: Post View
comments: Comments comments: Comments
copyright: copyright:
@@ -32,13 +32,13 @@ post:
link: Link link: Link
copyright_notice: Copyright Notice copyright_notice: Copyright Notice
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.' copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
recommend: Related Articles recommend: Recommend
search: Search search: Search
algolia_search: algolia_search:
input_placeholder: Search for Posts input_placeholder: Search for Posts
hits_empty: "We didn't find any results for the search: ${query}." hits_empty: "We didn't find any results for the search: ${query}."
hits_stats: '${hits} results found in ${time} ms' hits_stats: "${hits} results found in ${time} ms"
local_search: local_search:
label: Local search label: Local search
@@ -61,7 +61,7 @@ aside:
card_tags: Tags card_tags: Tags
card_archives: Archives card_archives: Archives
card_recent_post: Recent Post card_recent_post: Recent Post
card_bookmark: Bookmark card_bookmark: Add to bookmark
card_webinfo: card_webinfo:
headline: Info headline: Info
article_name: Article article_name: Article
@@ -69,7 +69,6 @@ aside:
site_wordcount: Total Count site_wordcount: Total Count
site_uv_name: UV site_uv_name: UV
site_pv_name: PV site_pv_name: PV
more_button: More
donate: Donate donate: Donate
share: Share share: Share
@@ -78,13 +77,13 @@ bookmark:
rightside: rightside:
readmode_title: Read Mode readmode_title: Read Mode
font_plus_title: Increase Font Size font_plus_title: Increase font size
font_minus_title: Decrease Font Size font_minus_title: Decrease font size
translate_title: Switch Between Traditional Chinese And Simplified Chinese translate_title: Traditional Chinese and Simplified Chinese Conversion
night_mode_title: Switch Between Light And Dark Mode night_mode_title: Dark Mode
back_to_top: Back To Top back_to_top: Back to top
toc: Table Of Contents toc: Table of Contents
scroll_to_comment: Scroll To Comments scroll_to_comment: Scroll to comment
setting: Setting setting: Setting
runtime_unit: days runtime_unit: days
@@ -104,8 +103,4 @@ Snackbar:
day_to_night: Dark Mode Activated Manually day_to_night: Dark Mode Activated Manually
night_to_day: Light Mode Activated Manually night_to_day: Light Mode Activated Manually
loading: Loading... error_title: Page not found
error404:
error_title: Page not found
back_button: Go back home

View File

@@ -24,7 +24,7 @@ post:
created: 发表于 created: 发表于
updated: 更新于 updated: 更新于
wordcount: 字数总计 wordcount: 字数总计
min2read: '阅读时长: %s 分钟' min2read: "阅读时长: %s 分钟"
page_pv: 阅读量 page_pv: 阅读量
comments: 评论数 comments: 评论数
copyright: copyright:
@@ -38,14 +38,14 @@ post:
search: 搜索 search: 搜索
algolia_search: algolia_search:
input_placeholder: 搜索文章 input_placeholder: 搜索文章
hits_empty: '找不到您查询的内容:${query}' hits_empty: "找不到您查询的内容:${query}"
hits_stats: '找到 ${hits} 条结果,用时 ${time} 毫秒' hits_stats: "找到 ${hits} 条结果,用时 ${time} 毫秒"
local_search: local_search:
label: 本地搜索 label: 本地搜索
input_placeholder: 搜索文章 input_placeholder: 搜索文章
hits_empty: '找不到您查询的内容:${query}' hits_empty: "找不到您查询的内容:${query}"
powered: '提供支持' powered: "提供支持"
by: by:
pagination: pagination:
@@ -71,7 +71,6 @@ aside:
site_wordcount: 本站总字数 site_wordcount: 本站总字数
site_uv_name: 本站访客数 site_uv_name: 本站访客数
site_pv_name: 本站总访问量 site_pv_name: 本站总访问量
more_button: 查看更多
donate: 打赏 donate: 打赏
share: 分享 share: 分享
@@ -83,7 +82,7 @@ rightside:
font_plus_title: 放大字体 font_plus_title: 放大字体
font_minus_title: 缩小字体 font_minus_title: 缩小字体
translate_title: 简繁转换 translate_title: 简繁转换
night_mode_title: 浅色和深色模式转换 night_mode_title: 夜间模式
back_to_top: 回到顶部 back_to_top: 回到顶部
toc: 目录 toc: 目录
scroll_to_comment: 直达评论 scroll_to_comment: 直达评论
@@ -107,8 +106,3 @@ Snackbar:
night_to_day: 你已切换为浅色模式 night_to_day: 你已切换为浅色模式
error_title: 页面没有找到 error_title: 页面没有找到
loading: 加载中...
error404:
error_title: 页面没有找到
back_button: 回到主页

View File

@@ -9,7 +9,7 @@ footer:
copy: copy:
success: 複製成功 success: 複製成功
error: 複製錯誤 error: 複製錯誤
noSupport: 瀏覽器不支 noSupport: 瀏覽器不支
page: page:
articles: 文章總覽 articles: 文章總覽
@@ -24,28 +24,28 @@ post:
created: 發表於 created: 發表於
updated: 更新於 updated: 更新於
wordcount: 字數總計 wordcount: 字數總計
min2read: '閱讀時長: %s 分鐘' min2read: "閱讀時長: %s 分鐘"
page_pv: 閱讀量 page_pv: 閱讀量
comments: 評論數 comments: 評論數
copyright: copyright:
author: 文章作者 author: 文章作者
link: 文章連結 link: 文章鏈接
copyright_notice: 版權聲明 copyright_notice: 版權聲明
copyright_content: '本部落格所有文章除特別聲明外,均採用 copyright_content: '本博客所有文章除特別聲明外,均採用
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>' <a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>'
recommend: 相關推薦 recommend: 相關推薦
search: search:
algolia_search: algolia_search:
input_placeholder: 文章 input_placeholder: 文章
hits_empty: '找不到您查詢的內容:${query}' hits_empty: "找不到您查詢的內容:${query}"
hits_stats: '找到 ${hits} 條結果,用時 ${time} 毫秒' hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
local_search: local_search:
label: 本地搜 label: 本地搜
input_placeholder: 文章 input_placeholder: 文章
hits_empty: '找不到您查詢的內容:${query}' hits_empty: "找不到您查詢的內容:${query}"
powered: '提供支援' powered: "提供支持"
by: by:
pagination: pagination:
@@ -67,35 +67,34 @@ aside:
card_webinfo: card_webinfo:
headline: 網站資訊 headline: 網站資訊
article_name: 文章數目 article_name: 文章數目
runtime_name: 行時間 runtime_name: 行時間
site_wordcount: 本站總字數 site_wordcount: 本站總字數
site_uv_name: 本站訪客數 site_uv_name: 本站訪客數
site_pv_name: 本站總訪問量 site_pv_name: 本站總訪問量
more_button: 檢視更多
donate: 打賞 donate: 打賞
share: 分享 share: 分享
bookmark: bookmark:
title: 新增書籤 title: 添加書籤
rightside: rightside:
readmode_title: 閱讀模式 readmode_title: 閱讀模式
font_plus_title: 放大字 font_plus_title: 放大字
font_minus_title: 縮小字 font_minus_title: 縮小字
translate_title: 簡繁轉換 translate_title: 簡繁轉換
night_mode_title: 淺色和深色模式轉換 night_mode_title: 夜間模式
back_to_top: 回到頂部 back_to_top: 回到頂部
toc: 目錄 toc: 目錄
scroll_to_comment: 直達評論 scroll_to_comment: 直達評論
setting: setting:
runtime_unit: runtime_unit:
copy_copyright: copy_copyright:
author: 作者 author: 作者
link: 連結 link: 鏈接
source: 來源 source: 來源
info: 著作權歸作者所有。商業轉載請聯作者獲得授權,非商業轉載請註明出處。 info: 著作權歸作者所有。商業轉載請聯作者獲得授權,非商業轉載請註明出處。
Snackbar: Snackbar:
bookmark: bookmark:
@@ -106,8 +105,6 @@ Snackbar:
day_to_night: 你已切換為深色模式 day_to_night: 你已切換為深色模式
night_to_day: 你已切換為淺色模式 night_to_day: 你已切換為淺色模式
loading: 載入中... error_title: 頁面沒有找到
error404:
error_title: 頁面沒有找到
back_button: 回到主頁

View File

@@ -1,30 +1,23 @@
- var top_img = theme.error_404.background || theme.default_top_img - var top_img = theme.error_404.background || theme.default_top_img
- var bg_img = `background-image: url(${url_for(top_img)})` - var bg_img = `background-image: url(${top_img})`
doctype html doctype html
html(lang=config.language data-theme=theme.display_mode) html(lang=config.language data-theme=theme.display_mode)
head head
include includes/head.pug include includes/head.pug
body body
if theme.preloader
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
if theme.fireworks && theme.fireworks.enable if theme.fireworks && theme.fireworks.enable
canvas.fireworks canvas.fireworks
if theme.background include includes/mobile-sidebar/index.pug
- var is_photo = theme.background.startsWith('url') ? 'photo':'color'
#web_bg(data-type=is_photo)
#error-wrap nav#nav.error-no-found(style=bg_img)
.error-content include includes/header/header.pug
.error-img(style=bg_img) #error_info.is-center
.error-info h1#error_title= '404'
h1.error_title= '404' #error_subtitle= theme.error_404.subtitle
.error_subtitle= theme.error_404.subtitle include includes/rightside.pug
a.button--animated(href=url_for(config.root)) include includes/search/index.pug
i.fas.fa-rocket each item in theme.CDN_USE.js
= _p('error404.back_button') script(src=url_for(item))
!=partial('includes/search/index', {}, {cache:theme.fragment_cache})
include includes/additional-js.pug include includes/additional-js.pug

View File

@@ -2,9 +2,9 @@ extends includes/layout.pug
block content block content
if theme.category_ui == 'index' if theme.category_ui == 'index'
include ./includes/mixins/post-ui.pug include ./includes/mixins/UI.pug
#recent-posts.recent-posts.category_ui #recent-posts.recent-posts.category_ui
+postUI +UI_NEW(page.posts)
include includes/pagination.pug include includes/pagination.pug
else else
include ./includes/mixins/article-sort.pug include ./includes/mixins/article-sort.pug

View File

@@ -1,21 +1,18 @@
#page #page
.flink#article-container .flink#article-container
if site.data.link
each i in site.data.link each i in site.data.link
if i.class_name h2= i.class_name
h2!= i.class_name .post-cards
if i.class_desc .md-links
.flink-desc!=i.class_desc
.flink-list
each item in i.link_list each item in i.link_list
.flink-list-item .md-links-item
a(href=url_for(item.link) title=item.name target="_blank") a(href=item.link title=item.name target="_blank")
if theme.lazyload.enable if theme.lazyload.enable
img(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
else else
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name )
.flink-item-name= item.name .md-links-title= item.name
.flink-item-desc= item.descr .md-links-des= item.descr
!= page.content != page.content
if page.comments !== false if page.comments !== false
include includes/comments/index.pug include includes/comments/index.pug

View File

@@ -1,14 +1,10 @@
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 if theme.translate && theme.translate.enable
script(src=url_for(theme.CDN.translate)) script(src=url_for(theme.CDN.translate))
if theme.medium_zoom if (theme.medium_zoom && theme.medium_zoom.enable)
script(src=url_for(theme.CDN.medium_zoom)) script(src=url_for(theme.CDN.medium_zoom))
if theme.fancybox if (theme.fancybox && theme.fancybox.enable)
script(src=url_for(theme.CDN.fancybox)) script(src=url_for(theme.CDN.fancybox))
include ./math/index.pug include ./math/index.pug
@@ -39,14 +35,14 @@ if theme.activate_power_mode.enable
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
script(async src=url_for(theme.CDN.busuanzi)) script(async src=url_for(theme.CDN.busuanzi))
if theme.instantpage if theme.instantpage.enable
script(src=url_for(theme.CDN.instantpage) type="module" defer) script(src=url_for(theme.CDN.instantpage) type="module")
if theme.lazyload.enable if theme.lazyload.enable
script(src=url_for(theme.CDN.lazyload) async) script(src=url_for(theme.CDN.lazyload) async="")
//- 鼠標特效 //- 鼠標特效
if theme.click_heart if theme.click_heart && theme.click_heart.enable
script(src=url_for(theme.CDN.click_heart)) script(src=url_for(theme.CDN.click_heart))
if theme.ClickShowText && theme.ClickShowText.enable if theme.ClickShowText && theme.ClickShowText.enable
@@ -67,10 +63,3 @@ if theme.mermaid.enable
if is_home() if is_home()
include ./head/subtitle.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})
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})

View File

@@ -1,30 +0,0 @@
//- https://chatra.io/help/api/
script.
(function(d, w, c) {
w.ChatraID = '#{theme.chatra.id}';
var s = d.createElement('script');
w[c] = w[c] || function() {
(w[c].q = w[c].q || []).push(arguments);
};
s.async = true;
s.src = 'https://call.chatra.io/chatra.js';
if (d.head) d.head.appendChild(s);
})(document, window, 'Chatra');
if (!{theme.chat_btn}) {
var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){
Chatra('openChat')
});
} else {
if (!{theme.chat_hide_show}) {
function chatBtnHide () {
Chatra('hide')
}
function chatBtnShow () {
Chatra('show')
}
}
}

View File

@@ -1,37 +0,0 @@
//- https://guide.daocloud.io/daovoice/javascript-api-5869833.html
script.
(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/!{theme.daovoice.app_id}.js","daovoice")
script.
var isChatBtn = !{theme.chat_btn}
daovoice('init', {
app_id: '!{theme.daovoice.app_id}',},{
launcher: {
disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
},
});
daovoice('update');
if (isChatBtn) {
var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){
daovoice('show')
});
} else {
if (!{theme.chat_hide_show}) {
function chatBtnHide () {
daovoice('update', {},{
launcher: {
disableLauncherIcon: true // 悬浮 ICON 是否显示
},
});
}
function chatBtnShow () {
daovoice('update', {},{
launcher: {
disableLauncherIcon: false // 悬浮 ICON 是否显示
},
});
}
}
}

View File

@@ -1,28 +0,0 @@
//- https://sidecar.gitter.im/
script.
var isChatBtn = !{theme.chat_btn}
if (isChatBtn) {
((window.gitter = {}).chat = {}).options = {
room: '#{theme.gitter.room}',
activationElement: '#chat_btn'
};
} else {
((window.gitter = {}).chat = {}).options = {
room: '#{theme.gitter.room}',
};
if (!{theme.chat_hide_show}) {
var gitterBtn = document.getElementsByClassName('gitter-open-chat-button')
function chatBtnHide () {
gitterBtn[0].style.display= 'none'
}
function chatBtnShow () {
gitterBtn[0].style.display= 'block'
}
}
}
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)

View File

@@ -1,8 +0,0 @@
if theme.chatra && theme.chatra.enable
include ./chatra.pug
else if theme.tidio && theme.tidio.enable
include ./tidio.pug
else if theme.daovoice && theme.daovoice.enable
include ./daovoice.pug
else if theme.gitter && theme.gitter.enable
include ./gitter.pug

View File

@@ -1,39 +0,0 @@
script(src=`//code.tidio.co/${theme.tidio.public_key}.js` async)
if theme.chat_btn
script.
(function() {
function onTidioChatApiReady() {
window.tidioChatApi.hide();
window.tidioChatApi.on("close", function() {
window.tidioChatApi.hide();
});
}
if (window.tidioChatApi) {
window.tidioChatApi.on("ready", onTidioChatApiReady);
} else {
document.addEventListener("tidioChat-ready", onTidioChatApiReady);
}
document.getElementById("chat_btn").addEventListener("click", function(){
window.tidioChatApi.show();
window.tidioChatApi.open();
});
})();
else if theme.chat_hide_show
script.
function chatBtnHide () {
if (window.tidioChatApi) {
window.tidioChatApi.hide();
//- document.getElementById('tidio-chat').style.display= 'none'
}
}
function chatBtnShow () {
if (window.tidioChatApi) {
window.tidioChatApi.show();
//- document.getElementById('tidio-chat').style.display= 'block'
}
}

View File

@@ -3,13 +3,12 @@ script(src=url_for(theme.CDN.disqusjs))
script. script.
var dsqjs = new DisqusJS({ var dsqjs = new DisqusJS({
shortname: '!{theme.disqusjs.shortname}', shortname: '!{theme.disqusjs.shortname}',
siteName: '!{theme.disqusjs.siteName}', siteName: "!{theme.disqusjs.siteName}",
identifier: '!{ page.path }', identifier: '!{ page.path }',
url: '!{ page.permalink }', url: '!{ page.permalink }',
title: '!{ page.title }', title: '!{ page.title }',
api: '!{theme.disqusjs.api}', api: '!{theme.disqusjs.api}',
apikey: '!{theme.disqusjs.apikey}', apikey: '!{theme.disqusjs.apikey}',
nocomment: '!{theme.disqusjs.nocomment}',
admin: '!{theme.disqusjs.admin}', admin: '!{theme.disqusjs.admin}',
adminLabel: '!{theme.disqusjs.adminLabel}' adminLabel: '!{theme.disqusjs.adminLabel}'
}); });

View File

@@ -1,12 +0,0 @@
#fb-root
script(async defer crossorigin="anonymous" src=`https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v6.0`)
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
data-href=urlNoIndex()
data-numposts= theme.facebook_comments.pageSize || 10
data-order-by= theme.facebook_comments.order_by || 'social'
data-width="100%")
if theme.darkmode.enable
script.
var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'
document.getElementsByClassName('fb-comments')[0].setAttribute('data-colorscheme',themeNow)

View File

@@ -1,29 +1,26 @@
- var d = theme.disqus && theme.disqus.enable - var d = theme.disqus && theme.disqus.enable
- var dj = theme.disqusjs && theme.disqusjs.enable - var dj = theme.disqusjs && theme.disqusjs.enable
- var l = theme.livere && theme.livere.enable - var l = theme.laibili && theme.laibili.enable
- var gt = theme.gitalk && theme.gitalk.enable - var gt = theme.gitalk && theme.gitalk.enable
- var v = theme.valine && theme.valine.enable - var v = theme.valine && theme.valine.enable
- var u = theme.utterances && theme.utterances.enable - var u = theme.utterances && theme.utterances.enable
- var fb = theme.facebook_comments && theme.facebook_comments.enable - var isComment = d || dj || l || gt || v || u
- var isComment = d || dj || l || gt || v || u || fb
if isComment if isComment
hr hr
#post-comment #post-comment
.comment_headling .comment_headling
i.fas.fa-comments.fa-fw i.fa.fa-comments.fa-fw(aria-hidden="true")
span= ' ' + _p('comment') span= ' ' + _p('comment')
if d if d
include ./disqus.pug include ./disqus.pug
else if dj else if dj
include ./disqusjs.pug include ./disqusjs.pug
else if l else if l
include ./livere.pug include ./laibili.pug
else if gt else if gt
include ./gitalk.pug include ./gitalk.pug
else if v else if v
include ./valine.pug include ./valine.pug
else if u else if u
include ./utterances.pug include ./utterances.pug
else if fb
include ./facebook_comments.pug

View File

@@ -1,4 +1,4 @@
#lv-container(data-id="city" data-uid=theme.livere.uid) #lv-container(data-id="city" data-uid=theme.laibili.uid)
script. script.
(function(d, s) { (function(d, s) {
var j, e = d.getElementsByTagName(s)[0]; var j, e = d.getElementsByTagName(s)[0];

View File

@@ -1,35 +1,23 @@
- let emojiMaps = '""'
if site.data.valine
- emojiMaps = JSON.stringify(site.data.valine)
#vcomment.vcomment #vcomment.vcomment
script(src=url_for(theme.CDN.valine)) script(src=url_for(theme.CDN.valine))
script. script.
var requestSetting = function (from,set) { var GUEST_INFO = ['nick','mail','link'];
var from = from var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){
var setting = set.split(',').filter(function(item){ return GUEST_INFO.indexOf(item) > -1
return from.indexOf(item) > -1
}); });
setting = setting.length == 0 ? from :setting; guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
return setting
}
var guestInfo = requestSetting(['nick','mail','link'],'#{ theme.valine.guest_info }')
var requiredFields = requestSetting(['nick','mail'],'#{ theme.valine.requiredFields }')
window.valine = new Valine({ window.valine = new Valine({
el:'#vcomment', el:'#vcomment',
notify: #{theme.valine.notify},
verify: #{theme.valine.verify},
appId: '#{theme.valine.appId}', appId: '#{theme.valine.appId}',
appKey: '#{theme.valine.appKey}', appKey: '#{theme.valine.appKey}',
placeholder: '#{theme.valine.placeholder}', placeholder: '#{theme.valine.placeholder}',
avatar: '#{theme.valine.avatar}', avatar: '#{theme.valine.avatar}',
meta: guestInfo, meta: guest_info,
pageSize: '#{theme.valine.pageSize}', pageSize: '#{theme.valine.pageSize}',
lang: '#{theme.valine.lang}', lang: '#{theme.valine.lang}',
recordIP: #{theme.valine.recordIP}, recordIP: #{theme.valine.recordIP},
serverURLs: '#{theme.valine.serverURLs}', serverURLs: '#{theme.valine.serverURLs}'
emojiCDN: '#{theme.valine.emojiCDN}',
emojiMaps: !{emojiMaps},
enableQQ: #{theme.valine.enableQQ},
requiredFields: requiredFields
}); });

View File

@@ -5,7 +5,7 @@
.copyright!= `&copy;${theme.since} - ${nowYear} By ${config.author}` .copyright!= `&copy;${theme.since} - ${nowYear} By ${config.author}`
else else
.copyright!= `&copy;${nowYear} By ${config.author}` .copyright!= `&copy;${nowYear} By ${config.author}`
if theme.footer_copyright if theme.footer_copyright.enable
.framework-info .framework-info
span= _p('footer.driven') + ' ' span= _p('footer.driven') + ' '
a(href='https://hexo.io') a(href='https://hexo.io')

View File

@@ -4,43 +4,45 @@
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category - else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year - else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
- else if (is_year()) pageTitle += ': ' + page.year - else if (is_year()) pageTitle += ': ' + page.year
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404.error_title') - else if (is_current('/404.html', [strict])) pageTitle = _p('error_title')
- else pageTitle = page.title || config.title || '' - else pageTitle = page.title || config.title || ''
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : '' - var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title - var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
- var pageDescription = page_description() - var pageDescription = page.description || page.title || config.description
- var pageKeywords - var pageKeywords
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords - if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
- 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 - else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author - var pageAuthor = config.email ? config.author + ',' + config.email : config.author
- var pageCopyright = config.copyright || config.author - var pageCopyright = config.copyright || config.author
- var without_html = url.replace('index.html', '')
meta(charset='UTF-8') meta(charset='UTF-8')
meta(http-equiv="X-UA-Compatible" content="IE=edge") meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width,initial-scale=1") meta(name="viewport" content="width=device-width,initial-scale=1")
title= tabTitle title= tabTitle
meta(name="description" content!=pageDescription) meta(name="description" content=pageDescription)
if pageKeywords if pageKeywords
meta(name="keywords" content=pageKeywords) meta(name="keywords" content=pageKeywords)
meta(name="author" content=pageAuthor) meta(name="author" content=pageAuthor)
meta(name="copyright" content=pageCopyright) meta(name="copyright" content=pageCopyright)
meta(name ="format-detection" content="telephone=no") meta(name ="format-detection" content="telephone=no")
!=favicon_tag(theme.favicon || config.favicon) !=favicon_tag(theme.favicon || config.favicon)
link(rel="canonical" href=urlNoIndex())
if theme.disable_baidu_transformation if theme.disable_baidu_transformation
meta(http-equiv="Cache-Control" content="no-transform") meta(http-equiv="Cache-Control" content="no-transform")
meta(http-equiv="Cache-Control" content="no-siteapp") meta(http-equiv="Cache-Control" content="no-siteapp")
if page.hide == true
meta(name="robots" content="noindex")
if theme.douban if theme.douban
if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict])) if theme.douban.meta && (is_current('/movies/', [strict]) || is_current('/books/', [strict]) || is_current('/games/', [strict]))
meta(name="referrer" content="no-referrer") meta(name="referrer" content="no-referrer")
//- 預解析 //- 預解析
!=partial('includes/head/preconnect', {}, {cache:theme.fragment_cache}) !=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
//- 網站驗證 //- 網站驗證
!=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache}) !=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache})
@@ -52,19 +54,28 @@ include ./head/Open_Graph.pug
if (theme.pwa && theme.pwa.enable) if (theme.pwa && theme.pwa.enable)
!=partial('includes/head/pwa', {}, {cache:theme.fragment_cache}) !=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
script(src=url_for(theme.CDN.js_cookies))
if theme.darkmode.enable if theme.darkmode.enable
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache}) !=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
//- main css each item in theme.CDN_USE.css
link(rel='stylesheet', href=url_for(theme.CDN.main_css)) link(rel='stylesheet', href=url_for(item))
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome))
if theme.fancybox if theme.fontawesome_v5 && theme.fontawesome_v5.enable
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
else
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
if (theme.fancybox && theme.fancybox.enable)
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css)) link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
if (theme.snackbar && theme.snackbar.enable) if (theme.snackbar && theme.snackbar.enable)
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css)) link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
if theme.canonical
link(rel="canonical" href=without_html)
if is_post() if is_post()
if(page.prev) if(page.prev)
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) ) link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
@@ -84,17 +95,11 @@ include ./head/comment.pug
//- analytics //- analytics
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache}) !=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
//- font
if theme.blog_title_font.font_link if theme.blog_title_font.font_link
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link)) link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
//- global config //- global config
!=partial('includes/head/config', {}, {cache:theme.fragment_cache}) !=partial('includes/head/config', {}, {cache:theme.fragment_cache})
include ./head/config_site.pug include ./head/config_site.pug
include ./head/noscript.pug include ./head/noscript.pug
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
if page.aplayer
include ./head/aplayer.pug

View File

@@ -1,12 +1,17 @@
- var contentType = is_post() ? 'article' : 'website' - var contentType = is_post() ? 'article' : 'website'
//- twitter meta
if theme.twitter_meta
meta(name="twitter:card" content="summary")
meta(name="twitter:title" content=pageTitle)
meta(name="twitter:description" content=pageDescription)
meta(name="twitter:image" content=full_url_for(page.cover || theme.avatar.img))
//- Open_Graph
if theme.Open_Graph_meta if theme.Open_Graph_meta
meta(property="og:type" content=contentType) meta(property="og:type" content=contentType)
meta(property="og:title" content=pageTitle) meta(property="og:title" content=pageTitle)
meta(property="og:url" content=urlNoIndex()) meta(property="og:url" content=without_html)
meta(property="og:site_name" content=config.title) 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="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))
meta(name="twitter:card" content="summary")

View File

@@ -1,3 +0,0 @@
link(rel='stylesheet' href=url_for(theme.CDN.aplayer_css))
script(src=url_for(theme.CDN.aplayer_js))
script(src=url_for(theme.CDN.meting_js))

View File

@@ -1,9 +1,3 @@
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()) 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)) link(rel="stylesheet" type="text/css" href=url_for(theme.CDN.disqusjs_css))

View File

@@ -31,6 +31,7 @@
translate = JSON.stringify({ translate = JSON.stringify({
defaultEncoding: theme.translate.defaultEncoding, defaultEncoding: theme.translate.defaultEncoding,
translateDelay: theme.translate.translateDelay, translateDelay: theme.translate.translateDelay,
cookieDomain: theme.translate.cookieDomain,
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese, msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
}) })
@@ -93,18 +94,15 @@ script.
runtime: !{theme.runtimeshow.enable}, runtime: !{theme.runtimeshow.enable},
copyright: !{copyright}, copyright: !{copyright},
ClickShowText: !{ClickShowText}, ClickShowText: !{ClickShowText},
medium_zoom: !{theme.medium_zoom}, medium_zoom: !{theme.medium_zoom.enable},
fancybox: !{theme.fancybox}, fancybox: !{theme.fancybox.enable},
Snackbar: !{Snackbar}, Snackbar: !{Snackbar},
justifiedGallery: { baiduPush: !{theme.baidu_push && theme.baidu_push.enable},
js: '!{theme.CDN.justifiedGallery_js}',
css: '!{theme.CDN.justifiedGallery_css}'
},
baiduPush: !{theme.baidu_push},
highlightCopy: !{theme.highlight_copy}, highlightCopy: !{theme.highlight_copy},
highlightLang: !{theme.highlight_lang}, highlightLang: !{theme.highlight_lang},
isPhotoFigcaption: !{theme.photofigcaption}, highlightShrink: '!{theme.highlight_shrink}',
islazyload: !{theme.lazyload.enable}, isFontAwesomeV5: !{theme.fontawesome_v5 && theme.fontawesome_v5.enable},
isanchor: !{theme.anchor} isPhotoFigcaption: !{theme.photofigcaption}
} }

View File

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

View File

@@ -1,56 +1,47 @@
script. script.
var activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#000')
}
}
var activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#fff')
}
}
var getCookies = function (name) {
const value = `; ${document.cookie}`
const parts = value.split(`; ${name}=`)
if (parts.length === 2) return parts.pop().split(';').shift()
}
var autoChangeMode = '#{theme.darkmode.autoChangeMode}' var autoChangeMode = '#{theme.darkmode.autoChangeMode}'
var t = getCookies('theme') var t = Cookies.get("theme")
if (autoChangeMode === '1') { if (autoChangeMode == '1'){
var isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches var isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
var isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches var isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
var isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches var isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
var hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified var hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
if (t === undefined) { if (t === undefined){
if (isLightMode) activateLightMode() if (isLightMode) activateLightMode()
else if (isDarkMode) activateDarkMode() else if (isDarkMode) activateDarkMode()
else if (isNotSpecified || hasNoSupport) { else if (isNotSpecified || hasNoSupport){
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.') console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
var now = new Date() var now = new Date()
var hour = now.getHours() var hour = now.getHours()
var isNight = hour <= 6 || hour >= 18 var isNight = hour < 6 || hour >= 18
isNight ? activateDarkMode() : activateLightMode() isNight ? activateDarkMode() : activateLightMode()
} }
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) { } else if (t == 'light') activateLightMode()
if (Cookies.get('theme') === undefined) {
e.matches ? activateDarkMode() : activateLightMode()
}
})
} else if (t === 'light') activateLightMode()
else activateDarkMode() else activateDarkMode()
} else if (autoChangeMode === '2') {
now = new Date() } else if (autoChangeMode == '2'){
hour = now.getHours() now = new Date();
isNight = hour <= 6 || hour >= 18 hour = now.getHours();
if (t === undefined) isNight ? activateDarkMode() : activateLightMode() isNight = hour < 6 || hour >= 18
if(t === undefined) isNight? activateDarkMode() : activateLightMode()
else if (t === 'light') activateLightMode() else if (t === 'light') activateLightMode()
else activateDarkMode() else activateDarkMode()
} else { } else {
if (t === 'dark') activateDarkMode() if ( t == 'dark' ) activateDarkMode()
else if (t === 'light') activateLightMode() else if ( t == 'light') activateLightMode()
} }
function activateDarkMode(){
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null){
document.querySelector('meta[name="theme-color"]').setAttribute('content','#000')
}
}
function activateLightMode(){
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null){
document.querySelector('meta[name="theme-color"]').setAttribute('content','#fff')
}
}

View File

@@ -0,0 +1,16 @@
link(rel="preconnect" href="//cdn.jsdelivr.net")
if theme.google_analytics
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
if theme.baidu_analytics
link(rel="preconnect" href="https://hm.baidu.com")
if theme.tencent_analytics
link(rel="preconnect" href="http://ta.qq.com")
if theme.blog_title_font.font_link
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
link(rel="preconnect" href="//busuanzi.ibruce.info")

View File

@@ -1,6 +1,6 @@
noscript. noscript.
<style> <style>
#nav { #page-header {
opacity: 1 opacity: 1
} }
.justified-gallery img{ .justified-gallery img{

View File

@@ -1,19 +0,0 @@
link(rel="preconnect" href="//cdn.jsdelivr.net")
if theme.google_analytics
link(rel="preconnect" href="//www.google-analytics.com" crossorigin)
if theme.baidu_analytics
link(rel="preconnect" href="//hm.baidu.com")
if theme.tencent_analytics
link(rel="preconnect" href="//ta.qq.com")
if theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1
link(rel="preconnect" href="//fonts.googleapis.com" crossorigin)
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
link(rel="preconnect" href="//busuanzi.ibruce.info")
if theme.baidu_push
link(rel="preconnect" href="//zz.bdstatic.com")

View File

@@ -7,124 +7,110 @@ if theme.subtitle.enable
if source == '1' if source == '1'
script. script.
var subtitleType = function () { var subtitleEffect = !{subtitleEffect}
var subtitleEffect = !{ subtitleEffect } fetch('https://api.ooopn.com/ciba/api.php',)
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',) .then(function (res){
.then(function (res) { return res.json();
return res.json()
}) })
.then(function (data) { .then(function (data) {
if (subtitleEffect) { if (subtitleEffect){
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',') var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(data.text) var both = sub.unshift(data['ciba-en'],data.ciba)
var typed = new Typed('#subtitle', { var typed = new Typed("#subtitle", {
strings: sub, strings: sub,
startDelay: 300, startDelay: 300,
typeSpeed: 150, typeSpeed: 150,
loop: !{theme.subtitle.loop}, loop: !{theme.subtitle.loop},
backSpeed: 50, backSpeed: 50
}) });
} else { }else{
document.getElementById('subtitle').innerHTML = data.text document.getElementById("subtitle").innerHTML = data['ciba-en']
} }
}) })
.catch(function (err) { .catch(function (err) {
console.error(err) console.error(err);
}) })
}
window.addEventListener('load', subtitleType)
else if source == '2' else if source == '2'
script. script.
var subtitleType = function () { var subtitleEffect = !{subtitleEffect}
var subtitleEffect = !{ subtitleEffect }
fetch('https://v1.hitokoto.cn') fetch('https://v1.hitokoto.cn')
.then(function (res) { .then(function (res){
return res.json() return res.json();
}) })
.then(function (data) { .then(function (data) {
if (subtitleEffect) { if (subtitleEffect){
var from = '出自 ' + data.from var from = '出自 ' + data.from
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',') var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(",");
var both = sub.unshift(data.hitokoto, from) var both = sub.unshift(data.hitokoto,from)
var typed = new Typed('#subtitle', { var typed = new Typed("#subtitle", {
strings: sub, strings: sub,
startDelay: 300, startDelay: 300,
typeSpeed: 150, typeSpeed: 150,
loop: !{theme.subtitle.loop}, loop: !{theme.subtitle.loop},
backSpeed: 50, backSpeed: 50
}) });
} else { }else{
document.getElementById('subtitle').innerHTML = data.hitokoto document.getElementById("subtitle").innerHTML = data.hitokoto
} }
}) })
.catch(function (err) { .catch(function (err) {
console.error(err) console.error(err);
}) })
}
window.addEventListener('load', subtitleType)
else if source == '3' else if source == "3"
script. script(type="text/javascript" src="http://yijuzhan.com/api/word.php?m=js")
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. script.
var subtitleEffect = !{subtitleEffect} var subtitleEffect = !{subtitleEffect}
if (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", { var typed = new Typed("#subtitle", {
strings: "!{theme.subtitle.sub}".split(","), 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.
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
}
})
else
- var subtitle = theme.subtitle.sub[0]
script.
var subtitleEffect = !{subtitleEffect}
if (subtitleEffect){
var typed = new Typed("#subtitle", {
strings: '!{theme.subtitle.sub}'.split(","),
startDelay: 300, startDelay: 300,
typeSpeed: 150, typeSpeed: 150,
loop: !{theme.subtitle.loop}, loop: !{theme.subtitle.loop},
backSpeed: 50 backSpeed: 50
}) })
} else { }else{
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}' document.getElementById("subtitle").innerHTML = '!{subtitle}'
} }

View File

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

View File

@@ -19,13 +19,13 @@ if theme.douban
else if is_current('/games/', [strict]) else if is_current('/games/', [strict])
- var top_img = theme.douban.games_img || theme.default_top_img - var top_img = theme.douban.games_img || theme.default_top_img
- var bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : '' - var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : ''
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title - var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg' - var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
- is_post() ? isHomeClass = 'post-bg' : isHomeClass - is_post() ? isHomeClass = 'post-bg' : isHomeClass
header#page-header(class=isHomeClass style=bg_img) #nav(class=isHomeClass style=bg_img)
!=partial('includes/header/nav', {}, {cache:theme.fragment_cache}) !=partial('includes/header/header', {}, {cache:theme.fragment_cache})
if is_home() if is_home()
#site-info #site-info
h1#site_title=site_title h1#site_title=site_title
@@ -33,9 +33,9 @@ header#page-header(class=isHomeClass style=bg_img)
span#subtitle span#subtitle
if(theme.social) if(theme.social)
#site_social_icons #site_social_icons
!=fragment_cache('social', function(){return partial('includes/header/social')}) !=partial('includes/header/social', {}, {cache:theme.fragment_cache})
#scroll_down #scroll_down
i.fas.fa-angle-down.scroll-down-effects i.fa.fa-angle-down.scroll-down-effects
else if is_post() else if is_post()
include ./post-info.pug include ./post-info.pug
else else

View File

@@ -1,22 +1,18 @@
.menus_items each value, label in theme.menu
each value, label in theme.menu
if !Array.isArray(value) if !Array.isArray(value)
.menus_item .menus_item
a.site-page(href=url_for(trim(value.split('||')[0]))) a.site-page(href=url_for(trim(value.split('||')[0])))
if value.split('||')[1]
i.fa-fw(class=trim(value.split('||')[1])) i.fa-fw(class=trim(value.split('||')[1]))
span=' '+label span=' '+label
else else
.menus_item .menus_item
a.site-page a.site-page
if label.split('||')[1] i.fa-fw(class=trim(label.split('||')[1]) aria-hidden="true")
i.fa-fw(class=trim(label.split('||')[1]) )
span=' '+ trim(label.split('||')[0]) span=' '+ trim(label.split('||')[0])
i.fas.fa-chevron-down.menus-expand i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
ul.menus_item_child ul.menus_item_child
each i in value each i in value
li li
a.site-page(href=url_for(trim(i.split('||')[1]))) a.site-page(href=url_for(trim(i.split('||')[1])))
if i.split('||')[2]
i.fa-fw(class=trim(i.split('||')[2])) i.fa-fw(class=trim(i.split('||')[2]))
span=' '+trim(i.split('||')[0]) span=' '+trim(i.split('||')[0])

View File

@@ -8,19 +8,19 @@
if (theme.post_meta.post.date_type === 'both') if (theme.post_meta.post.date_type === 'both')
time.post-meta__date time.post-meta__date
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date)) span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date))
i.far.fa-calendar-alt.fa-fw i.fa.fa-calendar(aria-hidden="true")
=' '+_p('post.created')+' '+date(page.date, config.date_format) =' '+_p('post.created')+' '+date(page.date, config.date_format)
span.post-meta__separator | span.post-meta__separator |
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated)) span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated))
i.fas.fa-history.fa-fw i.fa.fa-history(aria-hidden="true")
=' '+_p('post.updated')+' '+date(page.updated, config.date_format) =' '+_p('post.updated')+' '+date(page.updated, config.date_format)
else else
- var data_type_update = theme.post_meta.post.date_type === 'updated' - var data_type_update = theme.post_meta.post.date_type === 'updated'
- var date_type = data_type_update ? 'updated' : 'date' - var date_type = data_type_update ? 'updated' : 'date'
- var date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt' - var date_icon = data_type_update ? 'fa-history' :'fa-calendar'
- var data_info = data_type_update ? _p('post.updated') : _p('post.created') - var data_info = data_type_update ? _p('post.updated') : _p('post.created')
time.post-meta__date(title=data_info + ' ' + full_date(page[date_type])) time.post-meta__date(title=data_info + ' ' + full_date(page[date_type]))
i.fa-fw(class=date_icon) i.fa(class=date_icon aria-hidden="true")
=' ' + data_info + ' ' + date(page[date_type], config.date_format) =' ' + data_info + ' ' + date(page[date_type], config.date_format)
if (theme.post_meta.post.categories && page.categories.data.length > 0) if (theme.post_meta.post.categories && page.categories.data.length > 0)
@@ -29,23 +29,25 @@
span.post-meta__separator | span.post-meta__separator |
each item, index in page.categories.data each item, index in page.categories.data
i.fas.fa-inbox.fa-fw.post-meta__icon i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
a(href=url_for(item.path)).post-meta__categories #[=item.name] a(href=url_for(item.path)).post-meta__categories #[=item.name]
if (index < page.categories.data.length - 1) if (index < page.categories.data.length - 1)
i.fas.fa-angle-right.post-meta__separator i.fa.fa-angle-right.post-meta__separator(aria-hidden="true")
.meta-secondline .meta-secondline
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read) - let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
if (postWordcount) if (postWordcount)
span.post-meta-wordcount span.post-meta-wordcount
if theme.wordcount.post_wordcount if theme.wordcount.post_wordcount
i.far.fa-file-word.fa-fw.post-meta__icon - 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= _p('post.wordcount') + ':'
span.word-count= wordcount(page.content) span.word-count= wordcount(page.content)
if theme.wordcount.min2read if theme.wordcount.min2read
span.post-meta__separator | span.post-meta__separator |
if theme.wordcount.min2read if theme.wordcount.min2read
i.far.fa-clock.fa-fw.post-meta__icon - 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})) span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
.meta-thirdline .meta-thirdline
@@ -53,36 +55,30 @@
if (postWordcount && theme.busuanzi.page_pv) if (postWordcount && theme.busuanzi.page_pv)
span.post-meta__separator | span.post-meta__separator |
if theme.busuanzi.page_pv if theme.busuanzi.page_pv
i.far.fa-eye.fa-fw.post-meta__icon i.fa.fa-eye.post-meta__icon(aria-hidden="true")
span=_p('post.page_pv') + ':' span=_p('post.page_pv') + ':'
span#busuanzi_value_page_pv span#busuanzi_value_page_pv
span.post-meta-commentcount 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.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
if (postWordcount || theme.busuanzi.page_pv) if (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator | span.post-meta__separator |
i.far.fa-comments.fa-fw.post-meta__icon i.post-meta__icon(class=commentCount aria-hidden="true")
span= _p('post.comments') + ':' span= _p('post.comments') + ':'
span.disqus-comment-count.comment-count span.disqus-comment-count.comment-count
a(href=full_url_for(page.path) + '#disqus_thread') a(href=full_url_for(page.path) + '#disqus_thread')
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false) else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
if (postWordcount || theme.busuanzi.page_pv) if (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator | span.post-meta__separator |
i.far.fa-comments.fa-fw.post-meta__icon i.post-meta__icon(class=commentCount aria-hidden="true")
span= _p('post.comments') + ':' span= _p('post.comments') + ':'
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl") a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount") span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false) else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
if (postWordcount || theme.busuanzi.page_pv) if (theme.busuanzi && theme.busuanzi.page_pv)
span.post-meta__separator | span.post-meta__separator |
i.far.fa-comments.fa-fw.post-meta__icon i.post-meta__icon(class=commentCount aria-hidden="true")
span= _p('post.comments') + ':' span= _p('post.comments') + ':'
a(href=url_for(page.path) + '#post-comment') a(href=url_for(page.path) + '#post-comment')
span.gitalk-comment-count.comment-count span.gitalk-comment-count.comment-count
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false
if (postWordcount || theme.busuanzi.page_pv)
span.post-meta__separator |
i.far.fa-comments.fa-fw.post-meta__icon
span= _p('post.comments') + ':'
a.comment-count(href=url_for(page.path) + '#post-comment')
span.fb-comments-count(data-href=urlNoIndex())

View File

@@ -1,4 +1,4 @@
each url, icon in theme.social each url, icon in theme.social
a.social-icon(href=url_for(trim(url.split('||')[0])) target="_blank" a.social-icon(href=trim(url.split('||')[0]) target="_blank"
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1])) title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
i(class=icon) i(class=icon aria-hidden="true")

View File

@@ -1,15 +1,10 @@
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : '' - var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
- var pageHighlightShrinkSet = page.highlight_shrink !== undefined ? page.highlight_shrink : theme.highlight_shrink
- var pageHighlightShrink = theme.highlight_shrink !== 'none' && pageHighlightShrinkSet ? 'code-close' : ''
doctype html doctype html
html(lang=config.language data-theme=theme.display_mode) html(lang=config.language data-theme=theme.display_mode)
head head
include ./head.pug include ./head.pug
body body
if theme.preloader
!=partial('includes/loading/loading', {}, {cache:theme.fragment_cache})
if theme.fireworks && theme.fireworks.enable if theme.fireworks && theme.fireworks.enable
canvas.fireworks canvas.fireworks
@@ -17,11 +12,10 @@ html(lang=config.language data-theme=theme.display_mode)
include ./sidebar.pug include ./sidebar.pug
#body-wrap(class=pageHighlightShrink) #body-wrap
if theme.background if theme.background
- var is_photo = theme.background.startsWith('url') ? 'photo':'color' - var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
#web_bg(data-type=is_photo) #web_bg(data-type=is_photo)
include ./header/index.pug include ./header/index.pug
if (!is_post()) if (!is_post())
@@ -44,5 +38,13 @@ html(lang=config.language data-theme=theme.display_mode)
!=partial('includes/footer', {}, {cache:theme.fragment_cache}) !=partial('includes/footer', {}, {cache:theme.fragment_cache})
include ./rightside.pug include ./rightside.pug
!=partial('includes/search/index', {}, {cache:theme.fragment_cache}) !=partial('includes/search/index', {}, {cache:theme.fragment_cache})
each item in theme.CDN_USE.js
script(src=url_for(item))
include ./additional-js.pug include ./additional-js.pug

View File

@@ -1,6 +0,0 @@
script.
var endLoading = function () {
document.body.style.overflow = 'auto';
document.getElementById('loading-box').classList.add("loaded")
}
window.addEventListener('load',endLoading)

View File

@@ -1,9 +0,0 @@
#loading-box
.loading-left-bg
.loading-right-bg
.spinner-box
.configure-border-1
.configure-core
.configure-border-2
.configure-core
.loading-word= _p('loading')

View File

@@ -1,78 +1,65 @@
mixin postUI(posts) mixin UI_NEW(posts)
each article , index in page.posts.data - posts.each(function(article,index){
.recent-post-item .recent-post-item
- var link = article.link || article.path - var link = article.link || article.path
- var post_cover = article.cover
- var title = article.title || _p('no_title') - var title = article.title || _p('no_title')
- var leftOrRight = index%2 == 0 ? 'left_radius' : 'right_radius' - 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' : '' - var no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
if post_cover && theme.cover.index_enable if post_cover && theme.cover.index_enable
.post_cover(class=leftOrRight) .post_cover(class=leftOrRight)
a(href=url_for(link) title=title) a(href=url_for(link) title=title)
if theme.lazyload.enable if theme.lazyload.enable
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title) img.post_bg.lazyload(data-src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
else else
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title) img.post_bg(src=`${post_cover}` alt=title onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
.recent-post-info(class=no_cover) .recent-post-info(class=no_cover)
a.article-title(href=url_for(link) title=title)= title a.article-title(href=url_for(link) title=title)= title
.article-meta-wrap .article-meta-wrap
if (is_home() && (article.top || article.sticky > 0))
span.article-meta
i.fas.fa-thumbtack.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)
if (theme.post_meta.page.date_type === 'both') if (theme.post_meta.page.date_type === 'both')
time.post-meta__date time.post-meta__date
span.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date)) span.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date))
i.far.fa-calendar-alt i.fa.fa-calendar(aria-hidden="true")
=date(article.date, config.date_format) =date(article.date, config.date_format)
span.article-meta__separator | span.article-meta__separator |
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated)) span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
i.fas.fa-history i.fa.fa-history(aria-hidden="true")
=date(article.updated, config.date_format) =date(article.updated, config.date_format)
else else
- var data_type_updated = theme.post_meta.page.date_type === 'updated' - var data_type_updated = theme.post_meta.page.date_type === 'updated'
- var date_type = data_type_updated ? 'updated' : 'date' - var date_type = data_type_updated ? 'updated' : 'date'
- var date_icon = data_type_updated ? 'fas fa-history' :'far fa-calendar-alt' - var date_icon = data_type_updated ? 'fa-history' :'fa-calendar'
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created') - var date_title = data_type_updated ? _p('post.updated') : _p('post.created')
time.post-meta__date(title=date_title + ' ' + full_date(article[date_type])) time.post-meta__date(title=date_title + ' ' + full_date(article[date_type]))
i(class=date_icon) i.fa(class=date_icon aria-hidden="true")
=date(article[date_type], config.date_format) =date(article[date_type], config.date_format)
if (theme.post_meta.page.categories && article.categories.data.length > 0) if (theme.post_meta.page.categories && article.categories.data.length > 0)
span.article-meta span.article-meta
span.article-meta__separator | span.article-meta__separator |
i.fas.fa-inbox.article-meta__icon
each item, index in article.categories.data 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] a(href=url_for(item.path)).article-meta__categories #[=item.name]
if (index < article.categories.data.length - 1) if (index < article.categories.data.length - 1)
i.fas.fa-angle-right i.fa.fa-angle-right(aria-hidden="true")
if (theme.post_meta.page.tags && article.tags.data.length > 0) if (theme.post_meta.page.tags && article.tags.data.length > 0)
span.article-meta.tags span.article-meta.tags
span.article-meta__separator | span.article-meta__separator |
i.fas.fa-tag.article-meta__icon
each item, index in article.tags.data 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] a(href=url_for(item.path)).article-meta__tags #[=item.name]
if (index < article.tags.data.length - 1) if (index < article.tags.data.length - 1)
span.article-meta__link #[='•'] span.article-meta__link -
if theme.auto_excerpt && theme.auto_excerpt.enable
//- Display the article introduction on homepage
if theme.index_post_content.method == 1
.content!= article.description
else if theme.index_post_content.method == 2
if article.description
.content!= article.description
else
- const content = strip_html(article.content) - const content = strip_html(article.content)
- let expert = content.substring(0, theme.index_post_content.length) - let expert = content.substring(0, theme.auto_excerpt.length)
- content.length > theme.index_post_content.length ? expert += ' ...' : '' - content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
.content!= expert .content!= expert
else else
- const content = strip_html(article.content) .content!= article.description
- let expert = content.substring(0, theme.index_post_content.length)
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
.content!= expert
if theme.ad && theme.ad.index if theme.ad && theme.ad.index
if (index + 1) % 3 == 0 if (index + 1) % 3 == 0
.recent-post-item.ad_height!=theme.ad.index .recent-post-item.ad_height!=theme.ad.index
- })

View File

@@ -11,10 +11,10 @@ mixin articleSort(posts)
if article.cover && theme.cover.archives_enable if article.cover && theme.cover.archives_enable
.article-sort-img .article-sort-img
a.article-sort-item__img(href=url_for(article.path)) a.article-sort-item__img(href=url_for(article.path))
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'`) img(src=article.cover alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
.article-sort-post .article-sort-post
a.article-sort-item__post(href=url_for(article.path)) a.article-sort-item__post(href=url_for(article.path))
i.far.fa-calendar-alt i.fa.fa-clock-o(aria-hidden="true")
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format) 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' .article-sort-item__title= article.title || 'No Title'
- }) - })

View File

@@ -1,6 +1,6 @@
#mobile-sidebar-menus #mobile-sidebar-menus
.mobile_author_icon .mobile_author_icon
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar") img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
.mobile_post_data .mobile_post_data
if site.posts.length if site.posts.length
.mobile_data_item.is-center .mobile_data_item.is-center
@@ -23,4 +23,5 @@
.headline= _p('aside.categories') .headline= _p('aside.categories')
.length_num= site.categories.length .length_num= site.categories.length
hr hr
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')}) .menus_items
include ../header/menu_item.pug

View File

@@ -1,7 +1,7 @@
- -
var options = { var options = {
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>', prev_text: '<i class="fa fa-fw fa-chevron-left" aria-hidden="true"></i>',
next_text: '<i class="fas fa-chevron-right fa-fw"></i>', next_text: '<i class="fa fa-fw fa-chevron-right" aria-hidden="true"></i>',
mid_size: 1, mid_size: 1,
escape: false escape: false
} }
@@ -11,29 +11,29 @@ if(!is_post())
div.pagination div.pagination
!=paginator(options) !=paginator(options)
else else
nav#pagination.pagination-post nav#pagination.pagination_post
if(page.prev) if(page.prev)
- var hasPageNext = page.next ? 'pull-left' : 'pull-full' - var hasPageNext = page.prev ? 'pull_left' : 'pull-full'
.prev-post(class=hasPageNext) .prev-post(class=hasPageNext)
- var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover - var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
a(href=url_for(page.prev.path)) a(href=url_for(page.prev.path))
if theme.lazyload.enable if theme.lazyload.enable
img.prev-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` ) img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
else else
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` ) img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
.pagination-info .pagination-info
.label=_p('pagination.prev') .label=_p('pagination.prev')
.prev_info=page.prev.title .prev_info=page.prev.title
if(page.next) if(page.next)
- var hasPagePrev = page.prev ? 'pull-right' : 'pull-full' - var hasPagePrev = page.prev ? 'pull_right' : 'pull-full'
- var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover - var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover
.next-post(class=hasPagePrev) .next-post(class=hasPagePrev)
a(href=url_for(page.next.path)) a(href=url_for(page.next.path))
if theme.lazyload.enable if theme.lazyload.enable
img.next-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`) img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
else else
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`) img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
.pagination-info .pagination-info
.label=_p('pagination.next') .label=_p('pagination.next')
.next_info=page.next.title .next_info=page.next.title

View File

@@ -1,12 +1,11 @@
.post-reward .post-reward
button.reward-button a.reward-button.button--primary.button--animated
i.fas.fa-qrcode i.fa.fa-qrcode
= ' ' + _p('donate') = ' ' + _p('donate')
.reward-main .reward-main
ul.reward-all ul.reward-all
each item in theme.reward.QR_code each item in theme.reward.QR_code
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
li.reward-item li.reward-item
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text onclick=`window.open('${url_for(clickTo)}')`) img.lazyload.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
.post-qr-code__desc=(item.itemlist||item).text .post-qr-code__desc=(item.itemlist||item).text

View File

@@ -0,0 +1,67 @@
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
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 |
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 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 |
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
if theme.ad && theme.ad.index
if (index + 1) % 3 == 0
.recent-post-item.ad_height!=theme.ad.index

View File

@@ -1,32 +1,23 @@
section#rightside.rightside section#rightside.rightside
#rightside-config-hide #rightside-config-hide
if theme.readmode.enable && is_post()
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
if is_post() if is_post()
if theme.readmode i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
button#readmode(title=_p('rightside.readmode_title')) i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
i.fas.fa-book-open
button#font_plus(title=_p('rightside.font_plus_title'))
i.fas.fa-plus
button#font_minus(title=_p('rightside.font_minus_title'))
i.fas.fa-minus
if theme.translate && theme.translate.enable if theme.translate && theme.translate.enable
button#translateLink.translate_chn_to_cht(title=_p('rightside.translate_title'))= theme.translate.default a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
if theme.darkmode.enable && theme.darkmode.button if theme.darkmode.enable && theme.darkmode.button
button#darkmode(title=_p('rightside.night_mode_title')) - var lightModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-sun' : 'fa fa-sun-o'
i.fas.fa-adjust - var darkModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-moon' : 'fa fa-moon-o'
- var display_mode = theme.display_mode == 'dark' ? lightModeIcon : darkModeIcon
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
#rightside-config-show #rightside-config-show
button#rightside_config(title=_p("rightside.setting")) #rightside_config(title=_p("rightside.setting"))
i.fas.fa-cog i.fa.fa-cog(aria-hidden="true")
if is_post() && page.comments !== false && isComment if is_post() && page.comments !== false && isComment
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment")) a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
i.scroll_to_comment.fas.fa-comments i.scroll_to_comment.fa.fa-comments
if showToc if is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
button#mobile-toc-button.close(title=_p("rightside.toc")) i#mobile-toc-button.fa.fa-list-ul.close(title=_p("rightside.toc") aria-hidden="true")
i.fas.fa-list-ul i.fa.fa-arrow-up#go-up(title=_p("rightside.back_to_top") aria-hidden="true")
if theme.chat_btn && (theme.chatra.enable || theme.tidio.enable || theme.daovoice.enable || theme.gitter.enable)
button#chat_btn(title=_p("rightside.chat_btn"))
i.fas.fa-sms
button#go-up(title=_p("rightside.back_to_top"))
i.fas.fa-arrow-up

View File

@@ -8,5 +8,5 @@
#algolia-pagination #algolia-pagination
#algolia-stats #algolia-stats
span.search-close-button span.search-close-button
i.fas.fa-times i.fa.fa-times
.search-mask .search-mask

View File

@@ -19,5 +19,5 @@
span=_p("local_search.powered_by") span=_p("local_search.powered_by")
| #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search] | #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search]
span.search-close-button span.search-close-button
i.fas.fa-times i.fa.fa-times
.search-mask .search-mask

View File

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

View File

@@ -1,11 +1,15 @@
- 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 = page.toc_number !== undefined ? page.toc_number : theme.toc.number let tocNumber
let autoOpenPostSet = page.auto_open == undefined ? theme.toc.auto_open : page.auto_open if (page.toc_number !== undefined) tocNumber = page.toc_number
let autoOpenSidebar = autoOpenPostSet ? 'on' : '' else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
else tocNumber = true
- -
if(showToc) if(showToc)
i.fas.fa-arrow-right#toggle-sidebar(class=autoOpenSidebar) i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
#sidebar #sidebar
.sidebar-toc .sidebar-toc
div.sidebar-toc__title= _p('sidebar.catalog') div.sidebar-toc__title= _p('sidebar.catalog')

View File

@@ -1,12 +1,13 @@
script(src=url_for(theme.CDN.pangu)) script(src=url_for(theme.CDN.pangu))
if theme.pangu.field === 'post' && is_post() if theme.pangu.field === 'post'
if is_post()
script. script.
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
pangu.autoSpacingPage() pangu.spacingElementById('content-inner')
}) })
else if theme.pangu.field === 'site' else if theme.pangu.field === 'page'
script. script.
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
pangu.autoSpacingPage() pangu.spacingElementById('content-inner')
}) })

View File

@@ -1,6 +1,6 @@
.card-widget.card-announcement .card-widget.card-announcement
.card-content .card-content
.item-headline .item-headline
i.fas.fa-bullhorn.card-announcement-animation i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
span= _p('aside.card_announcement') span= _p('aside.card_announcement')
.announcement_content!= theme.aside.card_announcement.content .announcement_content!= theme.announcement.content

View File

@@ -1,11 +1,6 @@
.card-widget.card-archives .card-widget.card-archives
.card-content .card-content
.item-headline .item-headline
i.fas.fa-archive i.fa.fa-archive(aria-hidden="true")
span= _p('aside.card_archives') 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 })

View File

@@ -1,9 +1,9 @@
.card-widget.card-info .card-widget.card-info
.card-content .card-content
.card-info-avatar.is-center .card-info-avatar.is-center
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar") img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
.author-info__name= config.author .author-info__name= config.author
.author-info__description!= theme.aside.card_author.description || config.description .author-info__description= config.description
.card-info-data .card-info-data
if site.posts.length if site.posts.length
@@ -25,10 +25,10 @@
.length_num= site.categories.length .length_num= site.categories.length
.card-info-bookmark.is-center .card-info-bookmark.is-center
button#bookmark-it.button--animated(title= _p('aside.card_bookmark')) a#bookmark-it.bookmark.button--primary.button--animated(href="javascript:;" title= _p('aside.card_bookmark') target="_self")
i.fas.fa-bookmark i.fa.fa-bookmark(aria-hidden="true")
span= _p('aside.card_bookmark') || 'Follow Me' span= _p('aside.card_bookmark') || 'Follow Me'
if(theme.social) if(theme.social)
.card-info-social-icons.is-center .card-info-social-icons.is-center
!=fragment_cache('social', function(){return partial('includes/header/social')}) include ../header/social.pug

View File

@@ -2,8 +2,22 @@ if site.categories.length
.card-widget.card-categories .card-widget.card-categories
.card-content .card-content
.item-headline .item-headline
i.fas.fa-folder-open i.fa.fa-folder-open(aria-hidden="true")
span= _p('aside.card_categories') span= _p('aside.card_categories')
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 , expand: theme.aside.card_categories.expand }) 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()

View File

@@ -1,11 +1,10 @@
.card-widget.card-recent-post .card-widget.card-recent-post
.card-content .card-content
.item-headline .item-headline
i.fas.fa-history i.fa.fa-history(aria-hidden="true")
span= _p('aside.card_recent_post') span= _p('aside.card_recent_post')
.aside-recent-item .aside-recent-item
- 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(5).each(function(article){
- site.posts.sort('date', -1).limit(postLimit).each(function(article){
.aside-recent-post .aside-recent-post
- var link = article.link || article.path - var link = article.link || article.path
- var title = article.title || _p('no_title') - var title = article.title || _p('no_title')
@@ -16,9 +15,9 @@
if post_cover && theme.cover.aside_enable if post_cover && theme.cover.aside_enable
.aside-post-cover .aside-post-cover
if theme.lazyload.enable if theme.lazyload.enable
img.aside-post-bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title) img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
else else
img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title) img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
.aside-post-title(class=no_cover) .aside-post-title(class=no_cover)
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title') .aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)] time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]

View File

@@ -2,11 +2,6 @@ if site.tags.length
.card-widget.card-tags .card-widget.card-tags
.card-content .card-content
.item-headline .item-headline
i.fas.fa-tags i.fa.fa-tags(aria-hidden="true")
span= _p('aside.card_tags') 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'})

View File

@@ -1,7 +1,8 @@
- var webinfoIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'fas fa-chart-line' : 'fa fa-line-chart'
.card-widget.card-webinfo .card-widget.card-webinfo
.card-content .card-content
.item-headline .item-headline
i.fas.fa-chart-line i(class=webinfoIcon aria-hidden="true")
span= _p('aside.card_webinfo.headline') span= _p('aside.card_webinfo.headline')
.webinfo .webinfo
.webinfo-item .webinfo-item
@@ -10,7 +11,7 @@
if theme.runtimeshow.enable if theme.runtimeshow.enable
.webinfo-item .webinfo-item
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :" .webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
#webinfo-runtime-count.webinfo-runtime-count(publish_date=theme.runtimeshow.publish_date) #webinfo-runtime-count.webinfo-runtime-count(start_date=theme.runtimeshow.start_date)
if theme.wordcount.enable && theme.wordcount.total_wordcount if theme.wordcount.enable && theme.wordcount.total_wordcount
.webinfo-item .webinfo-item
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :" .webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :"

View File

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

View File

@@ -1,7 +1,6 @@
extends includes/layout.pug extends includes/layout.pug
block content block content
include ./includes/mixins/post-ui.pug
#recent-posts.recent-posts #recent-posts.recent-posts
+postUI include includes/recent-posts.pug
include includes/pagination.pug include includes/pagination.pug

14
layout/page-tags.pug Normal file
View File

@@ -0,0 +1,14 @@
.tag-cloud
.tag-cloud__title= _p('page.tag')
| -
span.tag-cloud__amount= site.tags.length
.tag-cloud-tags
- site.tags.sort('path').each(function (tags){
- var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
- var color = "rgb(" + Math.floor(Math.random() * 201) + ", " + Math.floor(Math.random() * 201) +", " + Math.floor(Math.random() * 201) +")"; // 0,0,0 -> 200,200,200
a(href=url_for(tags.path) style='font-size:' + fontSize + ';color:' + color)=tags.name
-})
if page.comments !== false
include includes/comments/index.pug

View File

@@ -2,14 +2,7 @@ extends includes/layout.pug
block content block content
if page.type === 'tags' if page.type === 'tags'
.tag-cloud include page-tags.pug
.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' else if page.type === 'link'
include flink.pug include flink.pug
else if page.type === 'categories' else if page.type === 'categories'

View File

@@ -2,7 +2,7 @@ extends includes/layout.pug
block content block content
article#post(class="") article#post(class="")
#article-container.post-content!=page.content #article-container!=page.content
include includes/post/post-copyright.pug include includes/post/post-copyright.pug
.tag_share .tag_share
if (theme.post_meta.post.tags) if (theme.post_meta.post.tags)

View File

@@ -2,9 +2,9 @@ extends includes/layout.pug
block content block content
if theme.tag_ui == 'index' if theme.tag_ui == 'index'
include ./includes/mixins/post-ui.pug include ./includes/mixins/UI.pug
#recent-posts.recent-posts #recent-posts.recent-posts
+postUI +UI_NEW(page.posts)
include includes/pagination.pug include includes/pagination.pug
else else
include ./includes/mixins/article-sort.pug include ./includes/mixins/article-sort.pug

View File

@@ -1,18 +1,5 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "2.3.5", "version": "2.2.5",
"private": true, "description": "A Hexo Theme: Butterfly"
"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"
} }

View File

@@ -1,15 +1,8 @@
/** 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 if (!hexo.theme.config.error_404.enable) return
return { return {
path: '404.html', path: '404.html',
data: locals.posts, data: locals.posts,
layout: ['404'] layout: ['404']
} }
}) });

View File

@@ -2,8 +2,6 @@
* Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config. * Note: configs in _data/butterfly.yml will replace configs in hexo.theme.config.
*/ */
'use strict'
hexo.on('generateBefore', function () { hexo.on('generateBefore', function () {
const rootConfig = hexo.config const rootConfig = hexo.config
if (hexo.locals.get) { if (hexo.locals.get) {

View File

@@ -0,0 +1,63 @@
/**
* global hexo
* from printempw/hexo-hide-posts
* modify by Jerry
*/
'use strict';
var public_generators = [];
hexo.extend.filter.register('before_generate', function () {
this._bindLocals();
const all_posts = this.locals.get('posts');
const hidden_posts = all_posts.find({
'hide': true
});
const normal_posts = all_posts.filter(post => !post['hide']);
this.locals.set('all_posts', all_posts);
this.locals.set('hidden_posts', hidden_posts);
this.locals.set('posts', normal_posts);
});
hexo.extend.filter.register('after_init', function () {
const original = {};
for (const name in hexo.extend.generator.list()) {
original[name] = hexo.extend.generator.get(name);
}
hexo.extend.generator.register('post', async function (locals) {
const fg = original.post.bind(this);
const generated_public = await fg(locals);
const generated_hidden = await fg(Object.assign({}, locals, {
posts: locals.hidden_posts
}));
// Remove post.prev and post.next for hidden posts
generated_hidden.forEach(ele => {
ele.data.prev = ele.data.next = null;
});
return generated_public.concat(generated_hidden);
});
// Then we hack into other generators if necessary
public_generators.filter(
name => Object.keys(original).includes(name)
).forEach(name => {
// Overwrite original generator
hexo.extend.generator.register(name, function (locals) {
const fg = original[name].bind(this);
return fg(Object.assign({}, locals, {
posts: new locals.posts.constructor(
locals.posts.data.concat(locals.hidden_posts.data)
)
}));
});
});
});

View File

@@ -0,0 +1,29 @@
'use strict';
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(.*?)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('>', ` data-src="${p2}">`);
}
str = str.replace(p2, `${bg}`)
return str.replace(p3, ` class="lazyload" data-src="${p2}" ${p3}`);
});
}
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);

View File

@@ -1,23 +0,0 @@
/**
* Butterfly
* lazyload
* replace src to data-src
*/
// <figure .+class="[^"]* highlight [^"]*".+>
'use strict'
const urlFor = require('hexo-util').url_for.bind(hexo)
function lazyProcess (htmlContent) {
var bg = hexo.theme.config.lazyload.post ? urlFor(hexo.theme.config.lazyload.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.enable) return
data.content = lazyProcess.call(this, data.content)
return data
}
hexo.extend.filter.register('after_post_render', processPost)

View File

@@ -0,0 +1,23 @@
hexo.extend.filter.register("before_post_render", function(data) {
if (data.cover == false) {
data.randomcover = random_cover();
return data;
}
data.cover = data.cover || random_cover();
return data;
});
var random_cover = function() {
var cover;
var num;
if (!Array.isArray(hexo.theme.config.cover.default_cover)) {
cover = hexo.theme.config.cover.default_cover;
return cover;
} else {
num = Math.floor(
Math.random() * hexo.theme.config.cover.default_cover.length
);
cover = hexo.theme.config.cover.default_cover[num];
return cover;
}
};

View File

@@ -1,34 +0,0 @@
/**
* 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
}
}

View File

@@ -1,112 +0,0 @@
/**
* 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="fas fa-angle-right" ></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('_', '-')
}

View File

@@ -1,96 +0,0 @@
/**
* 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 isExpand = options.expand !== 'none'
const expandClass = isExpand && options.expand === true ? 'card-category-list-icon expand' : 'card-category-list-icon'
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, topparent = true) => {
let result = ''
var isTopParent = topparent
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, false)
child = childList[0]
t = childList[1]
}
var parentClass = isExpand && isTopParent && child ? 'parent' : ''
result += `<li class="card-category-list-item ${parentClass}">`
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>`
}
if (isExpand && isTopParent && child) {
result += `<i class="fas fa-caret-left ${expandClass}"></i>`
}
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="fas fa-angle-right"></i></a></li>`
return moreHtml
}
return `<ul class="card-category-list">
${list[0]}
${moreButton()}
</ul>`
})

View File

@@ -0,0 +1,103 @@
"use strict";
hexo.extend.helper.register("list_archives", function(options = {}) {
const { config } = this;
const archiveDir = config.archive_dir;
const { timezone } = config;
const lang = this.page.lang || this.page.language || config.language;
let { format } = options;
const type = options.type || "monthly";
const { style = "list", transform, separator = ", " } = options;
const showCount = Object.prototype.hasOwnProperty.call(options, "show_count")
? options.show_count
: true;
const order = options.order || -1;
const limit = 8;
let result = "";
var more_button;
if (lang === "zh-CN") {
more_button = "查看更多";
} else if (lang === "zh-TW") {
more_button = "查看更多";
} else {
more_button = "More";
}
if (!format) {
format = type === "monthly" ? "MMMM YYYY" : "YYYY";
}
const posts = this.site.posts.sort("date", order);
if (!posts.length) return result;
const data = [];
let length = 0;
posts.forEach(post => {
// Clone the date object to avoid pollution
let date = post.date.clone();
if (timezone) date = date.tz(timezone);
if (lang) date = date.locale(lang);
const year = date.year();
const month = date.month() + 1;
const name = date.format(format);
const lastData = data[length - 1];
if (!lastData || lastData.name !== name) {
length = data.push({
name,
year,
month,
count: 1
});
} else {
lastData.count++;
}
});
const link = item => {
let url = `${archiveDir}/${item.year}/`;
if (type === "monthly") {
if (item.month < 10) url += "0";
url += `${item.month}/`;
}
return this.url_for(url);
};
result += `<ul class="archive-list">`;
for (let i = 0, len = data.length; i < Math.min(len, limit); i++) {
const item = data[i];
result += `<li class="archive-list-item">`;
result += `<a class="archive-list-link" href="${link(item)}">`;
result += `<span class="archive-list-date">`;
result += transform ? transform(item.name) : item.name;
result += `</span>`;
if (showCount) {
result += `<span class="archive-list-count">${item.count}</span>`;
}
result += "</a>";
result += "</li>";
}
if (data.length > limit) {
result += `<li class="archive-list-item is-center">`;
result +=
`<a class="archive-list-link-more" href="` +
"/" +
`${archiveDir}" >`;
result += more_button;
result += "</a>";
result += "</li>";
}
result += "</ul>";
return result;
});

View File

@@ -1,58 +0,0 @@
/**
* 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
})

View File

@@ -0,0 +1,90 @@
hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
var relatedPosts = [];
currentPost.tags.forEach(function (tag) {
allPosts.forEach(function (post) {
if (isTagRelated(tag.name, post.tags)) {
var relatedPost = {
title: post.title,
path: post.path,
cover: post.cover,
randomcover: post.randomcover,
weight: 1,
updated: post.updated,
created: post.date
};
var index = findItem(relatedPosts, 'path', post.path);
if (index != -1) {
relatedPosts[index].weight += 1;
} else {
if (currentPost.path != post.path) {
relatedPosts.push(relatedPost);
};
};
};
});
});
if (relatedPosts.length == 0) {
return ''
};
var result = "";
const hexoConfig = hexo.theme.config.rootConfig;
const config = hexo.theme.config;
var limit_num = config.related_post.limit || 6
var date_type = config.related_post.date_type || 'created'
var headline_lang = this._p('post.recommend')
relatedPosts = relatedPosts.sort(compare('weight'));
var lazy_src = config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
var lazy_class = config.lazyload.enable ? lazy_class = 'lazyload' : lazy_class = ''
if (relatedPosts.length > 0) {
result += '<div class="relatedPosts">'
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + ' ' + headline_lang + '</span></div>'
result += '<div class="relatedPosts_list">'
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
var cover = relatedPosts[i].cover === false ? relatedPosts[i].randomcover : relatedPosts[i].cover
result += '<div class="relatedPosts_item"><a href="' + hexoConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
result += '<img class="relatedPosts_cover ' + lazy_class + '"' + lazy_src + '="' + cover + '">';
if (date_type == 'created') {
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i>' + ' ' + this.date(relatedPosts[i].created,hexoConfig.date_format) + '</div>'
} else {
result += '<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fa fa-history fa-fw" aria-hidden="true"></i>' + ' ' + this.date(relatedPosts[i].updated,hexoConfig.date_format) + '</div>'
}
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
result += '</div></a></div>'
};
result += '</div><div class="clear_both"></div></div>'
return result;
}
});
function isTagRelated(tagName, TBDtags) {
var result = false;
TBDtags.forEach(function (tag) {
if (tagName == tag.name) {
result = true;
};
})
return result;
}
function findItem(arrayToSearch, attr, val) {
for (var i = 0; i < arrayToSearch.length; i++) {
if (arrayToSearch[i][attr] == val) {
return i
};
};
return -1;
}
function compare(attr) {
return function (a, b) {
var val1 = a[attr];
var val2 = b[attr];
return val2 - val1;
}
}

View File

@@ -1,123 +0,0 @@
/**
* 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.enable ? 'data-src' : 'src'
relatedPosts = relatedPosts.sort(compare('weight'))
if (relatedPosts.length > 0) {
result += '<div class="relatedPosts">'
result +=
'<div class="relatedPosts_headline"><i class="fas fa-thumbs-up fa-fw"></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="far fa-calendar-alt fa-fw"></i>' +
' ' +
this.date(relatedPosts[i].created, hexoConfig.date_format) +
'</div>'
} else {
result +=
'<div class="relatedPosts_main is-center"><div class="relatedPosts_date"><i class="fas fa-history fa-fw"></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>'
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
}
}

View File

@@ -1,28 +0,0 @@
/**
* Button
* {% btn url text icon option %}
* option: color outline center block larger
* color : default/blue/pink/red/purple/orange/green
*/
'use strict'
const urlFor = require('hexo-util').url_for.bind(hexo)
function btn (args) {
args = args.join(' ').split(',')
var url = args[0] || ''
var text = args[1] || ''
var icon = args[2] || ''
var option = args[3] || ''
url = url.trim()
text = text.trim()
icon = icon.trim()
option = option.trim()
return `<a class="btn-beautify button--animated ${option}" href="${urlFor(url)}" title="${text}">
${icon.length > 0 ? `<i class="${icon} fa-fw"></i>` : ''} ${text} </a>`
}
hexo.extend.tag.register('btn', btn, { ends: false })

View File

@@ -1,18 +1,11 @@
/** const url_for = require('hexo-util').url_for.bind(hexo);
* Butterfly
* galleryGroup and allery
*/
'use strict' function gallery(args, content) {
return `<div class="justified-gallery">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
const url_for = require('hexo-util').url_for.bind(hexo) </div>`;
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 name = args[0]
const desrc = args[1] const desrc = args[1]
const url = url_for(args[2]) const url = url_for(args[2])
@@ -30,5 +23,5 @@ function galleryGroup (args) {
` `
} }
hexo.extend.tag.register('gallery', gallery, { ends: true }) hexo.extend.tag.register('gallery', gallery, {ends: true});
hexo.extend.tag.register('galleryGroup', galleryGroup) hexo.extend.tag.register('galleryGroup', galleryGroup);

View File

@@ -1,71 +1,33 @@
/** /**
* Butterfly
* @example
* hideInline
* {% hideInline content,display,bg,color %} * {% hideInline content,display,bg,color %}
* content不能包含當引號可用 &apos; * content不能包含當引號可用 &apos;
* hideBlock */
function hideInline(args) {
args = args.join(' ').split(',')
let content = args[0].trim()
let display = args[1] || 'Click'
let bg = args[2] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
let color = args[3] || '#fff'
return `<span class="hide-inline"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
</a><span class="hide-content">${content}</span></span>`
}
/**
* {% hideBlock display,bg,color %} * {% hideBlock display,bg,color %}
* content * content
* {% endhideBlock %} * {% endhideBlock %}
* hideToggle
* {% hideToggle display,bg,color %}
* content
* {% endhideToggle %}
*/ */
function hideBlock(args,content) {
'use strict'
function hideInline (args) {
args = args.join(' ').split(',') args = args.join(' ').split(',')
var content = args[0] let display = args[0] || 'Click'
var display = args[1] || 'Click' let bg = args[1] ==='' || typeof args[2] ==='undefined' ? '' : `background-color:${args[2]}`
var bg = args[2] || false let color = args[2] || '#fff'
var color = args[3] || false
var group = 'style="'
if (bg) group += `background-color: ${bg};` return `<div class="hide-block"><a class="hide-button button--primary button--animated" style="color:${color};${bg}">${display}
if (color) group += `color: ${color}` </a><span class="hide-content">${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}</span></div>`
group += '"'
return `<span class="hide-inline"><button class="hide-button button--animated" ${group}>${display}
</button><span class="hide-content">${content}</span></span>`
} }
function hideBlock (args, content) { hexo.extend.tag.register('hideInline', hideInline);
args = args.join(' ').split(',') hexo.extend.tag.register('hideBlock', hideBlock, {ends: true});
var display = args[0] || 'Click'
var bg = args[1] || false
var color = args[2] || false
var group = 'style="'
if (bg) group += `background-color: ${bg};`
if (color) group += `color: ${color}`
group += '"'
return `<div class="hide-block"><button class="hide-button button--animated" ${group}>${display}
</button><span class="hide-content">${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')}</span></div>`
}
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="fas 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 })

View File

@@ -1,15 +1,7 @@
/** function mermaid(args, content) {
* Butterfly
* mermaid
* https://github.com/mermaid-js/mermaid
*/
'use strict'
function mermaid (args, content) {
return `<div class="mermaid"> return `<div class="mermaid">
${content} ${content}
</div>` </div>`;
} }
hexo.extend.tag.register('mermaid', mermaid, { ends: true }) hexo.extend.tag.register('mermaid', mermaid, {ends: true});

View File

@@ -3,13 +3,13 @@
* transplant from hexo-theme-next * transplant from hexo-theme-next
*/ */
'use strict' 'use strict';
function postNote (args, content) { function postNote(args, content) {
return `<div class="note ${args.join(' ')}"> return `<div class="note ${args.join(' ')}">
${hexo.render.renderSync({ text: content, engine: 'markdown' }).split('\n').join('')} ${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')}
</div>` </div>`;
} }
hexo.extend.tag.register('note', postNote, { ends: true }) hexo.extend.tag.register('note', postNote, {ends: true});
hexo.extend.tag.register('subnote', postNote, { ends: true }) hexo.extend.tag.register('subnote', postNote, {ends: true});

View File

@@ -1,62 +0,0 @@
/**
* Tabs
* transplant from hexo-theme-next
* modify by Jerry
*/
'use strict'
function postTabs (args, content) {
var tabBlock = /<!--\s*tab (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtab\s*-->/g
args = args.join(' ').split(',')
var tabName = args[0]
var tabActive = Number(args[1]) || 0
var matches = []
var match
var tabId = 0
var tabNav = ''
var tabContent = ''
!tabName && hexo.log.warn('Tabs block must have unique name!')
while ((match = tabBlock.exec(content)) !== null) {
matches.push(match[1])
matches.push(match[2])
}
for (var i = 0; i < matches.length; i += 2) {
var tabParameters = matches[i].split('@')
var postContent = matches[i + 1]
var tabCaption = tabParameters[0] || ''
var tabIcon = tabParameters[1] || ''
var tabHref = ''
postContent = hexo.render.renderSync({ text: postContent, engine: 'markdown' }).trim()
tabId += 1
tabHref = (tabName + ' ' + tabId).toLowerCase().split(' ').join('-');
((tabCaption.length === 0) && (tabIcon.length === 0)) && (tabCaption = tabName + ' ' + tabId)
var isOnlyicon = tabIcon.length > 0 && tabCaption.length === 0 ? ' style="text-align: center;"' : ''
var icon = tabIcon.trim()
tabIcon.length > 0 && (tabIcon = `<i class="${icon}"${isOnlyicon}></i>`)
var toTop = '<button class="tab-to-top" onclick="scrollToDest($(this).parents(\'.tabs\'),65)"><i class="fas fa-arrow-up"></i></button>'
var isActive = (tabActive > 0 && tabActive === tabId) || (tabActive === 0 && tabId === 1) ? ' active' : ''
tabNav += `<li class="tab${isActive}"><a href="#${tabHref}">${tabIcon + tabCaption.trim()}</a></li>`
tabContent += `<div class="tab-item-content${isActive}" id="${tabHref}">${postContent + toTop}</div>`
}
tabNav = `<ul class="nav-tabs">${tabNav}</ul>`
tabContent = `<div class="tab-contents">${tabContent}</div>`
return `<div class="tabs" id="${tabName.toLowerCase().split(' ').join('-')}">${tabNav + tabContent}</div>`
}
hexo.extend.tag.register('tabs', postTabs, { ends: true })
hexo.extend.tag.register('subtabs', postTabs, { ends: true })
hexo.extend.tag.register('subsubtabs', postTabs, { ends: true })

View File

@@ -1,18 +0,0 @@
.limit-one-line
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
.limit-more-line
display: -webkit-box
overflow: hidden
-webkit-box-orient: vertical
.fontawesomeIcon
display: inline-block
font-weight: 600
font-style: normal
font-variant: normal
font-family: 'Font Awesome 5 Free'
text-rendering: auto
-webkit-font-smoothing: antialiased

View File

@@ -14,6 +14,9 @@ body
if !hexo-config('copy.enable') if !hexo-config('copy.enable')
user-select: none user-select: none
-moz-user-select: none
-webkit-user-select: none
-ms-user-select: none
*::-webkit-scrollbar *::-webkit-scrollbar
width: 8px width: 8px
@@ -59,16 +62,15 @@ h6
left: $sidebar-icon-left left: $sidebar-icon-left
z-index: 100 z-index: 100
font-size: $sidebar-icon-size font-size: $sidebar-icon-size
// opacity: 0
cursor: pointer cursor: pointer
transition: all .2s transition: all .2s
hr hr
position: relative position: relative
margin: 2rem auto margin: 2rem auto
border: 2px dashed lighten($theme-hr-color, 50%)
if hexo-config('hr_icon.enable')
width: calc(100% - 4px) width: calc(100% - 4px)
border: 2px dashed lighten($theme-hr-color, 50%)
&:hover &:hover
&:before &:before
@@ -79,19 +81,30 @@ hr
top: $hr-icon-top top: $hr-icon-top
left: 5% left: 5%
z-index: 1 z-index: 1
color: lighten($theme-hr-color, 30%) color: $theme-hr-color
content: $hr-icon content: $hr-icon
font-style: normal
font-variant: normal
font-size: 20px font-size: 20px
line-height: 1 line-height: 1
transition: all 1s ease-in-out transition: all 1s ease-in-out
@extend .fontawesomeIcon text-rendering: auto
-webkit-font-smoothing: antialiased
.table-wrap if hexo-config('fontawesome_v5') && hexo-config('fontawesome_v5.enable')
overflow-x: scroll font-weight: 600
font-family: 'Font Awesome 5 Free'
else
font-weight: normal
font-family: FontAwesome
iframe
margin: 0 0 1rem margin: 0 0 1rem
table table
display: table display: block
overflow: auto
margin: 0 0 1rem
width: 100% width: 100%
border-spacing: 0 border-spacing: 0
border-collapse: collapse border-collapse: collapse
@@ -110,26 +123,18 @@ table
background: $theme-text-selection-color background: $theme-text-selection-color
color: #F7F7F7 color: #F7F7F7
button
margin: 0
padding: 0
outline: 0
border: none
background: none
cursor: pointer
// font // font
#page-header #site_title, #nav #site_title,
#page-header #site_subtitle, #nav #site_subtitle,
#site-name, #site-name,
#aside_content .author-info__name, #aside_content .author-info__name,
#aside_content .author-info__description #aside_content .author-info__description
font-family: $site-name-font font-family: $site-name-font
.is-right .is_right
text-align: right text-align: right
.is-left .is_left
text-align: left text-align: left
.is-center .is-center
@@ -141,21 +146,22 @@ button
.is-visible-inline .is-visible-inline
display: inline-block !important display: inline-block !important
.is-invisible .is_invisible
display: none !important display: none !important
.is-hidden .is_hidden
overflow: hidden overflow: hidden
.copy-true .pull_left
user-select: all
.pull-left
float: left float: left
.pull-right .pull_right
float: right float: right
// button hover
.button--primary
color: $theme-button-hover-color
.button--animated .button--animated
transition-duration: 1s transition-duration: 1s
transition-property: color transition-property: color
@@ -186,42 +192,80 @@ img:not([src])
.img-alt .img-alt
margin: -.5rem 0 .5rem margin: -.5rem 0 .5rem
color: $font-black
// hexo tag video
.video-container
position: relative
overflow: hidden
margin-bottom: .8rem
padding-top: 56.25%
height: 0
iframe
position: absolute
top: 0
left: 0
margin-top: 0
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 &:hover
text-decoration: none !important 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 .comment_headling
margin-bottom: 10px margin-bottom: 10px
font-weight: 700 font-weight: 700
font-size: 20px font-size: 20px
.post-ad .post-ad
margin: 2rem 0 margin: 2rem 0 !important
.ad_height .ad_height
display: block !important display: block !important
height: auto !important height: auto !important
// animation
#content-inner, #content-inner,
#footer #footer
animation: main 1s animation: main 1s
#page-header #nav
animation: header-effect 1s animation: nav-effect 1s
// #page-header
// animation: header-effect 1s
#site_title, #site_title,
#site_subtitle #site_subtitle
animation: titlescale 1s animation: titlescale 1s
canvas:not(#ribbon-canvas), canvas,
#web_bg #web_bg
animation: to_show 4s animation: to_show 4s
#ribbon-canvas
animation: ribbon_to_show 4s
.card-announcement-animation .card-announcement-animation
color: #FF0000 color: #FF0000
animation: announ_animation .8s linear infinite animation: announ_animation .8s linear infinite
@@ -248,13 +292,13 @@ if hexo-config('avatar.effect') == true
.tocOpenMobile .tocOpenMobile
.sidebar-toc__title .sidebar-toc__title
animation: tocsidebarRtoL .4s animation: tocsidebarRtoL .5s
.sidebar-toc__progress .sidebar-toc__progress
animation: tocsidebarRtoL .6s animation: tocsidebarRtoL .7s
.sidebar-toc__content .sidebar-toc__content
animation: tocsidebarRtoL .7s animation: tocsidebarRtoL .9s
@keyframes scroll-down-effect @keyframes scroll-down-effect
0% 0%
@@ -269,7 +313,7 @@ if hexo-config('avatar.effect') == true
top: 0 top: 0
opacity: .4 opacity: .4
@keyframes header-effect @keyframes nav-effect
0% 0%
opacity: 0 opacity: 0
transform: translateY(-50px) transform: translateY(-50px)
@@ -278,6 +322,18 @@ if hexo-config('avatar.effect') == true
opacity: 1 opacity: 1
transform: translateY(0) transform: translateY(0)
@keyframes header-effect
0%
opacity: 0
60%
opacity: 0
transform: translateY(-30px)
100%
opacity: 1
transform: translateY(0)
@keyframes headerNoOpacity @keyframes headerNoOpacity
0% 0%
transform: translateY(-50px) transform: translateY(-50px)
@@ -319,13 +375,6 @@ if hexo-config('avatar.effect') == true
100% 100%
opacity: 1 opacity: 1
@keyframes ribbon_to_show
0%
opacity: 0
100%
opacity: hexo-config('canvas_ribbon.alpha')
@keyframes avatar_turn_around @keyframes avatar_turn_around
from from
transform: rotate(0) transform: rotate(0)

View File

@@ -1,73 +1,8 @@
// For diff highlight $highlight_theme = hexo-config('highlight_theme')
pre .deletion
color: $highlight-deletion
pre .addition if $highlight_theme == 'light'
color: $highlight-addition $highlight-deletion = #fdd
$highlight-addition = #dfd
pre .meta else
color: $highlight-purple $highlight-deletion = #008000
$highlight-addition = #800000
pre
.comment
color: $highlight-comment
.variable,
.attribute,
.regexp,
.ruby .constant,
.xml .tag .title,
.xml .pi,
.xml .doctype,
.html .doctype,
.css .id,
.tag .name,
.css .class,
.css .pseudo
color: $highlight-red
.tag
color: $highlight-aqua
.number,
.preprocessor,
.literal,
.params,
.constant,
.command
color: $highlight-orange
.built_in
color: $highlight-yellow
.ruby .class .title,
.css .rules .attribute,
.string,
.value,
.inheritance,
.header,
.ruby .symbol,
.xml .cdata,
.special,
.number,
.formula
color: $highlight-green
.keyword,
.title,
.css .hexcolor
color: $highlight-aqua
.function,
.python .decorator,
.python .title,
.ruby .function .title,
.ruby .title .keyword,
.perl .sub,
.javascript .title,
.coffeescript .title
color: $highlight-blue
.tag .attr,
.javascript .function
color: $highlight-purple

View File

@@ -1,10 +1,6 @@
// https://github.com/equinusocio/vsc-material-theme // https://github.com/equinusocio/vsc-material-theme
$highlight_theme = hexo-config('highlight_theme')
@require 'theme' @require 'theme'
@require 'diff'
if $highlight_theme != false
@require 'diff'
wordWrap = !hexo-config('rootConfig.highlight.line_number') && hexo-config('code_word_wrap') wordWrap = !hexo-config('rootConfig.highlight.line_number') && hexo-config('code_word_wrap')
@@ -20,6 +16,13 @@ $code-block
counter-reset: line counter-reset: line
white-space: pre-wrap white-space: pre-wrap
.code-area-wrap
position: relative
margin: 0 0 1rem
figure.highlight
position: relative
blockquote blockquote
margin: 0 0 1rem margin: 0 0 1rem
padding: .1rem .8rem padding: .1rem .8rem
@@ -68,6 +71,10 @@ blockquote
figure.highlight figure.highlight
@extend $code-block @extend $code-block
position: relative position: relative
border-radius: 1px
if hexo-config('highlight_shrink') == true
display: none
pre pre
margin: 0 margin: 0
@@ -75,6 +82,10 @@ blockquote
border: none border: none
.line .line
&::selection
background: $highlight-selection
color: $highlight-foreground
if wordWrap if wordWrap
&:before &:before
display: inline-block display: inline-block
@@ -89,8 +100,10 @@ blockquote
background-color: $highlight-selection background-color: $highlight-selection
table table
display: block position: relative
overflow: auto display: table
margin: 0
width: auto
border: none border: none
td td
@@ -100,6 +113,7 @@ blockquote
figcaption figcaption
clearfix() clearfix()
padding: .3rem 0 .1rem .7rem padding: .3rem 0 .1rem .7rem
color: $highlight-foreground
font-size: 1em font-size: 1em
line-height: 1em line-height: 1em
@@ -122,59 +136,16 @@ blockquote
padding-right: .5rem padding-right: .5rem
padding-left: .5rem padding-left: .5rem
width: 100% width: 100%
background-color: $highlight-background
.line .line
height: 1rem height: 1rem
.highlight-tools
position: relative
overflow: hidden
width: 100%
height: 1.5rem
background: $highlight-tools.bg-color
color: $highlight-tools.color
font-size: 14px
.code-expand
position: absolute
padding: .4rem .7rem
cursor: pointer
transition: all .3s
transform: rotate(0)
& + .code-lang
left: 1.7rem
&.code-closed
transition: all .3s
transform: rotate(-90deg) !important
.code-lang
position: absolute
left: .7rem
text-transform: capitalize
font-weight: bold
font-size: .8rem
line-height: 1.5rem
.copy-notice
position: absolute
top: .25rem
right: 1.7rem
opacity: 0
.copy-button
position: absolute
top: .4rem
right: .7rem
cursor: pointer
transition: color .2s
&:hover
color: $theme-color
.gutter .gutter
user-select: none user-select: none
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
.gist table .gist table
width: auto width: auto
@@ -182,43 +153,124 @@ blockquote
td td
border: none border: none
if $highlight_theme == 'mac' // For diff highlight
figure.highlight pre .deletion
margin: 0 0 1.2rem background: $highlight-deletion
border-radius: 7px
box-shadow: 0 5px 10px 0 rgba(0, 0, 0, .4)
-webkit-transform: translateZ(0)
.highlight-tools pre .addition
&:after background: $highlight-addition
position: absolute
top: .45rem
left: .7rem
width: 12px
height: 12px
border-radius: 50%
background: #fc625d
box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b
content: ' '
.code-expand pre .meta
right: 0 color: $highlight-purple
&.code-closed pre
transition: all .3s .comment
transform: rotate(90deg) !important color: $highlight-comment
& ~ .copy-notice &::selection
right: 2.8rem background: $highlight-selection
color: $highlight-foreground
& ~ .copy-button .variable,
right: 1.8rem .attribute,
.regexp,
.ruby .constant,
.xml .tag .title,
.xml .pi,
.xml .doctype,
.html .doctype,
.css .id,
.tag .name,
.css .class,
.css .pseudo
color: $highlight-red
.code-lang &::selection
left: 3.8rem !important background: $highlight-selection
color: $highlight-foreground
// when the page.highlight_shrink set to true .tag
#body-wrap.code-close color: $highlight-aqua
figure.highlight
& > :not(.highlight-tools) &::selection
display: none background: $highlight-selection
color: $highlight-foreground
.number,
.preprocessor,
.literal,
.params,
.constant,
.command
color: $highlight-orange
&::selection
background: $highlight-selection
color: $highlight-foreground
.built_in
color: $highlight-yellow
&::selection
background: $highlight-selection
color: $highlight-foreground
.ruby .class .title,
.css .rules .attribute,
.string,
.value,
.inheritance,
.header,
.ruby .symbol,
.xml .cdata,
.special,
.number,
.formula
color: $highlight-green
&::selection
background: $highlight-selection
color: $highlight-foreground
.keyword,
.title,
.css .hexcolor
color: $highlight-aqua
&::selection
background: $highlight-selection
color: $highlight-foreground
.function,
.python .decorator,
.python .title,
.ruby .function .title,
.ruby .title .keyword,
.perl .sub,
.javascript .title,
.coffeescript .title
color: $highlight-blue
&::selection
background: $highlight-selection
color: $highlight-foreground
.tag .attr,
.javascript .function
color: $highlight-purple
&::selection
background: $highlight-selection
color: $highlight-foreground
.highlight-tools
position: relative
overflow: hidden
width: 100%
height: 1.4rem
background: darken($highlight-background, 5)
color: $highlight-foreground
font-size: 14px
.highlight-close
height: 0 !important

View File

@@ -13,23 +13,17 @@ if $highlight_theme == 'default'
$highlight-aqua = #89DDFF $highlight-aqua = #89DDFF
$highlight-blue = #82AAFF $highlight-blue = #82AAFF
$highlight-purple = #C792EA $highlight-purple = #C792EA
$highlight-deletion = #BF42BF
$highlight-addition = #105EDE
$highlight-gutter = { $highlight-gutter = {
color: alpha($highlight-foreground, .5), color: #37474F,
bg-color: $highlight-background bg-color: $highlight-background
} }
$highlight-tools = {
color: alpha($highlight-foreground, .8),
bg-color: darken($highlight-background, 2)
}
if $highlight_theme == 'darker' || ($highlight_theme == 'mac') if $highlight_theme == 'darker'
$highlight-background = #212121 $highlight-background = #212121
$highlight-current-line = #282a2e $highlight-current-line = #282a2e
$highlight-selection = #61616150 $highlight-selection = #61616150
$highlight-foreground = #EEFFFF $highlight-foreground = #EEFFFF
$highlight-comment = #969896 $highlight-comment = #4A4A4A
$highlight-red = #FF5370 $highlight-red = #FF5370
$highlight-orange = #F78C6C $highlight-orange = #F78C6C
$highlight-yellow = #FFCB6B $highlight-yellow = #FFCB6B
@@ -37,16 +31,10 @@ if $highlight_theme == 'darker' || ($highlight_theme == 'mac')
$highlight-aqua = #89DDFF $highlight-aqua = #89DDFF
$highlight-blue = #82AAFF $highlight-blue = #82AAFF
$highlight-purple = #C792EA $highlight-purple = #C792EA
$highlight-deletion = #BF42BF
$highlight-addition = #105EDE
$highlight-gutter = { $highlight-gutter = {
color: alpha($highlight-foreground, .5), color: #424242,
bg-color: $highlight-background bg-color: $highlight-background
} }
$highlight-tools = {
color: alpha($highlight-foreground, .8),
bg-color: darken($highlight-background, 2)
}
if $highlight_theme == 'pale night' if $highlight_theme == 'pale night'
$highlight-background = #292D3E $highlight-background = #292D3E
@@ -61,23 +49,17 @@ if $highlight_theme == 'pale night'
$highlight-aqua = #89DDFF $highlight-aqua = #89DDFF
$highlight-blue = #82AAFF $highlight-blue = #82AAFF
$highlight-purple = #C792EA $highlight-purple = #C792EA
$highlight-deletion = #BF42BF
$highlight-addition = #105EDE
$highlight-gutter = { $highlight-gutter = {
color: alpha($highlight-foreground, .5), color: #3A3F58,
bg-color: $highlight-background bg-color: $highlight-background
} }
$highlight-tools = {
color: $highlight-foreground,
bg-color: darken($highlight-background, 2)
}
if $highlight_theme == 'ocean' if $highlight_theme == 'ocean'
$highlight-background = #0F111A $highlight-background = #0F111A
$highlight-current-line = #000000 $highlight-current-line = #000000
$highlight-selection = #717CB450 $highlight-selection = #717CB450
$highlight-foreground = #8F93A2 $highlight-foreground = #8F93A2
$highlight-comment = rgba(101, 115, 126, .8) $highlight-comment = #464B5D
$highlight-red = #FF5370 $highlight-red = #FF5370
$highlight-orange = #F78C6C $highlight-orange = #F78C6C
$highlight-yellow = #FFCB6B $highlight-yellow = #FFCB6B
@@ -85,23 +67,17 @@ if $highlight_theme == 'ocean'
$highlight-aqua = #89DDFF $highlight-aqua = #89DDFF
$highlight-blue = #82AAFF $highlight-blue = #82AAFF
$highlight-purple = #C792EA $highlight-purple = #C792EA
$highlight-deletion = #BF42BF
$highlight-addition = #105EDE
$highlight-gutter = { $highlight-gutter = {
color: alpha($highlight-foreground, .5), color: #3B3F5180,
bg-color: $highlight-background bg-color: $highlight-background
} }
$highlight-tools = {
color: $highlight-foreground,
bg-color: darken($highlight-background, 2)
}
if $highlight_theme == 'light' if $highlight_theme == 'light'
$highlight-background = #F6F8FA $highlight-background = #F6F8FA
$highlight-current-line = #00346e $highlight-current-line = #00346e
$highlight-selection = #80CBC440 $highlight-selection = #80CBC440
$highlight-foreground = #90A4AE $highlight-foreground = #90A4AE
$highlight-comment = rgba(149, 165, 166, .8) $highlight-comment = #90A4AE90
$highlight-red = #E53935 $highlight-red = #E53935
$highlight-orange = #F76D47 $highlight-orange = #F76D47
$highlight-yellow = #FFB62C $highlight-yellow = #FFB62C
@@ -109,26 +85,7 @@ if $highlight_theme == 'light'
$highlight-aqua = #39ADB5 $highlight-aqua = #39ADB5
$highlight-blue = #6182B8 $highlight-blue = #6182B8
$highlight-purple = #7C4DFF $highlight-purple = #7C4DFF
$highlight-deletion = #BF42BF
$highlight-addition = #105EDE
$highlight-gutter = { $highlight-gutter = {
color: alpha($highlight-foreground, .5), color: #CFD8DC,
bg-color: $highlight-background bg-color: $highlight-background
} }
$highlight-tools = {
color: $highlight-foreground,
bg-color: darken($highlight-background, 5)
}
if $highlight_theme == false
$highlight-background = #F6F8FA
$highlight-foreground = #90A4AE
$highlight-selection = #80CBC440
$highlight-gutter = {
color: alpha($highlight-foreground, .5),
bg-color: $highlight-background
}
$highlight-tools = {
color: $highlight-foreground,
bg-color: darken($highlight-background, 5)
}

View File

@@ -1,80 +1,44 @@
if hexo-config('error_404.enable') if hexo-config('error_404.enable')
#error-wrap #nav.error-no-found
position: absolute
top: 50%
right: 0
left: 0
margin: 0 auto
padding: 0 1rem
max-width: 1000px
transform: translate(0, -50%)
.error-content
display: flex display: flex
flex-direction: row
justify-content: center
align-items: center
margin: 0 1rem
height: 18rem
border-radius: 8px
background: #fff
box-shadow: 0 4px 8px 6px rgba(7, 17, 27, .06)
@media screen and (max-width: 768px)
flex-direction: column flex-direction: column
margin: 0 justify-content: center
height: 25rem height: 100vh
.error-img &:before
flex: 1
height: 100%
border-top-left-radius: 8px
border-bottom-left-radius: 8px
background-color: #49b1f5
background-position: center
background-size: cover
@media screen and (max-width: 768px)
flex: 1
width: 100% width: 100%
border-top-right-radius: 8px height: 100%
border-bottom-left-radius: 0 background-color: alpha($dark-black, .5)
content: ''
.error-info #error_info
flex: 1 position: absolute
padding: .5rem padding: 0 4rem
text-align: center width: 100%
font-size: 14px letter-spacing: 3px
line-height: 1
#error_title,
#error_subtitle
margin: 0
padding: 0
color: $light-grey
letter-spacing: 5px
font-family: $site-name-font font-family: $site-name-font
@media screen and (max-width: 768px) #error_title
flex: 1.1 font-size: 10rem
width: 100%
.error_title #error_subtitle
margin-top: -4rem font-size: 2rem
color: $font-color
font-size: 9em
@media screen and (max-width: 768px) @media screen and (max-width: $sm)
margin-top: -3rem #nav.error-no-found
#error_info
padding: 0 2rem
.error_subtitle #error_title
@extend .limit-more-line font-size: 7rem !important
margin-top: -3.5rem
color: $font-color
word-break: break-word
font-size: 1.6em
-webkit-line-clamp: 2
a #error_subtitle
position: relative font-size: 1rem !important
z-index: 1
display: inline-block
margin-top: .5rem
padding: .3rem 1.5rem
background: $theme-color
color: white
i
padding-right: .3rem

View File

@@ -16,13 +16,14 @@
.card-info .card-info
img img
display: inline-block
width: 110px width: 110px
height: 110px height: 110px
border-radius: 70px border-radius: 70px
transition: all .5s transition: all .3s
&:hover &:hover
transform: rotate(360deg) transform: rotate(540deg)
.author-info .author-info
&__name &__name
@@ -33,22 +34,23 @@
margin-top: -.3rem margin-top: -.3rem
.card-info-data .card-info-data
display: table
padding: .7rem 0 padding: .7rem 0
width: 100%
table-layout: fixed
& > .card-info-data-item & > .card-info-data-item
display: table-cell display: inline-block
width: 33.3%
a a
.headline .headline
@extend .limit-one-line display: block
overflow: hidden
color: $font-black color: $font-black
// text-transform: uppercase
text-overflow: ellipsis
white-space: nowrap
font-size: .7rem font-size: .7rem
.length_num .length_num
margin-top: -.3rem
color: $dark-black color: $dark-black
font-size: 1rem font-size: 1rem
@@ -71,9 +73,9 @@
position: relative position: relative
z-index: 1 z-index: 1
display: block display: block
width: 100%
background-color: $light-blue background-color: $light-blue
color: $button-color color: $button-color
text-transform: uppercase
line-height: 1.6rem line-height: 1.6rem
span span
@@ -90,8 +92,7 @@
.card-tag-cloud .card-tag-cloud
a a
display: inline-block word-break: keep-all
padding: 0 .1rem
&:hover &:hover
color: $light-blue !important color: $light-blue !important
@@ -131,11 +132,13 @@
font-size: .6rem font-size: .6rem
.aside-post_title .aside-post_title
@extend .limit-more-line display: -webkit-box
overflow: hidden
padding-left: 10px padding-left: 10px
height: 40px height: 40px
line-height: 1rem line-height: 1rem
-webkit-line-clamp: 2 -webkit-line-clamp: 2
-webkit-box-orient: vertical
&:hover &:hover
color: $light-blue !important color: $light-blue !important
@@ -144,28 +147,31 @@
.aside-post_title .aside-post_title
height: auto height: auto
.card-archives ul.card-archive-list, .card-archives ul.archive-list,
.card-categories ul.card-category-list .card-categories ul.aside-category-item
margin: 0 margin: 0
padding: .2rem 0 0 padding: .2rem 0 0
list-style: none list-style: none
.card-archives ul.card-archive-list > .card-archive-list-item, .card-archives ul.archive-list > .archive-list-item,
.card-categories ul.card-category-list > .card-category-list-item .card-categories ul.aside-category-item > .aside-category-list
a padding: .2rem 1rem
display: inline-block cursor: pointer
padding: .15rem 1rem transition: all .3s
width: 100%
color: $font-black
transition: all .4s
&:hover &:hover
padding: .15rem .85rem padding: .2rem .85rem
background-color: $light-blue background-color: $light-blue
a
color: $font-black
span span
display: inline-block display: inline-block
overflow: hidden
vertical-align: bottom vertical-align: bottom
text-overflow: ellipsis
white-space: nowrap
&:first-child &:first-child
width: 80% width: 80%
@@ -174,43 +180,10 @@
width: 20% width: 20%
text-align: right text-align: right
&.more
span
padding-right: .3rem
width: auto !important
transition: .5s
&:hover
span
padding-right: .6rem
.card-categories .card-categories
.card-category-list .aside-category-item
&.child &.child
padding: 0 0 0 1rem padding: 0 0 0 1.2rem
> .parent
.card-category-list
&-name
width: 70% !important
&-count
width: 18%
text-align: right
&-icon
float: right
margin-right: -.35rem
padding: .35rem
transition: transform .3s
transform: rotate(0)
&.expand
transform: rotate(-90deg)
if hexo-config('aside.card_categories.expand') == false
+ .child
display: none
.card-webinfo .card-webinfo
.webinfo .webinfo

View File

@@ -1,8 +0,0 @@
// chat
if hexo-config('chat_btn') == true && hexo-config('chatra.enable')
#chatra:not(.chatra--expanded)
visibility: hidden !important
width: 1px !important
height: 1px !important
opacity: 0 !important
pointer-events: none

View File

@@ -1,13 +1,12 @@
.flink#article-container .flink#article-container
.flink-desc .post-cards
margin: .2rem 0 .5rem margin: -10px 10px 0
.flink-list .md-links
overflow: auto overflow: auto
padding: 10px 10px 0
text-align: center text-align: center
& > .flink-list-item & > .md-links-item
position: relative position: relative
float: left float: left
overflow: hidden overflow: hidden
@@ -18,15 +17,9 @@
line-height: 17px line-height: 17px
transform: perspective(1px) translateZ(0) transform: perspective(1px) translateZ(0)
@media screen and (max-width: 1100px)
width: calc(50% - 15px) !important
@media screen and (max-width: 600px)
width: calc(100% - 15px) !important
&:hover &:hover
img img
transform: rotate(360deg) transform: rotate(540deg)
&:before &:before
position: absolute position: absolute
@@ -62,15 +55,31 @@
.img-alt .img-alt
display: none display: none
.flink-item-name .md-links-title
@extend .limit-one-line overflow: hidden
padding: 16px 10px 0 0 padding: 16px 10px 0 0
height: 40px height: 40px
text-overflow: ellipsis
white-space: nowrap
font-weight: bold font-weight: bold
font-size: 20px font-size: 20px
.flink-item-desc .md-links-des
@extend .limit-one-line overflow: hidden
padding: 16px 10px padding: 16px 10px
height: 50px height: 50px
text-overflow: ellipsis
white-space: nowrap
font-size: 13px font-size: 13px
@media screen and (max-width: 1100px)
.flink
.md-links
.md-links-item
width: calc(50% - 15px) !important
@media screen and (max-width: 600px)
.flink
.md-links
.md-links-item
width: calc(100% - 15px) !important

View File

@@ -9,9 +9,6 @@ figure.gallery-group
background: $dark-black background: $dark-black
-webkit-transform: translate3d(0, 0, 0) -webkit-transform: translate3d(0, 0, 0)
@media screen and (max-width: 600px)
width: calc(100% - .4rem)
&:hover &:hover
img img
opacity: .4 opacity: .4
@@ -57,7 +54,8 @@ figure.gallery-group
opacity: 0 opacity: 0
p p
@extend .limit-more-line display: -webkit-box
overflow: hidden
margin: 0 margin: 0
padding: .4rem 0 0 padding: .4rem 0 0
letter-spacing: 1px letter-spacing: 1px
@@ -67,16 +65,19 @@ figure.gallery-group
transition: opacity .35s, transform .35s transition: opacity .35s, transform .35s
transform: translate3d(100%, 0, 0) transform: translate3d(100%, 0, 0)
-webkit-line-clamp: 4 -webkit-line-clamp: 4
-webkit-box-orient: vertical
.gallery-group-name .gallery-group-name
@extend .limit-more-line
position: relative position: relative
display: -webkit-box
overflow: hidden
margin: 0 margin: 0
padding: .4rem 0 padding: .4rem 0
font-weight: bold font-weight: bold
font-size: 1.2rem font-size: 1.2rem
line-height: 1.5 line-height: 1.5
-webkit-line-clamp: 2 -webkit-line-clamp: 2
-webkit-box-orient: vertical
&:after &:after
position: absolute position: absolute
@@ -105,3 +106,7 @@ figure.gallery-group
.fancybox .fancybox
width: auto width: auto
text-align: inherit text-align: inherit
@media screen and (max-width: 600px)
figure.gallery-group
width: calc(100% - .4rem)

View File

@@ -1,8 +1,8 @@
#page-header #nav
position: relative position: relative
width: 100% width: 100%
background-color: $light-blue background-color: $light-blue
background-attachment: scroll background-attachment: local
background-position: center center background-position: center center
background-size: cover background-size: cover
background-repeat: no-repeat background-repeat: no-repeat
@@ -11,7 +11,6 @@
// index // index
&.full_page &.full_page
height: $index_top_img_height height: $index_top_img_height
background-attachment: fixed
#site-info #site-info
position: absolute position: absolute
@@ -44,7 +43,7 @@
margin: 0 .5rem margin: 0 .5rem
color: $light-grey color: $light-grey
text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15) text-shadow: .1rem .1rem .2rem rgba(0, 0, 0, .15)
font-size: 1rem font-size: .9rem
cursor: pointer cursor: pointer
#scroll_down #scroll_down
@@ -95,9 +94,11 @@
font-size: 1.5rem font-size: 1.5rem
.posttitle .posttitle
@extend .limit-more-line display: -webkit-box
overflow: hidden
line-height: 1.5 line-height: 1.5
-webkit-line-clamp: 3 -webkit-line-clamp: 3
-webkit-box-orient: vertical
#post-meta #post-meta
font-size: 95% font-size: 95%
@@ -126,17 +127,10 @@
color: $light-blue color: $light-blue
text-decoration: underline text-decoration: underline
// css hack #page-header
// all browser in ios and safari in all apple device
_::-webkit-full-page-media,
_:future,
:root #page-header.full_page
background-attachment: scroll !important
#nav
position: absolute position: absolute
top: 0 top: 0
z-index: 90 z-index: 99
padding: 10px 36px padding: 10px 36px
width: 100% width: 100%
height: 58px height: 58px
@@ -170,7 +164,7 @@ _:future,
&.fixed &.fixed
position: fixed position: fixed
top: -60px top: -60px
z-index: 91 z-index: 101
background: alpha($white, .8) background: alpha($white, .8)
box-shadow: 0 5px 6px -5px alpha($grey, .6) box-shadow: 0 5px 6px -5px alpha($grey, .6)
transition: transform .2s ease-in-out, opacity .2s ease-in-out transition: transform .2s ease-in-out, opacity .2s ease-in-out
@@ -252,15 +246,14 @@ _:future,
content: '' content: ''
li li
padding: 1px 10px
list-style: none list-style: none
text-align: center
&:hover &:hover
background: $theme-color background: $theme-color
a a
display: inline-block
padding: .3rem .7rem
width: 100%
color: $font-black color: $font-black
text-shadow: none text-shadow: none
@@ -276,7 +269,7 @@ _:future,
cursor: pointer cursor: pointer
@media screen and (min-width: $sm) @media screen and (min-width: $sm)
#page-header #nav
#site_title #site_title
font-size: 2rem font-size: 2rem
@@ -284,10 +277,10 @@ _:future,
font-size: 1.2rem font-size: 1.2rem
@media screen and (max-width: $sm) @media screen and (max-width: $sm)
#nav #page-header
padding: 10px .8rem padding: 10px .8rem
#page-header #nav
#site_social_icons #site_social_icons
display: block display: block
@@ -319,8 +312,3 @@ _:future,
.post-meta-pv-cv .post-meta-pv-cv
.post-meta__separator:first-child .post-meta__separator:first-child
display: none display: none
if !hexo-config('busuanzi.page_pv')
.post-meta-commentcount
.post-meta__separator
display: none

View File

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

View File

@@ -1,10 +1,12 @@
#mobile-sidebar #mobile-sidebar
#menu_mask #menu_mask
position: fixed position: fixed
top: 0
right: 0
bottom: 0
left: 0
z-index: 102 z-index: 102
display: none display: none
width: 100%
height: 100%
background: alpha($dark-black, .8) background: alpha($dark-black, .8)
#mobile-sidebar-menus #mobile-sidebar-menus
@@ -12,7 +14,9 @@
top: 0 top: 0
right: -250px right: -250px
z-index: 103 z-index: 103
overflow: hidden scroll display: block
overflow: hidden
overflow-y: scroll
width: 250px width: 250px
height: 100% height: 100%
background: #f6f8fa background: #f6f8fa
@@ -23,26 +27,25 @@
text-align: center text-align: center
img img
display: inline-block
padding: 0
width: 110px width: 110px
height: 110px height: 110px
border-radius: 70px border-radius: 70px
transition: all .5s transition: all .3s
&:hover
transform: rotate(360deg)
.mobile_post_data .mobile_post_data
display: table
padding: .6rem .5rem 0 padding: .6rem .5rem 0
width: 100%
table-layout: fixed
.mobile_data_item .mobile_data_item
display: table-cell display: inline-block
width: 33.3%
.mobile_data_link .mobile_data_link
& > a > div & > a > div
@extend .limit-one-line overflow: hidden
text-overflow: ellipsis
white-space: nowrap
.length_num .length_num
color: $dark-black color: $dark-black
@@ -51,24 +54,31 @@
.headline .headline
display: block display: block
color: $font-black color: $font-black
// text-transform: uppercase
font-size: .7rem font-size: .7rem
hr hr
margin: 1rem auto margin: 1rem auto
.menus_items .menus_items
padding: 0 .5rem 2rem margin-bottom: 5rem
padding: 0 .5rem
.site-page .site-page
@extend .limit-one-line
position: relative position: relative
z-index: 0
display: block display: block
overflow: hidden
margin: 0
padding: .3rem 1.5rem padding: .3rem 1.5rem
color: $font-black color: $font-black
text-overflow: ellipsis
text-shadow: none
white-space: nowrap
font-size: .8rem font-size: .8rem
cursor: pointer cursor: pointer
i:first-child i
width: 30% width: 30%
text-align: left text-align: left
@@ -81,12 +91,15 @@
.menus-expand .menus-expand
position: absolute position: absolute
right: 0 right: 0
padding: .4rem padding: 6px
width: 30px !important
height: 30px
transition: all .3s transition: all .3s
transform: rotate(0) transform: rotate(0)
&.menus-closed &.menus-closed
transform: rotate(90deg) !important transition: all .3s
transform: rotate(180deg) !important
.menus_item_child .menus_item_child
margin: 0 margin: 0

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