mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 18:40:53 +08:00
Compare commits
7 Commits
@@ -12,10 +12,10 @@
|
||||
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
如果想要安装比较新的dev分支,可以
|
||||
如果想要安裝比較新的dev分支,可以
|
||||
|
||||
```
|
||||
git clone -b div https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly
|
||||
```
|
||||
|
||||
## 应用主题
|
||||
@@ -29,8 +29,7 @@ theme: Butterfly
|
||||
|
||||
## 文档
|
||||
|
||||
可查看[这里](https://jerryc.me/posts/21cfbf15)
|
||||
|
||||
可查看或[这里](https://docs.jerryc.me/)或[这里](https://jerryc.me/posts/21cfbf15)
|
||||
|
||||
|
||||
## 截图
|
||||
|
||||
37
_config.yml
37
_config.yml
@@ -121,7 +121,6 @@ cdn:
|
||||
css:
|
||||
fontawesome: https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css
|
||||
# fontawesomeV5: https://use.fontawesome.com/releases/v5.8.1/css/all.css
|
||||
googlefont: https://fonts.googleapis.com/css?family=Titillium+Web
|
||||
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css
|
||||
js:
|
||||
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
|
||||
@@ -241,7 +240,7 @@ valine:
|
||||
verify: false # valine verify code (true/false)
|
||||
pageSize: 10 # comment list page size
|
||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||
lang: en # i18n: zh-cn/en/tw
|
||||
lang: en # i18n: zh-cn/en
|
||||
placeholder: Please leave your footprints # valine comment input placeholder(like: Please leave your footprints )
|
||||
guest_info: nick,mail,link #valine comment header inf
|
||||
|
||||
@@ -276,10 +275,6 @@ google_site_verification:
|
||||
# See: https://www.bing.com/webmaster/
|
||||
bing_site_verification:
|
||||
|
||||
# Yandex Webmaster tools verification setting
|
||||
# See: https://webmaster.yandex.ru/
|
||||
#yandex_site_verification:
|
||||
|
||||
# Baidu Webmaster tools verification setting
|
||||
# See: https://ziyuan.baidu.com/site/
|
||||
baidu_site_verification:
|
||||
@@ -333,7 +328,7 @@ related_post:
|
||||
# canvas_ribbon
|
||||
# See: https://github.com/hustcc/ribbon.js
|
||||
canvas_ribbon:
|
||||
enable: false
|
||||
enable: true
|
||||
size: 150
|
||||
alpha: 0.6
|
||||
zIndex: -1
|
||||
@@ -341,7 +336,7 @@ canvas_ribbon:
|
||||
|
||||
|
||||
canvas_ribbon_piao:
|
||||
enable: true
|
||||
enable: false
|
||||
|
||||
|
||||
# 避免重複網址分散seo
|
||||
@@ -357,11 +352,26 @@ Open_Graph_meta: true
|
||||
readmode:
|
||||
enable: true
|
||||
|
||||
#全局字體
|
||||
font:
|
||||
enable: false
|
||||
font-family: Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB,"Microsoft JhengHei", "MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
code-font: consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
|
||||
#網站名字字體
|
||||
#左上角網站名字 主頁居中網站名字
|
||||
blog_title_font:
|
||||
#字體鏈接
|
||||
font_link: https://fonts.googleapis.com/css?family=Titillium+Web
|
||||
font-family: Titillium Web, PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
|
||||
#水平分隔綫
|
||||
hr:
|
||||
enable: false
|
||||
#fontawesome上圖標的Unicode
|
||||
icon: '\f21c'
|
||||
icon-top: -20px
|
||||
|
||||
# 主頁subtitle
|
||||
subtitle:
|
||||
enable: true
|
||||
@@ -383,13 +393,13 @@ aside:
|
||||
translate:
|
||||
enable: true
|
||||
# 默認按鈕顯示文字
|
||||
default: 簡
|
||||
default: 繁
|
||||
#网站默认语言,1: 繁體中文, 2: 简体中文
|
||||
defaultEncoding: 1
|
||||
defaultEncoding: 2
|
||||
#延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
|
||||
translateDelay: 0
|
||||
#博客网址
|
||||
cookieDomain: "https://jerryc.me/"
|
||||
cookieDomain: "https://xxx/"
|
||||
#當文字是簡體時,按鈕顯示的文字
|
||||
msgToTraditionalChinese: "繁"
|
||||
#當文字是繁體時,按鈕顯示的文字
|
||||
@@ -403,3 +413,8 @@ fireworks:
|
||||
#百度推送
|
||||
baidu_push:
|
||||
enable: false
|
||||
|
||||
#https://instant.page/
|
||||
#prefetch預加載
|
||||
instantpage:
|
||||
enable: true
|
||||
@@ -19,6 +19,7 @@ page:
|
||||
|
||||
sticky: Sticky
|
||||
no_title: No title
|
||||
archives: Archives
|
||||
read_more: Read more
|
||||
|
||||
post:
|
||||
@@ -50,7 +51,6 @@ pagination:
|
||||
next: Next Post
|
||||
|
||||
comment: Comment
|
||||
relatedPosts_headline: Recommend
|
||||
|
||||
aside:
|
||||
articles: Articles
|
||||
|
||||
@@ -19,6 +19,7 @@ page:
|
||||
|
||||
sticky: Sticky
|
||||
no_title: No title
|
||||
archives: Archives
|
||||
read_more: Read more
|
||||
|
||||
post:
|
||||
@@ -50,7 +51,6 @@ pagination:
|
||||
next: Next Post
|
||||
|
||||
comment: Comment
|
||||
relatedPosts_headline: Recommend
|
||||
|
||||
aside:
|
||||
articles: Articles
|
||||
|
||||
@@ -19,6 +19,7 @@ page:
|
||||
|
||||
sticky: 置顶
|
||||
no_title: 无题
|
||||
archives: 时间轴
|
||||
read_more: 阅读更多
|
||||
|
||||
post:
|
||||
@@ -51,7 +52,6 @@ pagination:
|
||||
next: 下一篇
|
||||
|
||||
comment: 评论
|
||||
relatedPosts_headline: 相关推荐
|
||||
|
||||
aside:
|
||||
articles: 文章
|
||||
|
||||
@@ -21,14 +21,11 @@ sticky: 置頂
|
||||
no_title: 無題
|
||||
archives: 時間軸
|
||||
read_more: 閲讀更多
|
||||
created_date: 發表於
|
||||
update_date: 更新於
|
||||
|
||||
post:
|
||||
created: 發表於
|
||||
updated: 更新於
|
||||
wordcount: 字數總計
|
||||
commentcount: 評論數
|
||||
min2read: "閲讀時長: %s 分鐘"
|
||||
page_pv: 閲讀量
|
||||
copyright:
|
||||
@@ -56,7 +53,6 @@ pagination:
|
||||
next: 下一篇
|
||||
|
||||
comment: 評論
|
||||
relatedPosts_headline: 相關推薦
|
||||
|
||||
aside:
|
||||
articles: 文章
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
each item in i.link_list
|
||||
li.md-links-item
|
||||
a(href=item.link title=item.name target="_blank")
|
||||
img.lozad(data-src=item.avatar alt=item.name onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||
img.lozad(data-src=item.avatar onerror=`onerror=null;src='${theme.lodding_bg.flink}'` height="72px")
|
||||
div(class="md-links-title")= item.name
|
||||
<br/>
|
||||
div(class="md-links-des")=item.descr
|
||||
|
||||
@@ -88,4 +88,5 @@ if is_home()
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js")
|
||||
|
||||
if theme.instantpage.enable
|
||||
script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module")
|
||||
|
||||
@@ -1,132 +1,21 @@
|
||||
if theme.aside.card_author
|
||||
.card_widget.card-author
|
||||
.card-content
|
||||
.post_data
|
||||
.data-item.text-center
|
||||
img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
p.author-info__name.text-center= config.author
|
||||
p.author-info__description.text-center= config.description
|
||||
|
||||
.post_data.data_config
|
||||
if site.posts.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
p.headline= _p('aside.articles')
|
||||
p.length_num= site.posts.length
|
||||
|
||||
if site.tags.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
p.headline= _p('aside.tags')
|
||||
p.length_num= site.tags.length
|
||||
|
||||
if site.categories.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
p.headline= _p('aside.categories')
|
||||
p.length_num= site.categories.length
|
||||
|
||||
.post_data.text-center
|
||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
||||
|
||||
|
||||
|
||||
if(theme.social)
|
||||
.post_data.data_config
|
||||
#aside-social-icons
|
||||
each url, icon in theme.social
|
||||
a.social-icon.data-item(href=url target="_blank")
|
||||
i(class=icon)
|
||||
include widget/card_author.pug
|
||||
|
||||
if theme.aside.card_announcement
|
||||
.card_widget.card-announcement
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content= theme.announcement.content
|
||||
include widget/card_announcement.pug
|
||||
|
||||
if theme.aside.card_recent_post
|
||||
.card_widget.card-recent-post
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside_recent_item
|
||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||
.aside_recent_post
|
||||
- var link = article.link || article.path
|
||||
a(href=url_for(link))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = theme.default_cover
|
||||
.aside_post_cover
|
||||
if (post_cover)
|
||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
else
|
||||
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
div#aside_title
|
||||
.aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
if (theme.post_meta.date_type)
|
||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
||||
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
||||
|
||||
- })
|
||||
include widget/card_recent_post.pug
|
||||
|
||||
if theme.aside.card_categories
|
||||
.card_widget.card-categories
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
span= _p('aside.card_categories')
|
||||
ul.aside_category_item
|
||||
- site.categories.sort('name').each(function(category){
|
||||
li.aside_category_list
|
||||
a.aside_category_list_link(href='/' + `${category.path}`)
|
||||
span.aside_category_list_name= category.name
|
||||
span.aside_category_list_length= category.length
|
||||
- })
|
||||
include widget/card_categories.pug
|
||||
|
||||
if theme.aside.card_tags
|
||||
.card_widget.card-tags
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-tags(aria-hidden="true")
|
||||
span= _p('aside.card_tags')
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
||||
include widget/card_tags.pug
|
||||
|
||||
if theme.aside.card_archives
|
||||
.card_widget.card-archives
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
span= _p('aside.card_archives')
|
||||
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
include widget/card_archives.pug
|
||||
|
||||
if theme.aside.card_webinfo
|
||||
.card_widget.card-webinfo
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-line-chart(aria-hidden="true")
|
||||
span= _p('aside.card_webinfo.headline')
|
||||
.webinfo
|
||||
.webinfo_item
|
||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
||||
.webinfo_article_count= site.posts.length
|
||||
if theme.runtimeshow.enable
|
||||
.webinfo_item
|
||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo_runtime_count.webinfo_runtime_count
|
||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
||||
|
||||
if theme.busuanzi.site_uv
|
||||
.webinfo_item
|
||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||
if theme.busuanzi.site_pv
|
||||
.webinfo_item
|
||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||
include widget/card_webinfo.pug
|
||||
|
||||
@@ -11,5 +11,3 @@ if theme.disqus.enable
|
||||
s.src = "https://" + '!{theme.disqus.shortname}' +".disqus.com/embed.js";
|
||||
s.setAttribute('data-timestamp', '' + +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
if theme.disqus.count
|
||||
script#dsq-count-scr(src="https://" + theme.disqus.shortname + ".disqus.com/count.js" async)
|
||||
@@ -1,13 +1,13 @@
|
||||
if theme.gitment && theme.gitment.enable
|
||||
#gitment-container
|
||||
if theme.gitalk && theme.gitalk.enable
|
||||
#gitalk-container
|
||||
script.
|
||||
var gitment = new Gitment({
|
||||
var gitalk = new Gitalk({
|
||||
clientID: '!{theme.gitalk.client_id}',
|
||||
clientSecret: '!{theme.gitalk.client_secret}',
|
||||
repo: '!{theme.gitalk.repo}',
|
||||
owner: '!{theme.gitalk.owner}',
|
||||
admin: '!{theme.gitalk.admin}',
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
owner: '!{theme.gitment.owner}',
|
||||
repo: '!{theme.gitment.repo}',
|
||||
oauth: {
|
||||
client_id: '!{theme.gitment.client_id}',
|
||||
client_secret: '!{theme.gitment.client_secret}'
|
||||
}
|
||||
language: '!{lang}'
|
||||
})
|
||||
gitment.render('gitment-container')
|
||||
gitalk.render('gitalk-container')
|
||||
@@ -2,6 +2,7 @@ if theme.gitment && theme.gitment.enable
|
||||
#gitment-container
|
||||
script.
|
||||
var gitment = new Gitment({
|
||||
id: md5(decodeURI(location.pathname)),
|
||||
owner: '!{theme.gitment.owner}',
|
||||
repo: '!{theme.gitment.repo}',
|
||||
oauth: {
|
||||
|
||||
@@ -3,7 +3,6 @@ if theme.disqus.enable
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
=" "
|
||||
span= _p('comment')
|
||||
include ./disqus.pug
|
||||
else if theme.laibili && theme.laibili.enable
|
||||
@@ -11,7 +10,6 @@ else if theme.laibili && theme.laibili.enable
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
=" "
|
||||
span= _p('comment')
|
||||
include ./laibili.pug
|
||||
else if theme.gitment && theme.gitment.enable
|
||||
@@ -19,7 +17,6 @@ else if theme.gitment && theme.gitment.enable
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
=" "
|
||||
span= _p('comment')
|
||||
include ./gitment.pug
|
||||
else if theme.gitalk && theme.gitalk.enable
|
||||
@@ -27,7 +24,6 @@ else if theme.gitalk && theme.gitalk.enable
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
=" "
|
||||
span= _p('comment')
|
||||
include ./gitalk.pug
|
||||
else if theme.valine && theme.valine.enable
|
||||
@@ -35,6 +31,5 @@ else if theme.valine && theme.valine.enable
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
=" "
|
||||
span= _p('comment')
|
||||
include ./valine.pug
|
||||
@@ -1,6 +1,5 @@
|
||||
if theme.valine && theme.valine.enable
|
||||
#vcomment.vcomment
|
||||
script(src='https://cdn1.lncld.net/static/js/3.0.4/av-min.js')
|
||||
script(src='https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js')
|
||||
script.
|
||||
var notify = '#{ theme.valine.notify }' == true ? true : false;
|
||||
@@ -11,50 +10,7 @@ if theme.valine && theme.valine.enable
|
||||
});
|
||||
guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;
|
||||
|
||||
var localeName = 'tw',
|
||||
localeMode = {
|
||||
head: {
|
||||
nick: '暱稱(必填)',
|
||||
mail: '郵箱(必填,可以收到回復提醒)',
|
||||
link: '網址(選填)',
|
||||
},
|
||||
tips: {
|
||||
comments: '評論',
|
||||
sofa: '快來做第一個評論的人吧~',
|
||||
busy: '還在提交中,請稍候...',
|
||||
again: '這麼簡單也能錯,也是沒誰了.'
|
||||
},
|
||||
ctrl: {
|
||||
reply: '回覆',
|
||||
ok: '好的',
|
||||
sure: '確認',
|
||||
cancel: '取消',
|
||||
confirm: '確認',
|
||||
continue: '繼續',
|
||||
more: '查看更多...',
|
||||
try: '再試試?',
|
||||
preview: '預覽',
|
||||
emoji: '表情'
|
||||
},
|
||||
error: {
|
||||
99: '初始化失敗,請檢查init中的`el`元素.',
|
||||
100: '初始化失敗,請檢查你的AppId和AppKey.',
|
||||
401: '未經授權的操作,請檢查你的AppId和AppKey.',
|
||||
403: '訪問被api域名白名單拒絕,請檢查你的安全域名設置.',
|
||||
},
|
||||
timeago: {
|
||||
seconds: '秒前',
|
||||
minutes: '分鐘前',
|
||||
hours: '小時前',
|
||||
days: '天前',
|
||||
now: '剛剛'
|
||||
}
|
||||
};
|
||||
|
||||
window.valine = new Valine();
|
||||
valine.installLocale(localeName,localeMode);
|
||||
|
||||
valine.init({
|
||||
window.valine = new Valine({
|
||||
el:'#vcomment',
|
||||
notify:notify,
|
||||
verify:verify,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
- var without_index = url.replace('index.html', '')
|
||||
- var without_html = without_index.replace('.html', '')
|
||||
- var photo_check = page.cover || theme.avatar
|
||||
- var photo_link = url_check (photo_check) ? photo_check : config.url + photo_check
|
||||
|
||||
meta(http-equiv="x-dns-prefetch-control" content="on")
|
||||
if theme.canonical
|
||||
@@ -9,7 +11,7 @@ if theme.twitter_meta
|
||||
meta(name="twitter:card" content="summary_large_image")
|
||||
meta(name="twitter:title" content=pageTitle_no_include_blog_name)
|
||||
meta(name="twitter:description" content=pageDescription)
|
||||
meta(name="twitter:image" content= page.cover|| theme.avatar)
|
||||
meta(name="twitter:image" content=photo_link)
|
||||
|
||||
if theme.Open_Graph_meta
|
||||
if is_post()
|
||||
@@ -21,7 +23,7 @@ if theme.Open_Graph_meta
|
||||
meta(property="og:url" content=without_html)
|
||||
meta(property="og:site_name" content=config.title)
|
||||
meta(property="og:description" content=pageDescription)
|
||||
meta(property="og:image" content= page.cover|| theme.avatar)
|
||||
meta(property="og:image" content=photo_link)
|
||||
|
||||
if theme.disable_baidu_transformation
|
||||
meta(http-equiv="Cache-Control" content="no-transform")
|
||||
@@ -108,6 +110,9 @@ if theme.qihu_site_verification
|
||||
- var preload_img = page.top_img || theme.top_img || config.top_img
|
||||
|
||||
if (is_archive() && preload_archive_img)
|
||||
link(rel="preload" href=preload_img as="image" )
|
||||
link(rel="preload" href=url_for(preload_archive_img) as="image" )
|
||||
else if (!is_post() && preload_img)
|
||||
link(rel="preload" href=preload_img as="image" )
|
||||
link(rel="preload" href=url_for(preload_img) as="image" )
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||
@@ -8,6 +8,11 @@
|
||||
.menu-icon-third
|
||||
|
||||
span.pull-right.menus
|
||||
.mobile_author_icon
|
||||
img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
.mobile_author-info__description= config.description
|
||||
hr
|
||||
.menus_item
|
||||
each value, label in theme.menu
|
||||
a.site-page(href=value.split('||')[0])
|
||||
i.fa-fw(class=value.split('||')[1])
|
||||
|
||||
@@ -7,12 +7,15 @@
|
||||
- if (is_year()) pageTitle += ': ' + page.year
|
||||
- var pageTitle_saved //- 暫時存儲pageTitle
|
||||
- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
|
||||
- var home_subtitle_true //有subtitle
|
||||
//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
|
||||
- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
|
||||
//- 暫時存儲pageTitle
|
||||
- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
|
||||
//- 是否有 config.subtitle 是各自显示
|
||||
- config.subtitle ? home_subtitle_true = ' - ' + config.subtitle : home_subtitle_true = ''
|
||||
//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
|
||||
- is_home() ? pageTitle = config.title + ' - ' + config.subtitle : pageTitle = pageTitle_saved
|
||||
- is_home() ? pageTitle = config.title + home_subtitle_true : pageTitle = pageTitle_saved
|
||||
|
||||
- var pageDescription = page.description || page.title || config.description || ''
|
||||
- var pageKeywords = (config.keywords || []).join(',')
|
||||
|
||||
@@ -14,21 +14,19 @@ else
|
||||
if(page.prev)
|
||||
if(page.next)
|
||||
.prev-post.pull-left
|
||||
- var pagination_cover = page.prev.cover || theme.default_cover
|
||||
- var pagination_cover = page.prev.cover || random_cover()
|
||||
a(href=url_for(page.prev.path))
|
||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` )
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info
|
||||
//- i.fa.fa-chevron-left
|
||||
span=page.prev.title
|
||||
else
|
||||
.prev-post.pull-full
|
||||
- var pagination_cover = page.prev.cover || theme.default_cover
|
||||
- var pagination_cover = page.prev.cover || random_cover()
|
||||
a(href=url_for(page.prev.path))
|
||||
img.prev_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info
|
||||
//- i.fa.fa-chevron-left
|
||||
span=page.prev.title
|
||||
|
||||
|
||||
@@ -36,21 +34,18 @@ else
|
||||
if(page.next)
|
||||
if(page.prev)
|
||||
.next-post.pull-right
|
||||
- var pagination_cover = page.next.cover || theme.default_cover
|
||||
- var pagination_cover = page.next.cover || random_cover()
|
||||
a(href=url_for(page.next.path))
|
||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.label=_p('pagination.next')
|
||||
.next_info
|
||||
span=page.next.title
|
||||
//- i.fa.fa-chevron-right
|
||||
else
|
||||
.next-post.pull-full
|
||||
- var pagination_cover = page.next.cover || theme.default_cover
|
||||
- var pagination_cover = page.next.cover || random_cover()
|
||||
a(href=url_for(page.next.path))
|
||||
img.next_cover.lozad(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
.label=_p('pagination.next')
|
||||
.next_info
|
||||
span=page.next.title
|
||||
//- i.fa.fa-chevron-right
|
||||
|
||||
|
||||
|
||||
@@ -3,22 +3,22 @@ each article , index in page.posts.data
|
||||
- var link = article.link || article.path
|
||||
if index%2 == 0
|
||||
.post_cover.is_left
|
||||
a(href=url_for(link))
|
||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = theme.default_cover
|
||||
- var default_post_cover = random_cover()
|
||||
if (post_cover)
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
.post_cover.is_right
|
||||
a(href=url_for(link))
|
||||
a(href=url_for(link) title=article.title || _p('no_title'))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = theme.default_cover
|
||||
- var default_post_cover = random_cover()
|
||||
if (post_cover)
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
img.post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
else
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
img.post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`)
|
||||
|
||||
.recent-post-info
|
||||
a.article-title(href=url_for(link) title= article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
.relatedPosts
|
||||
.relatedPosts_headline
|
||||
i.fa.fa-thumbs-up(aria-hidden="true")
|
||||
span=' ' + _p('relatedPosts_headline')
|
||||
.relatedPosts_list!= related_posts(page,site.posts)
|
||||
.clear_both
|
||||
6
layout/includes/widget/card_announcement.pug
Normal file
6
layout/includes/widget/card_announcement.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
.card_widget.card-announcement
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content= theme.announcement.content
|
||||
6
layout/includes/widget/card_archives.pug
Normal file
6
layout/includes/widget/card_archives.pug
Normal file
@@ -0,0 +1,6 @@
|
||||
.card_widget.card-archives
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
span= _p('aside.card_archives')
|
||||
div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'})
|
||||
41
layout/includes/widget/card_author.pug
Normal file
41
layout/includes/widget/card_author.pug
Normal file
@@ -0,0 +1,41 @@
|
||||
.card_widget.card-author
|
||||
.card-content
|
||||
.post_data
|
||||
.data-item.text-center
|
||||
img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`)
|
||||
p.author-info__name.text-center= config.author
|
||||
p.author-info__description.text-center= config.description
|
||||
|
||||
.post_data.data_config
|
||||
if site.posts.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.archive_dir) + '/')
|
||||
p.headline= _p('aside.articles')
|
||||
p.length_num= site.posts.length
|
||||
|
||||
if site.tags.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.tag_dir) + '/' )
|
||||
p.headline= _p('aside.tags')
|
||||
p.length_num= site.tags.length
|
||||
|
||||
if site.categories.length
|
||||
.data-item.text-center
|
||||
.data_link
|
||||
a(href=url_for(config.category_dir) + '/')
|
||||
p.headline= _p('aside.categories')
|
||||
p.length_num= site.categories.length
|
||||
|
||||
.post_data.text-center
|
||||
a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me'
|
||||
|
||||
|
||||
|
||||
if(theme.social)
|
||||
.post_data.data_config
|
||||
#aside-social-icons
|
||||
each url, icon in theme.social
|
||||
a.social-icon.data-item(href=url target="_blank")
|
||||
i(class=icon)
|
||||
23
layout/includes/widget/card_categories.pug
Normal file
23
layout/includes/widget/card_categories.pug
Normal file
@@ -0,0 +1,23 @@
|
||||
if site.categories.length
|
||||
.card_widget.card-categories
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
span= _p('aside.card_categories')
|
||||
ul.aside_category_item
|
||||
mixin displayCategories(parent = undefined)
|
||||
- site.categories.find({ parent }).sort("name").each(function(category) {
|
||||
- var childCount = site.categories.find({ parent: category._id }).count();
|
||||
li.aside_category_list
|
||||
a.aside_category_list_link(href=url_for(category.path))
|
||||
span.aside_category_list_name= category.name
|
||||
span.aside_category_list_length= category.length
|
||||
|
||||
if childCount > 0
|
||||
ul.aside_category_item.child
|
||||
+displayCategories(category._id)
|
||||
- })
|
||||
|
||||
+displayCategories()
|
||||
|
||||
|
||||
24
layout/includes/widget/card_recent_post.pug
Normal file
24
layout/includes/widget/card_recent_post.pug
Normal file
@@ -0,0 +1,24 @@
|
||||
.card_widget.card-recent-post
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside_recent_item
|
||||
- site.posts.sort('date', -1).limit(5).each(function(article){
|
||||
.aside_recent_post
|
||||
- var link = article.link || article.path
|
||||
a(href=url_for(link))
|
||||
- var post_cover = article.cover
|
||||
- var default_post_cover = random_cover()
|
||||
.aside_post_cover
|
||||
if (post_cover)
|
||||
img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
else
|
||||
img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title'))
|
||||
div#aside_title
|
||||
.aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
if (theme.post_meta.date_type)
|
||||
- var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date'
|
||||
time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)]
|
||||
|
||||
- })
|
||||
7
layout/includes/widget/card_tags.pug
Normal file
7
layout/includes/widget/card_tags.pug
Normal file
@@ -0,0 +1,7 @@
|
||||
if site.tags.length
|
||||
.card_widget.card-tags
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-tags(aria-hidden="true")
|
||||
span= _p('aside.card_tags')
|
||||
.card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'})
|
||||
24
layout/includes/widget/card_webinfo.pug
Normal file
24
layout/includes/widget/card_webinfo.pug
Normal file
@@ -0,0 +1,24 @@
|
||||
.card_widget.card-webinfo
|
||||
.card-content
|
||||
.item_headline
|
||||
i.fa.fa-line-chart(aria-hidden="true")
|
||||
span= _p('aside.card_webinfo.headline')
|
||||
.webinfo
|
||||
.webinfo_item
|
||||
.webinfo_article_name= _p('aside.card_webinfo.article_name') + " :"
|
||||
.webinfo_article_count= site.posts.length
|
||||
if theme.runtimeshow.enable
|
||||
.webinfo_item
|
||||
.webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo_runtime_count.webinfo_runtime_count
|
||||
script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date)
|
||||
|
||||
if theme.busuanzi.site_uv
|
||||
.webinfo_item
|
||||
.webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :"
|
||||
.webinfo_site_uv_count#busuanzi_value_site_uv
|
||||
if theme.busuanzi.site_pv
|
||||
.webinfo_item
|
||||
.webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :"
|
||||
.webinfo_site_pv_count#busuanzi_value_site_pv
|
||||
|
||||
@@ -6,7 +6,7 @@ block content
|
||||
.tag-cloud__title= _p('page.tag')
|
||||
| -
|
||||
span.tag-cloud__amount= site.tags.length
|
||||
.tag-cloud-tags!= tagcloud({min_font: 20, max_font: 43, amount: 200, color: true, start_color: '#A4D8FA', end_color: '#0790E8'})
|
||||
.tag-cloud-tags!= tags(site.tags)
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
#aside_content.aside_content
|
||||
|
||||
@@ -71,6 +71,6 @@ block content
|
||||
include includes/pagination.pug
|
||||
|
||||
if theme.related_post && theme.related_post.enable
|
||||
include includes/related-posts.pug
|
||||
!= related_posts(page,site.posts)
|
||||
if page.comments !== false
|
||||
include includes/comments/index.pug
|
||||
13
scripts/random_cover.js
Normal file
13
scripts/random_cover.js
Normal file
@@ -0,0 +1,13 @@
|
||||
hexo.extend.helper.register('random_cover', function () {
|
||||
var cover;
|
||||
var num;
|
||||
if (!Array.isArray(hexo.theme.config.default_cover)) {
|
||||
cover = hexo.theme.config.default_cover
|
||||
return cover
|
||||
} else {
|
||||
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
|
||||
cover = hexo.theme.config.default_cover[num];
|
||||
return cover
|
||||
}
|
||||
|
||||
})
|
||||
@@ -23,16 +23,37 @@ hexo.extend.helper.register('related_posts', function(currentPost, allPosts){
|
||||
if (relatedPosts.length == 0) { return '' };
|
||||
var result = "";
|
||||
var limit_num = hexo.theme.config.related_post.limit || 6
|
||||
var lang = hexo.theme.config.rootConfig.language;
|
||||
var headline_lang;
|
||||
if (lang === 'zh-CN') {
|
||||
headline_lang = '相关推荐';
|
||||
} else if ( lang === 'zh-TW') {
|
||||
headline_lang = '相關推薦';
|
||||
} else {
|
||||
headline_lang = 'Recommend';
|
||||
}
|
||||
|
||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||
|
||||
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|| hexo.theme.config.default_cover|| data.butterfly.default_cover
|
||||
result += '<div class="relatedPosts_item"><a href="/' + relatedPosts[i].path + '" title="' + relatedPosts[i].title +'">';
|
||||
var cover = relatedPosts[i].cover || random_cover()
|
||||
|
||||
result += '<div class="relatedPosts_item"><a href="' + hexo.theme.config.rootConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
|
||||
result += '<img class="relatedPosts_cover lozad" data-src="' + cover + '">';
|
||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
||||
result += '</a></div>'
|
||||
}; // console.log(relatedPosts);
|
||||
};
|
||||
|
||||
result += '</div><div class="clear_both"></div></div>'
|
||||
return result;
|
||||
|
||||
}
|
||||
});
|
||||
hexo.extend.helper.register('echo', function(path){
|
||||
return path;
|
||||
@@ -62,3 +83,15 @@ function compare (attr) {
|
||||
}
|
||||
}
|
||||
|
||||
function random_cover() {
|
||||
var post_cover;
|
||||
var num;
|
||||
if (!Array.isArray(hexo.theme.config.default_cover)) {
|
||||
post_cover = hexo.theme.config.default_cover
|
||||
return post_cover
|
||||
} else {
|
||||
num = Math.floor(Math.random() * (hexo.theme.config.default_cover.length));
|
||||
post_cover = hexo.theme.config.default_cover[num];
|
||||
return post_cover
|
||||
}
|
||||
}
|
||||
|
||||
16
scripts/tags.js
Normal file
16
scripts/tags.js
Normal file
@@ -0,0 +1,16 @@
|
||||
hexo.extend.helper.register('tags', function (site_tags) {
|
||||
var result = "";
|
||||
site_tags.sort('path').each(function (tags) {
|
||||
var fontSize = Math.floor(Math.random() * 15 + 15) + "px"; //15 ~ 30
|
||||
var color =
|
||||
"rgb(" +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
")"; // 0,0,0 -> 200,200,200
|
||||
result += '<a href="' + hexo.theme.config.rootConfig.root + tags.path + '" style="font-size:' + fontSize + ';color:' + color + '">' + tags.name + '</a>'
|
||||
})
|
||||
return result;
|
||||
})
|
||||
8
scripts/url_check.js
Normal file
8
scripts/url_check.js
Normal file
@@ -0,0 +1,8 @@
|
||||
hexo.extend.helper.register('url_check', function (p) {
|
||||
|
||||
let src = p ;
|
||||
let reg = /^https?/ig;
|
||||
return reg.test(src)
|
||||
|
||||
|
||||
})
|
||||
@@ -85,11 +85,11 @@ hr
|
||||
|
||||
&:before
|
||||
position: absolute
|
||||
top: -10px
|
||||
top: $hr-icon-top
|
||||
left: 5%
|
||||
z-index: 1
|
||||
color: $light-blue
|
||||
content: "\f0c4"
|
||||
content: $hr-icon
|
||||
font: normal normal normal 14px / 1 FontAwesome
|
||||
font-size: 20px
|
||||
transition: all 1s ease-in-out
|
||||
@@ -149,6 +149,8 @@ table
|
||||
|
||||
// valine
|
||||
#vcomment
|
||||
font-size: inherit
|
||||
|
||||
input
|
||||
font-size: 0.65rem
|
||||
|
||||
@@ -166,9 +168,6 @@ table
|
||||
.info
|
||||
display: none
|
||||
|
||||
.vcomment
|
||||
margin-top: 20px
|
||||
|
||||
.vimg
|
||||
border: 0
|
||||
|
||||
@@ -207,7 +206,7 @@ table
|
||||
#site-name,
|
||||
#aside_content .author-info__name,
|
||||
#aside_content .author-info__description
|
||||
font-family: 'Titillium Web',Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
font-family: $site-name-font
|
||||
|
||||
|
||||
|
||||
@@ -349,6 +348,11 @@ table
|
||||
display: block !important
|
||||
|
||||
.fireworks
|
||||
position: fixed;
|
||||
z-index: -1;
|
||||
pointer-events: none;
|
||||
position: fixed
|
||||
z-index: -1
|
||||
pointer-events: none
|
||||
|
||||
|
||||
// 去掉加載黑框
|
||||
img[src=""],img:not([src])
|
||||
opacity: 0
|
||||
|
||||
@@ -224,6 +224,13 @@
|
||||
margin-bottom: -3px
|
||||
margin-block-start: 0.2rem
|
||||
|
||||
.aside_category_item.child
|
||||
margin-bottom: -3px
|
||||
margin-block-start: 0rem
|
||||
|
||||
.aside_category_list
|
||||
margin-left: -50px
|
||||
|
||||
.aside_category_list,.archive-list-item
|
||||
margin-left: -40px
|
||||
padding: 0.2rem 1rem
|
||||
@@ -235,6 +242,18 @@
|
||||
text-decoration: none
|
||||
color: #4c4948
|
||||
|
||||
.aside_category_list_name,.archive-list-link
|
||||
white-space: nowrap
|
||||
overflow: hidden
|
||||
text-overflow: ellipsis
|
||||
flex: auto
|
||||
|
||||
.aside_category_list_link,.archive-list-item
|
||||
display: flex
|
||||
|
||||
|
||||
|
||||
|
||||
.aside_category_list_length,.archive-list-count
|
||||
float: right
|
||||
|
||||
@@ -267,14 +286,11 @@
|
||||
|
||||
|
||||
@keyframes announ_animation{
|
||||
|
||||
0%,to{
|
||||
color: #4c4948
|
||||
|
||||
}
|
||||
50%{
|
||||
color: #FF0000
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,35 @@
|
||||
-webkit-transform: rotate(-45deg) translate(4px, -4px)
|
||||
transform: rotate(-45deg) translate(4px, -4px)
|
||||
|
||||
.menus
|
||||
.mobile_author_icon
|
||||
display: none
|
||||
padding: 3rem 1.5rem 0
|
||||
text-align: center
|
||||
|
||||
img
|
||||
height: 120px
|
||||
width: 120px
|
||||
display: inline-block
|
||||
vertical-align: top
|
||||
border-radius: 70px
|
||||
-webkit-transition: all .3s
|
||||
-moz-transition: all .3s
|
||||
-o-transition: all .3s
|
||||
-ms-transition: all .3s
|
||||
transition: all .3s
|
||||
|
||||
hr
|
||||
margin: 1rem auto
|
||||
display: none
|
||||
|
||||
&.menu_open
|
||||
display: block
|
||||
animation: menu_open .3s
|
||||
|
||||
&.menu_close
|
||||
animation: menu_close .3s
|
||||
display: block
|
||||
|
||||
|
||||
|
||||
@@ -122,6 +151,7 @@
|
||||
text-shadow: 0.05rem 0.05rem 0.1rem rgba(0, 0, 0, 0.3)
|
||||
font-size: 0.7rem
|
||||
cursor: pointer
|
||||
margin-left: 1rem
|
||||
|
||||
&::after
|
||||
position: absolute
|
||||
@@ -191,30 +221,47 @@
|
||||
display: block
|
||||
|
||||
.menus
|
||||
position: absolute
|
||||
top: 3rem
|
||||
right: 0.8rem
|
||||
display: none
|
||||
width: 8rem
|
||||
background: alpha($white, 0.9)
|
||||
position: fixed
|
||||
top: 0
|
||||
right: 0
|
||||
width: 100%
|
||||
height 101vh
|
||||
background: $white
|
||||
cursor: pointer
|
||||
box-shadow: 0 0 4px rgba(0, 0, 0, 0.27)
|
||||
z-index: -1
|
||||
overflow: auto
|
||||
display: none
|
||||
|
||||
a
|
||||
display: block !important
|
||||
display: inline-block !important
|
||||
opacity: 1 !important
|
||||
margin-left: 0
|
||||
padding-top: 0.3rem
|
||||
padding-bottom: 0.3rem
|
||||
padding-left: 0.6rem
|
||||
// margin-left: 0
|
||||
// padding-top: 0.3rem
|
||||
// padding-bottom: 0.3rem
|
||||
// padding-left: 0.6rem
|
||||
margin: 0
|
||||
padding: .5rem 1rem
|
||||
color: $font-black
|
||||
text-shadow: none
|
||||
font-size: 0.8rem
|
||||
z-index: 0
|
||||
|
||||
|
||||
&:hover
|
||||
color: $light-blue
|
||||
|
||||
.mobile_author_icon
|
||||
display: block
|
||||
|
||||
.menus_item
|
||||
padding: 0 .5rem
|
||||
margin-bottom: 4rem
|
||||
text-align: center
|
||||
|
||||
hr
|
||||
display: block
|
||||
|
||||
.search
|
||||
right: 0.5rem
|
||||
|
||||
@@ -225,7 +272,3 @@
|
||||
.search
|
||||
display: inline-block;
|
||||
opacity: 1;
|
||||
|
||||
|
||||
#page-header .site-page
|
||||
margin-left: 1rem
|
||||
|
||||
@@ -200,6 +200,9 @@ if hexo-config("nightshift") && hexo-config("nightshift.enable")
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: lighten(#2d3035,5)
|
||||
|
||||
.more
|
||||
background-color: #616a6b
|
||||
|
||||
@media screen and (max-width: 768px)
|
||||
.night-mode
|
||||
color: #99a9bf
|
||||
@@ -207,14 +210,13 @@ if hexo-config("nightshift") && hexo-config("nightshift.enable")
|
||||
|
||||
#page-header
|
||||
.menus
|
||||
a
|
||||
color: #99a9bf
|
||||
background: #2d3035
|
||||
&.fixed
|
||||
a
|
||||
color: #99a9bf !important
|
||||
.menu-icon-first,
|
||||
.menu-icon-second,
|
||||
.menu-icon-third
|
||||
background-color: #99a9bf;
|
||||
background-color: #99a9bf !important
|
||||
|
||||
|
||||
@media screen and (min-width: 768px)
|
||||
|
||||
@@ -277,6 +277,8 @@ footer
|
||||
position: absolute
|
||||
color: #fff
|
||||
|
||||
.is_hidden
|
||||
overflow: hidden
|
||||
@keyframes pulse{
|
||||
|
||||
0%,to{
|
||||
@@ -350,3 +352,24 @@ footer
|
||||
80%{transform:scale(.98)}
|
||||
100%{transform:scale(1)}}
|
||||
|
||||
|
||||
|
||||
@keyframes menu_open{
|
||||
0% {
|
||||
transform: scale(0)
|
||||
}
|
||||
100% {
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes menu_close{
|
||||
0% {
|
||||
transform: scale(1)
|
||||
display: block
|
||||
}
|
||||
100% {
|
||||
transform: scale(0)
|
||||
display: none
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,10 @@ $theme-hr-color = #A4D8FA
|
||||
$theme-read-mode-bg-color = #FAF9DE
|
||||
$font-family= Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
$code-font = consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number
|
||||
|
||||
$site-name-font = "Titillium Web", Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif
|
||||
//hr icon
|
||||
$hr-icon = '\f0c4'
|
||||
$hr-icon-top = -10px
|
||||
|
||||
if hexo-config("theme_color") && hexo-config("theme_color.enable")
|
||||
$theme-color = convert(hexo-config("theme_color.main")) || #49B1F5
|
||||
@@ -25,12 +28,22 @@ if hexo-config("font") && hexo-config("font.enable")
|
||||
$font-family = convert(hexo-config("font.font-family")) || 'Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
|
||||
$code-font = convert(hexo-config("font.code-font")) || 'consolas, Menlo, "PingFang SC", "Microsoft YaHei", monospace, Helvetica Neue For Number'
|
||||
|
||||
if hexo-config("blog_title_font.font-family")
|
||||
$site-name-font = convert(hexo-config("blog_title_font.font-family")) || '"Titillium Web",Lato,PingFang SC, Hiragino Sans GB, "Microsoft JhengHei", "Microsoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif'
|
||||
|
||||
|
||||
if hexo-config("hr") && hexo-config("hr.enable")
|
||||
$hr-icon = hexo-config("hr.icon") || '\f0c4'
|
||||
$hr-icon-top = convert(hexo-config("hr.icon-top")) || -10px
|
||||
|
||||
|
||||
// Global Variables
|
||||
$font-size = 14px
|
||||
$font-color = #1F2D3D
|
||||
$rem = 20px
|
||||
$font-family = $font-family
|
||||
$code-font = $code-font
|
||||
$site-name-font = $site-name-font
|
||||
$text-line-height = 2
|
||||
$sm = 768px
|
||||
$bg = 1024px
|
||||
@@ -90,3 +103,5 @@ $img-border-padding = 4px
|
||||
// sidebar
|
||||
$sidebar-width = 300px
|
||||
$sidebar-background = #f6f8fa
|
||||
|
||||
|
||||
|
||||
@@ -94,37 +94,6 @@ $(function () {
|
||||
});
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// tags 隨機大小 顔色
|
||||
var list = document.querySelectorAll(".tag-cloud .tag-cloud-tags a");
|
||||
|
||||
if ($(window).width() > 768) {
|
||||
Array.prototype.forEach.call(list, (item, index) => {
|
||||
item.style.fontSize = Math.floor(Math.random() * 20 + 15) + "px"; //15 ~ 35
|
||||
item.style.color =
|
||||
"rgb(" +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
")"; // 0,0,0 -> 200,200,200
|
||||
});
|
||||
} else {
|
||||
Array.prototype.forEach.call(list, (item, index) => {
|
||||
item.style.fontSize = Math.floor(Math.random() * 13 + 15) + "px"; //15 ~ 28
|
||||
item.style.color =
|
||||
"rgb(" +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
", " +
|
||||
Math.floor(Math.random() * 201) +
|
||||
")"; // 0,0,0 -> 200,200,200
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// bookmark
|
||||
$.fancyConfirm = function (opts) {
|
||||
@@ -242,10 +211,11 @@ $(function () {
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//fancybox
|
||||
var imgList = $(".recent-post-info img");
|
||||
var imgList = $(".recent-post-info img").not('.no-fancybox');
|
||||
if (imgList.length === 0) {
|
||||
imgList = $("#post-content img");
|
||||
imgList = $("#post-content img").not('.no-fancybox');
|
||||
}
|
||||
|
||||
for (var i = 0; i < imgList.length; i++) {
|
||||
var $a = $(
|
||||
'<a href="' +
|
||||
@@ -253,14 +223,13 @@ $(function () {
|
||||
'" data-fancybox="group" data-caption="' +
|
||||
imgList[i].alt +
|
||||
'" class="fancybox"></a>'
|
||||
);
|
||||
var alt = imgList[i].alt;
|
||||
var $wrap = $(imgList[i]).wrap($a);
|
||||
)
|
||||
var alt = imgList[i].alt
|
||||
var $wrap = $(imgList[i]).wrap($a)
|
||||
if (alt) {
|
||||
$wrap.after('<div class="img-alt">' + alt + "</div>");
|
||||
$wrap.after('<div class="img-alt">' + alt + '</div>')
|
||||
}
|
||||
}
|
||||
|
||||
$().fancybox({
|
||||
selector: "[data-fancybox]",
|
||||
loop: true,
|
||||
@@ -309,29 +278,75 @@ $(function () {
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
/** head点击*/
|
||||
$('.toggle-menu').on('click', function () {
|
||||
if (!$('.menus').is(':visible')) {
|
||||
|
||||
if ($(".toggle-menu").hasClass("open")) {
|
||||
$(".toggle-menu").removeClass("open").addClass("close");
|
||||
$('.menus').slideDown(300)
|
||||
$("#page-header #site-name,#page-header .search").css({'color':'#3b3a3a','text-shadow': 'none'})
|
||||
$(".toggle-menu *").css({ 'background-color': '#3b3a3a', 'text-shadow': 'none' });
|
||||
$('body').addClass("is_hidden");
|
||||
$('.menus').addClass("menu_open");
|
||||
fixbg_menu();
|
||||
} else {
|
||||
$(".toggle-menu").removeClass("close").addClass("open");
|
||||
$('.menus').slideUp(200)
|
||||
$("#page-header #site-name,#page-header .search").css({ 'color': '', 'text-shadow': '' });
|
||||
$(".toggle-menu *").css({ 'background-color': '', 'text-shadow': '' });
|
||||
$('body').removeClass("is_hidden");
|
||||
$('.menus').removeClass("menu_open").addClass('menu_close');
|
||||
setTimeout(function () {
|
||||
$('.menus').removeClass("menu_close")
|
||||
|
||||
}, 300)
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('click touchstart', function (e) {
|
||||
var flag = $('.menus')[0].contains(e.target) || $('.toggle-menu')[0].contains(e.target)
|
||||
if (!flag && $('.toggle-menu').is(':visible')) {
|
||||
$(".toggle-menu").removeClass("close").addClass("open");
|
||||
$('.menus').slideUp(200)
|
||||
function fixbg_menu() {
|
||||
const fixScroll = (scrollEl) => {
|
||||
let startY
|
||||
scrollEl.addEventListener('touchstart', function (event) {
|
||||
// 如果多於1根手指點擊屏幕,則不處理
|
||||
if (event.targetTouches.length > 1) {
|
||||
return
|
||||
}
|
||||
// 儲存手指的初始位置
|
||||
startY = event.targetTouches[0].clientY
|
||||
}, false)
|
||||
scrollEl.addEventListener('touchmove', function (event) {
|
||||
if (event.targetTouches.length > 1) {
|
||||
return
|
||||
}
|
||||
// 判斷手指滑動方向, y大於0時向下滑動, 小於0時向上滑動
|
||||
const y = event.targetTouches[0].clientY - startY
|
||||
// 如果到頂時繼續向下拉
|
||||
if (scrollEl.scrollTop <= 0 && y > 0) {
|
||||
// 重置滾動距離為最小值
|
||||
scrollEl.scrollTop = 0
|
||||
// 阻止滾動
|
||||
event.preventDefault()
|
||||
}
|
||||
// 如果到底時繼續上滑
|
||||
const maxScrollTop = scrollEl.scrollHeight - scrollEl.clientHeight
|
||||
if (maxScrollTop - scrollEl.scrollTop <= 0 && y < 0) {
|
||||
scrollEl.scrollTop = maxScrollTop
|
||||
event.preventDefault()
|
||||
}
|
||||
}, {
|
||||
passive: false
|
||||
})
|
||||
}
|
||||
const scrollEl = document.querySelector(".menus");
|
||||
fixScroll(scrollEl)
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(window).on('resize', function (e) {
|
||||
if (!$('.toggle-menu').is(':visible')) {
|
||||
if (!$('.menus').is(':visible')) {
|
||||
$(".toggle-menu").removeClass("open").addClass("close");
|
||||
$('.menus').slideDown(300)
|
||||
if ($(".toggle-menu").hasClass("close")) {
|
||||
$(".toggle-menu").removeClass("close").addClass("open");
|
||||
$("#page-header #site-name,#page-header .search").css({ 'color': '', 'text-shadow': '' });
|
||||
$(".toggle-menu *").css({ 'background-color': '', 'text-shadow': '' });
|
||||
$('body').removeClass("is_hidden");
|
||||
$('.menus').removeClass("menu_open");
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -351,7 +366,10 @@ $(function () {
|
||||
findHeadPosition(currentTop)
|
||||
}
|
||||
var isUp = scrollDirection(currentTop)
|
||||
|
||||
if($(".toggle-menu").hasClass("open")){
|
||||
if (currentTop > 56) {
|
||||
|
||||
if (isUp) {
|
||||
$('#page-header').hasClass('visible') ? $('#page-header').removeClass('visible') : console.log()
|
||||
} else {
|
||||
@@ -396,7 +414,7 @@ $(function () {
|
||||
'transform': 'translateX(0)'
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}, 50, 100))
|
||||
|
||||
@@ -501,6 +519,18 @@ $(function () {
|
||||
// Hide their respective list of subsections
|
||||
.find('.toc-child').hide()
|
||||
}
|
||||
|
||||
if ($('.toc-link').hasClass('active')){
|
||||
var active_position = $(".active").offset().top;
|
||||
var sidebar_scrolltop = $("#sidebar").scrollTop();
|
||||
if (active_position > (top + $(window).height() - 50)) {
|
||||
$("#sidebar").scrollTop(sidebar_scrolltop + 100);
|
||||
} else if (active_position < top + 50)
|
||||
{
|
||||
$("#sidebar").scrollTop(sidebar_scrolltop - 100);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//代碼框雙擊全屏
|
||||
|
||||
Reference in New Issue
Block a user