Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
store-dir=/home/ubuntu/.pnpm-store
94 changes: 70 additions & 24 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ qihu360_site_verification:
# see http://zhanzhang.sogou.com/
sougou_site_verification:

# ---------------------------------------------------------------
# HTML head config
# ---------------------------------------------------------------
# use <link rel="preload"> to preload important resources
preload:
enable: false
item:
# whether preload index.css
css: true
# some source you want to preload: file || type
# type: audio, document, embed, font, image, style, script, video...
# eg: /img/a.jpg || image
# document: https://developer.mozilla.org/zh-CN/docs/Web/HTML/Preloading_content
customize:

# ---------------------------------------------------------------
# Menu config
# ---------------------------------------------------------------
Expand Down Expand Up @@ -252,6 +267,26 @@ creative_commons:
# If not set, `en` will be used by default.
language:

# ---------------------------------------------------------------
# RightSide config
# ---------------------------------------------------------------

rightside:
# (Please use "" to wrap the value)
color: "#49b1f5"
# Color when the mouse hovers it (Please use "" to wrap the value)
hover_color: "#fc6423"

# Go to comments
go2comments:
enable: true
icon:
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: far fa-comment-dots
# Notification text
title: 直达评论


# Back to top
back2top:
enable: true
Expand All @@ -260,10 +295,6 @@ back2top:
name: fas fa-rocket
# Rotation Angle of icon.
rotate: -45deg
# (Please use "" to wrap the value)
color: "#49b1f5"
# Color when the mouse hovers it (Please use "" to wrap the value)
hover_color: "#fc6423"

# ---------------------------------------------------------------
# Sidebar config
Expand Down Expand Up @@ -486,20 +517,33 @@ gitalk:
# See: https://waline.js.org/
waline:
enable: false
# The URL of your server.
serverURL:
# Comment box placeholder.
placeholder: Just go go
# Gravatar style.
avatar: mp
# serverURL
serverURL:
# dark mode https://waline.js.org/reference/client.html#dark
dark:
# word count limit number | [number, number]
wordLimit: 0
# Custom comment header.
meta: nick,mail,link
# The number of comments per page.
# the number of comments of each page
pageSize: 10
# Optional values: en | zh-CN | zh-TW | jp
# Optional values: en | zh-cn | zh-TW | jp
lang: zh-CN,zh-TW,en
# Article reading statistics.
visitor: false
# visitor statistics
pageview: true
# info required [] | ['nick'] | ['nick', 'mail']
requiredMeta: []
# locale
locale:
admin:
# Comment box placeholder.
placeholder: Just go go
# emoji
emoji:
- https://cdn.jsdelivr.net/gh/walinejs/[email protected]/bilibili
- https://cdn.jsdelivr.net/gh/walinejs/[email protected]/qq
# reaction
reaction: false

# Valine
# See: https://valine.js.org/quickstart.html
Expand Down Expand Up @@ -715,12 +759,12 @@ math:
enable: false
mhchem_js: https://cdn.jsdelivr.net/npm/[email protected]/mhchem.min.js
katex:
cdn: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css
cdn: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/katex.min.css
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex:
enable: true
copy_tex_js: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.min.js
copy_tex_css: https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/copy-tex.css
copy_tex_js: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/contrib/copy-tex.min.js
copy_tex_css: https://cdn.jsdelivr.net/npm/katex@0.15.3/dist/contrib/copy-tex.css

# ---------------------------------------------------------------
# Other config
Expand Down Expand Up @@ -896,19 +940,19 @@ icon:
# ! Do not edit the follow configs, unless you know what you are doing.
# ! -------------------------------------------------------------------
cdn:
# Using version: 5.12.1
# Using version: 5.15.3
# See: https://fontawesome.com/
# Example:
# fontawesome: //cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css
# fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css
fontawesome:

# Using version: 3.4.1
# Using version: 3.6.0
# Example:
# jquery: //cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js
# jquery: //cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
# jquery: //cdn.jsdelivr.net/npm/jquery@v3.6.0/dist/jquery.min.js
# jquery: //cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
jquery:

# Using version: 1.5.2
Expand Down Expand Up @@ -944,8 +988,10 @@ cdn:
# Waline
# See: https://github.com/lizheming/waline
# Example:
# waline: //unpkg.com/@waline/[email protected]/dist/Waline.min.js
waline:
# waline_js: //cdn.jsdelivr.net/npm/@waline/client/dist/waline.js
# waline_css: //cdn.jsdelivr.net/npm/@waline/client/dist/waline.css
waline_js:
waline_css:

# minivaline
# See: https://github.com/MiniValine/MiniValine
Expand Down
19 changes: 15 additions & 4 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,21 @@ nav:
# 导航栏菜单
menu:
home: 首页
article: 文章
archives: 归档
categories: 分类
tags: 标签
about: 关于
About: 关于
site: 本站
friends: 友人
friendlink: 友链
friendcircle: 友圈
lab: 实验室
run: 跑步
statistics: 统计
other: 其他
boundfor: 开往
goto: 虫洞

# 归档页、分类页、标签页
page:
Expand Down Expand Up @@ -43,9 +54,9 @@ social:
segmentfault: 思否
zhihu: 知乎
weibo: 微博
wechat: 微信
telegram: Telegram
qq: QQ
Bilibili: BiliBili
Email: 邮箱


# 文章
post:
Expand Down
10 changes: 9 additions & 1 deletion languages/zh-HK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ nav:
# 巡覽列選單
menu:
home: 首頁
article: 文章
archives: 歸檔
categories: 分類
tags: 標籤
about: 關於
About: 關於
Author: 作者
bb: 哔哔
gallery: 相册
reward: 打赏
friends: 友链
lab: 實驗室
boundfor: 開往

# 歸檔頁、分類頁、標籤頁
page:
Expand Down
7 changes: 5 additions & 2 deletions layout/_layout.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-
var SW_URL = '/sw_init.js';
var HEXO_URL = 'http://hexo.io/';
var STUN_URL = 'https://github.com/liuyib/hexo-theme-stun/';
var isNoHeader = !theme.header.enable || (is_post() && !theme.header.show_on.post);
Expand All @@ -22,6 +23,8 @@
}
var ccUrl = `https://creativecommons.org/licenses/${ccLicense}/4.0/deed.${ccLanguage}`;

script(src=SW_URL)

doctype html
html(lang=config.language)
head
Expand Down Expand Up @@ -59,8 +62,8 @@ html(lang=config.language)

include ./_partials/widgets/loading-bar.pug

if theme.back2top.enable
include ./_partials/widgets/back2top.pug
include ./_partials/widgets/rightside.pug

include ./_partials/search/index.pug

include ./_scripts/vendors.pug
Expand Down
7 changes: 4 additions & 3 deletions layout/_mixins/post-header.pug
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ mixin postHeader(post)
valueText: `${min2read(post.content, { cn: postRead.speed.zh, en: postRead.speed.en })}${__('post.reading_unit')}`
})

if theme.waline.enable && theme.waline.visitor
span(id=url_for(post.path) data-flag-title=post.title).post-meta-item.post-meta-item--visitors.leancloud_visitors
if theme.waline.enable && theme.waline.pageview
span(data-flag-title=post.title).post-meta-item.post-meta-item--visitors
- var iconClass = theme.icon.waline_visitor;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
Expand All @@ -77,7 +77,8 @@ mixin postHeader(post)
popoverPos: 'up',
popoverText: __('popover.post.visit_num'),
valueAttr: {
class: 'leancloud-visitors-count'
class: 'waline-pageview-count',
"data-path": url_for(post.path)
}
})

Expand Down
11 changes: 11 additions & 0 deletions layout/_partials/head/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ meta(name="format-detection" content="telephone=no")
meta(name="apple-mobile-web-app-capable" content="yes")
meta(name="apple-mobile-web-app-status-bar-style" content="black")

if theme.preload.enable
if theme.preload.item.css
link(rel="preload" href=`${url_for(theme.css)}/index.css?v=${stun_env('version')}` as="style")
if theme.preload.item.customize
- var files = theme.preload.item.customize
- for(k=0; k<files.length; k++) {
- file = files[k].split(' || ');
link(rel="preload", href=`${file[0]}` as=`${file[1]}`)
- }


if theme.pwa.enable
if theme.pwa.theme_color
meta(name="theme-color" content=theme.pwa.theme_color)
Expand Down
5 changes: 1 addition & 4 deletions layout/_partials/sidebar/sidebar.pug
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
-
var isShowToc = page.toc === true;

if (typeof page.toc !== 'boolean') {
isShowToc = theme.toc.enable && is_post();
}

if isShowToc
div.sidebar-nav
span.sidebar-nav-toc.current= __('sidebar.catalog')
Expand Down Expand Up @@ -40,7 +38,6 @@ section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
var socialIcon = (item[1] + '').trim();
var isSocialIconOnly = theme.social_setting.icon_only;
var elemAttr = {};

if (isSocialIconOnly) {
elemAttr['data-popover'] = __(`social.${name}`);
elemAttr['data-popover-pos'] = 'up';
Expand Down Expand Up @@ -121,4 +118,4 @@ if theme.reading_progress.enable && is_post()
span.sidebar-reading-info__text= __('sidebar.read_info') + ' '
span.sidebar-reading-info__num= '0'
span.sidebar-reading-info__perc= '%'
div.sidebar-reading-line
div.sidebar-reading-line
3 changes: 0 additions & 3 deletions layout/_partials/widgets/back2top.pug

This file was deleted.

10 changes: 10 additions & 0 deletions layout/_partials/widgets/rightside.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
div#rightside.rightside
if theme.back2top.enable
div#back2top
span.rightside__icon
i(class=theme.back2top.icon.name)
if is_post() && theme.go2comments.enable
div#go2comments.rightside--show
span.rightside__icon(style="transform: rotate(0deg);")
a(href="#comments", title=theme.go2comments.icon.title)
i(class=theme.go2comments.icon.name)
2 changes: 1 addition & 1 deletion layout/_third-party/comments/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if page.comments || theme.pjax.enable
include ./livere.pug
else if theme.fbcomments.enable
include ./fbcomments.pug
else if theme.waline.enable && theme.waline.visitor
else if theme.waline.enable && theme.waline.pageview
include ./waline.pug
else if theme.valine.enable && theme.valine.visitor
include ./valine.pug
Loading