提交 d585a715 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

feat: Use fontawesome5.x and support setting all icons

上级 8198d5a2
......@@ -44,27 +44,24 @@ sougou_site_verification:
# Menu config
# ---------------------------------------------------------------
# Header navigation menu.
# Value before `||` delimiter is the target link.
# Value after `||` delimiter is the name of FontAwesome icon.
# See: https://fontawesome.com/v4.7.0/icons/
# If not set, "question-circle-o" icon will be shown.
# The menu in the website header.
# Value before `||` is the target link, value after `||` is the name of FontAwesome icon.
# Usage: `Key: /link/ || fa(s|r|l|d|b) fa-iconname`
# Select your icon name, visit: https://fontawesome.com/icons
menu:
home: / || home
archives: /archives/ || folder-open
# categories: /categories/ || th
# tags: /tags/ || tags
# about: /about/ || user
# xxx: /xxx/ || xxx
home: / || fas fa-home
archives: /archives/ || fas fa-folder-open
# categories: /categories/ || fas fa-layer-group
# tags: /tags/ || fas fa-tags
# You can add a secondary menu like follow.
# xxx: javascript:; || xxx
# xxx1: javascript:; || fa(s|r|l|d|b) fa-xxx
# Secondary menu.
submenu:
# Add item of secondary menu in here.
# xxx:
# xx1: /xxx/ || xxx
# xx2: /xxx/ || xxx
# xxx1:
# xxx1-1: /xxx1-1/ || fa(s|r|l|d|b) fa-xxx
# xxx1-2: /xxx1-2/ || fa(s|r|l|d|b) fa-xxx
menu_settings:
# Only show by icon.
......@@ -153,6 +150,8 @@ header:
# The icon that prompt to scroll down.
scroll_down_icon:
enable: false
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-angle-down
animation: true
body:
......@@ -194,8 +193,7 @@ footer:
# Copyright information.
copyright:
enable: true
# If not set, will be used `author` from Hexo main config.
# (e.g. liuyib. All Rights Reserved.)
# If not set, will be used `author` from Hexo main config (e.g. liuyib. All Rights Reserved.)
text:
# Start time. If not set, the current year will be used.
since:
......@@ -204,9 +202,8 @@ footer:
# The icon between the copyright year and the owner.
icon:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
# `heart` is recommended with animation in red (#ff0000).
name: heart
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-heart
# Heart beat animation.
animation: false
# Please use quote to wrap value (All CSS size units are supported).
......@@ -250,9 +247,8 @@ creative_commons:
back2top:
enable: true
icon:
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
# `rocket` is recommended.
name: rocket
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-rocket
# Rotation Angle of icon.
rotate: -45deg
# Please use quote to wrap value (All CSS size units are supported).
......@@ -291,23 +287,22 @@ author:
motto: hello world
# Social links.
# Value before `||` delimiter is the target link.
# Value after `||` delimiter is the name of FontAwesome icon.
# See: https://fontawesome.com/v4.7.0/icons/
# If you can`t find a suitable icon, you can choose to display the original
# text by adding the "origin" prefix (e.g. origin:sf, then "sf" will be show).
# Value before `||` is the target link, value after `||` is the name of FontAwesome icon.
# Usage: `Key: /link/ || fa(s|r|l|d|b) fa-iconname`
# Select your icon name, visit: https://fontawesome.com/icons
# If you can`t find a suitable icon, you can choose to display text by adding the `origin:` prefix.
# e.g. `origin:sf`, so `sf` will be displayed.
social:
github: https://github.com/ || github
google: https://plus.google.com/ || google
# twitter: https://twitter.com/ || twitter
# youtube: https://youtube.com/ || youtube
github: https://github.com/ || fab fa-github
google: https://plus.google.com/ || fab fa-google
twitter: https://twitter.com/ || fab fa-twitter
youtube: https://youtube.com/ || fab fa-youtube
# segmentfault: https://segmentfault.com/ || origin:sf
# weibo: https://weibo.com/ || weibo
# weibo: https://weibo.com/ || fab fa-weibo
# zhihu: https://www.zhihu.com/ || origin:知
# wechat: yournumber || weixin
# telegram: yournumber || telegram
# qq: yournumber || qq
# xxx: xxx || (origin:)xxx
# wechat: yournumber || fab fa-weixin
# telegram: yournumber || fab fa-telegram
# qq: yournumber || fab fa-qq
social_setting:
enable: false
......@@ -336,9 +331,8 @@ feed:
# Enter your email subscription link (e.g. http://eepurl.com/guAE6j).
email:
# Enter the rss address of you set (e.g. /atom.xml).
# Dependencies: https://github.com/hexojs/hexo-generator-feed/
# Don't enable this before install dependencies
# by `npm install hexo-generator-feed --save` in hexo directory.
# Dependency: https://github.com/hexojs/hexo-generator-feed/
# !!! Don't enable this before install dependency by `npm install hexo-generator-feed --save` in hexo root directory.
rss:
# The reading progress of post.
......@@ -383,42 +377,40 @@ reward:
# Post config
# ---------------------------------------------------------------
# The meta-information at the front of the post.
# The information of post.
post_meta:
# Only show by icon.
icon_only: false
# Show create information.
# The create time of post.
created:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: calendar-o
# Show update information.
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: far fa-calendar-plus
# The update time of post.
updated:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: calendar-check-o
# Count the reading time of the post.
# Dependencies: https://github.com/willin/hexo-wordcount/
# Don't enable this before install dependencies
# by `npm install hexo-wordcount --save` in hexo directory.
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: far fa-calendar-check
# The approximate reading time of post.
# Dependency: https://github.com/willin/hexo-wordcount/
# !!! Don't enable this before install dependency by `npm install hexo-wordcount --save` in hexo root directory.
reading_time:
enable: false
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: clock-o
# Set reading speed to estimate reading time.
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: far fa-clock
# Set reading speed to count reading time.
speed:
# Reading speed of zh-CN.
zh: 200
# Reading speed of en-US.
en: 80
# Count the words of the post.
# Dependencies: https://github.com/willin/hexo-wordcount/
# Don't enable this before install dependencies
# by `npm install hexo-wordcount --save` in hexo directory.
# Counting the words of post.
# Dependency: https://github.com/willin/hexo-wordcount/
# !!! Don't enable this before install dependency by `npm install hexo-wordcount --save` in hexo root directory.
word_count:
enable: false
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: file-word-o
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: far fa-file-word
# The article list on the homepage or archives page.
post_list:
......@@ -434,7 +426,7 @@ post_list:
post_widget:
# Show tags at the bottom of the post.
tags: true
# Show "post end" at the bottom of the post.
# Show "------ END ------" at the bottom of the post.
end_text:
enable: true
# Show the horizon line before the text of the end.
......@@ -453,14 +445,13 @@ auto_excerpt:
length: 150
# Stick post to the top.
# Dependencies: https://github.com/netcan/hexo-generator-index-pin-top/
# Don't enable this before install dependencies
# by `npm install hexo-generator-index-pin-top --save` in hexo directory.
# Dependency: https://github.com/netcan/hexo-generator-index-pin-top/
# !!! Don't enable this before install dependency by `npm install hexo-generator-index-pin-top --save` in hexo directory.
stick_top:
# Position of icon, available values: left | right.
position: right
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: thumb-tack
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: fas fa-thumbtack
# Rotation Angle of icon.
rotate: 45deg
# Please use the quote to wrap value (All CSS size units are supported).
......@@ -487,8 +478,7 @@ gitalk:
# Facebook-like distraction free mode.
distraction_free_mode: false
# Gitalk's display language depends on user's browser or system environment.
# If you want everyone visiting your site to see a uniform language,
# you can set a force language value.
# If you want everyone visiting your site to see a uniform language, you can set a force language value.
# Available values: en, zh-CN, es-ES, fr, ru, zh-TW.
language:
......@@ -567,16 +557,16 @@ busuanzi:
# Number of unique visitor to the entire site.
site_uv:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
icon: user
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: fas fa-user
# Number of page view to the entire site.
site_pv:
enable: true
icon: eye
icon: fas fa-eye
# Number of page view to a post.
post_pv:
enable: true
icon: eye
icon: fas fa-eye
# Google analytics ID
# See: https://analytics.google.com/
......@@ -595,7 +585,7 @@ tencent_analytics:
# ---------------------------------------------------------------
# Algolia Search
# Dependencies: https://github.com/algolia/instantsearch.js/
# Dependency: https://github.com/algolia/instantsearch.js/
algolia_search:
enable: false
hits:
......@@ -615,7 +605,7 @@ local_search:
# ---------------------------------------------------------------
# Canvas-ribbon
# Dependencies: https://github.com/hustcc/ribbon.js
# Dependency: https://github.com/hustcc/ribbon.js
canvas_ribbon:
enable: false
# The width of the ribbon.
......@@ -626,7 +616,7 @@ canvas_ribbon:
zIndex: -1
# Canvas-nest
# Dependencies: https://github.com/hustcc/canvas-nest.js
# Dependency: https://github.com/hustcc/canvas-nest.js
canvas_nest:
enable: false
# Display on mobile or not
......@@ -767,9 +757,8 @@ external_link:
# Adding an icon make it easier for users to know that this is an external link.
icon:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/v4.7.0/icons/
# `external-link` is recommended.
name: external-link
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-external-link-alt
# Please use the quote to wrap value (All CSS size units are supported).
color: "#aaa"
......@@ -801,24 +790,40 @@ js: js
# In theme directory (source/images).
images: images
# The common prefix of the FontAwesome icon.
# Using "fa" prefix in version 4.
# Using "fas | far | fal | fad | fab" prefix in version 5.
fa_prefix: fa
# Set icon for some components.
# Icon name in FontAwesome, see: https://fontawesome.com/icons
# ! -------------------------------------------------------------------
# ! Do not edit the follow configs, unless you know what you are doing.
# ! -------------------------------------------------------------------
icon:
search: fas fa-search
localsearch_empty: far fa-meh
menu_btn: fas fa-bars
feed_email: fas fa-envelope
feed_rss: fas fa-rss
paginator_prev: fas fa-angle-left
paginator_next: fas fa-angle-right
read_more_btn: fas fa-long-arrow-alt-right
post_tags: fas fa-tag
copy_btn: fas fa-copy
prompt_success: fas fa-check-circle
prompt_info: fas fa-arrow-circle-right
prompt_warning: fas fa-exclamation-circle
prompt_error: fas fa-times-circle
valine_visitor: fas fa-eye
# Set a CDN address for the vendor you want to customize.
# ! -----------------------------------------------------
# ! Do not edit the follow configs.
# ! Unless you know what you are doing.
# ! Do not edit the follow configs, unless you know what you are doing.
# ! -----------------------------------------------------
cdn:
# Using version: 4.7.0
# Using version: 5.12.1
# See: https://fontawesome.com/
# Example:
# fontawesome: //cdn.jsdelivr.net/npm/font-awesome@4/css/font-awesome.min.css
# fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.2/css/all.min.css
# fontawesome: //cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css
# fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/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.10.2/css/all.min.css
# fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css
fontawesome:
# Using version: 3.4.1
......
......@@ -52,20 +52,18 @@ post:
created: Created
updated: updated
posted: Posted
word_count: Words
word_count: Words
reading_count: Visited
reading_time: Reading time
reading_time: Reading ≈ %s min
read_more: Read more
fire: Heat
sticky: Sticky top
untitled: "[ Untitled ]"
end: End of the article, thanks for your reading
end: ------ END ------
copyright:
author: Author
link: Link
license_title: Copyright
license_content: All articles in this blog are licensed under
<a href="%s" rel="external nofollow" target="_blank">%s</a> unless stating additionally
license_content: All articles in this blog are licensed under <a href="%s" rel="external nofollow" target="_blank">%s</a> unless stating additionally
# Algolia search
algolia_search:
......
......@@ -49,23 +49,21 @@ social:
# 文章
post:
created: 创建
created: 发表
updated: 更新于
posted: 发表于
word_count: 字数统计
reading_count: 阅读次数
reading_time: 阅读时长
reading_unit:
read_more: 阅读全文
fire: 热度
sticky: 置顶文章
untitled: "[ 文章无标题 ]"
end: 本文结束,感谢您的阅读
end: ------ 本文结束,感觉您的阅读 ------
copyright:
author: 本文作者
link: 本文链接
license_title: 版权声明
license_content: 本博客所有文章除特别声明外,均采用
<a href="%s" rel="external nofollow" target="_blank">%s</a> 许可协议。转载请注明出处!
license_content: 本博客所有文章除特别声明外,均采用 <a href="%s" rel="external nofollow" target="_blank">%s</a> 许可协议。转载请注明出处!
# Algolia 搜索
algolia_search:
......@@ -91,16 +89,22 @@ back2top: 回到顶部
footer:
powered: 由 %s 强力驱动
theme: 主题
uv: 访问人数
pv: 浏览总量
site_uv: 访问人数
site_pv: 浏览总量
# 提示信息
prompt:
copy:
success: 复制成功
error: 复制失败
creative_commons: 知识共享
copy_button: 复制
copy_success: 复制成功
copy_error: 复制失败
# 其他
creative_commons: 知识共享
popover:
copy_button: 复制
creative_commons: 知识共享
post:
create_time: 发表时间
update_time: 修改时间
word_count: 字数统计
reading_time: 阅读时间
visit_num: 阅读次数
site_uv: 访问人数
site_pv: 浏览总量
-
var HEXO_URL = 'http://hexo.io/';
var STUN_URL = 'https://github.com/liuyib/hexo-theme-stun/';
var faPrefix = theme.fa_prefix || 'fa';
var isNoHeader = !theme.header.enable || (is_post() && !theme.header.show_on.post);
var isEnableNoHeader = !theme.header.enable || !theme.header.show_on.post;
......@@ -34,7 +33,7 @@ html(lang=config.language)
main#main.main
div.main-inner
div#content-wrap.content-wrap
div.content(class=`${is_home() ? 'content-home' : ''}`)
div#content.content(class=`${is_home() ? 'content-home' : ''}`)
block content
if page.comments
......
......@@ -17,7 +17,7 @@ mixin menuItem(menu, className)
class=`header-nav-${className || ''}menu-item__a`
)&attributes(aTagAttr)
if !theme.menu_settings.text_only && !!menuIcon
i(class=`${faPrefix} fa-${menuIcon}`)
i(class=menuIcon)
if !theme.menu_settings.icon_only
!= __(`menu.${name}`)
if hasSubMenu
......
mixin postMetaItem({ isIconOnly, iconClass, iconText, popoverPos, popoverText, valueText, valueAttr })
-
var iconElemAttr = {};
var valElemAttr = {};
if (isIconOnly) {
iconElemAttr['data-popover'] = popoverText;
iconElemAttr['data-popover-pos'] = popoverPos;
}
if (valueAttr) {
valElemAttr = valueAttr;
}
span.post-meta-item__icon&attributes(iconElemAttr)
i(class=iconClass)
if !isIconOnly
span.post-meta-item__info= iconText
span.post-meta-item__value&attributes(valElemAttr)= valueText
include ./meta-item.pug
mixin postHeader(post)
header.post-header
if post.top
......@@ -14,50 +16,83 @@ mixin postHeader(post)
= post.title || __('post.untitled')
if !post.link
div.post-header-meta
- var isPostMetaIconOnly = theme.post_meta.icon_only;
div.post-meta
if theme.post_meta.created.enable
span.post-header-meta-create
i(class=`${faPrefix} fa-${theme.post_meta.created.icon}`)
if !theme.post_meta.icon_only
span= __('post.posted') + ' '
span= full_date(post.date, 'YYYY-MM-DD')
span.post-meta-item.post-meta-item--createtime
- var iconClass = theme.post_meta.created.icon;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.created'),
popoverPos: 'up',
popoverText: __('popover.post.create_time'),
valueText: full_date(post.date, 'YYYY-MM-DD')
})
if theme.post_meta.updated.enable
span.post-header-meta-update
i(class=`${faPrefix} fa-${theme.post_meta.updated.icon}`)
if !theme.post_meta.icon_only
span= __('post.updated') + ' '
span= full_date(post.updated, 'YYYY-MM-DD')
span.post-meta-item.post-meta-item--updatetime
- var iconClass = theme.post_meta.updated.icon;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.updated'),
popoverPos: 'up',
popoverText: __('popover.post.update_time'),
valueText: full_date(post.updated, 'YYYY-MM-DD')
})
if theme.post_meta.word_count.enable
span.post-header-meta-word-count
i(class=`${faPrefix} fa-${theme.post_meta.word_count.icon}`)
if !theme.post_meta.icon_only
span= __('post.word_count') + ' '
span= wordcount(post.content)
span.post-meta-item.post-meta-item--wordcount
- var iconClass = theme.post_meta.word_count.icon;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.word_count'),
popoverPos: 'up',
popoverText: __('popover.post.word_count'),
valueText: wordcount(post.content)
})
if theme.post_meta.reading_time.enable
- var postReadingTime = theme.post_meta.reading_time;
span.post-header-meta-reading-time
i(class=`${faPrefix} fa-${postReadingTime.icon}`)
if !theme.post_meta.icon_only
span= __('post.reading_time') + ' '
- var READING_TIME_UNIT = 'm';
span= min2read(post.content, {cn: postReadingTime.speed.zh, en: postReadingTime.speed.en}) + READING_TIME_UNIT
span.post-meta-item.post-meta-item--readtime
- var iconClass = theme.post_meta.reading_time.icon;
- var postRead = theme.post_meta.reading_time;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.reading_time'),
popoverPos: 'up',
popoverText: __('popover.post.reading_time'),
valueText: `${min2read(post.content, { cn: postRead.speed.zh, en: postRead.speed.en })}${__('post.reading_unit')}`
})
if theme.valine.enable && theme.valine.visitor
span(id=url_for(post.path) data-flag-title=post.title).leancloud_visitors
i(class=`${faPrefix} fa-eye`)
if !theme.post_meta.icon_only
span= __('post.reading_count') + ' '
span.leancloud-visitors-count
//- Can`t show the result of busuanzi counting in homepage,
//- because will conflict by ID selector.
span(id=url_for(post.path) data-flag-title=post.title).post-meta-item.post-meta-item--visitors.leancloud_visitors
- var iconClass = theme.icon.valine_visitor;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.reading_count'),
popoverPos: 'up',
popoverText: __('popover.post.visit_num'),
valueAttr: {
class: 'leancloud-visitors-count'
}
})
//- Can`t show the result of busuanzi counting in homepage, because will conflict by ID selector.
if is_post()
if theme.busuanzi.enable && theme.busuanzi.post_pv.enable
span.post-header-meta-reading-count
i(class=`${faPrefix} fa-${theme.busuanzi.post_pv.icon}`)
if !theme.post_meta.icon_only && !theme.busuanzi.icon_only
span= __('post.reading_count') + ' '
span#busuanzi_value_page_pv
span.post-meta-item.post-meta-item--visitors
- var iconClass = theme.busuanzi.post_pv.icon;
+postMetaItem({
isIconOnly: isPostMetaIconOnly || theme.busuanzi.icon_only,
iconClass: iconClass,
iconText: __('post.reading_count'),
popoverPos: 'up',
popoverText: __('popover.post.visit_num'),
valueAttr: {
id: 'busuanzi_value_page_pv'
}
})
div.busuanzi
-
var isBszIconOnly = theme.busuanzi.icon_only;
var iconElemAttr = {};
if (isBszIconOnly) iconElemAttr['data-popover-pos'] = 'up';
if theme.busuanzi.site_uv.enable
span.busuanzi-site-uv
i(class=`${faPrefix} fa-user`).busuanzi-site-uv__icon
if !theme.busuanzi.icon_only
span= __('footer.uv') + ' '
span#busuanzi_value_site_uv
span.busuanzi-siteuv
- if (isBszIconOnly) iconElemAttr['data-popover'] = __('popover.site_uv');
span.busuanzi-siteuv__icon&attributes(iconElemAttr)
i(class=theme.busuanzi.site_uv.icon)
if !isBszIconOnly
span.busuanzi-siteuv__info= __('footer.site_uv')
span.busuanzi-siteuv__value#busuanzi_value_site_uv
if theme.busuanzi.site_uv.enable && theme.busuanzi.site_pv.enable
span.separator= '|'
if theme.busuanzi.site_pv.enable
span.busuanzi-site-pv
i(class=`${faPrefix} fa-eye`).busuanzi-site-pv__icon
if !theme.busuanzi.icon_only
span= __('footer.pv') + ' '
span#busuanzi_value_site_pv
span.busuanzi-sitepv
- if (isBszIconOnly) iconElemAttr['data-popover'] = __('popover.site_pv');
span.busuanzi-siteuv__icon&attributes(iconElemAttr)
i(class=theme.busuanzi.site_pv.icon)
if !isBszIconOnly
span.busuanzi-siteuv__info= __('footer.site_pv')
span.busuanzi-siteuv__value#busuanzi_value_site_pv
......@@ -15,10 +15,16 @@
});
}
var fontawesome = 'undefined';
if (theme.fa_prefix) {
fontawesome = JSON.stringify({
prefix: theme.fa_prefix
var fontIcon = 'undefined';
if (theme.icon) {
fontIcon = JSON.stringify({
prompt: {
success: theme.icon.prompt_success,
info: theme.icon.prompt_info,
warning: theme.icon.prompt_warning,
error: theme.icon.prompt_error
},
copyBtn: theme.icon.copy_btn
});
}
......@@ -124,10 +130,9 @@
}
var prompt = JSON.stringify({
copy_success: __('prompt.copy.success'),
copy_error: __('prompt.copy.error'),
creative_commons: __('prompt.creative_commons'),
copy_button: __('prompt.copy_button')
copy_button: __('popover.copy_button'),
copy_success: __('prompt.copy_success'),
copy_error: __('prompt.copy_error')
});
script.
......@@ -135,7 +140,7 @@ script.
var CONFIG = {
root: '!{ config.root }',
algolia: !{ algolia },
fontawesome: !{ fontawesome },
fontIcon: !{ fontIcon },
sidebar: !{ sidebar },
header: !{ header },
post_widget: !{ post_widget },
......
......@@ -11,7 +11,7 @@ if fCopyright || fBeian
if fCopyright
span!= `Copyright &copy; ${startYear}` + ((startYear != endYear) ? `~${endYear}` : '')
if footer.icon.enable
span(class=`${faPrefix} fa-${footer.icon.name} footer-icon`)
span(class=`${footer.icon.name} footer-icon`)
else
span= ' '
span= footer.copyright.text || config.author + '.'
......@@ -28,14 +28,14 @@ if fPowered || fTheme
div
if fPowered
span
!= _p('footer.powered', link_to(HEXO_URL, 'hexo', { external: true }))
!= _p('footer.powered', link_to(HEXO_URL, 'Hexo', { external: true }))
if footer.powered.version
span= ' v' + hexo_env('version') + '.'
if fPowered && fTheme
span.separator= '|'
if fTheme
span= __('footer.theme') + ' - '
!= link_to(STUN_URL, 'stun', { external: true })
!= link_to(STUN_URL, 'Stun', { external: true })
if footer.theme.version
span= ' v' + stun_env('version') + '.'
......
......@@ -76,7 +76,7 @@ if theme.feed.rss
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
- var fontawesome_css = 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css';
- var fontawesome_css = 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.1/css/all.min.css';
- if (theme.cdn.fontawesome) fontawesome_css = theme.cdn.fontawesome;
link(rel="stylesheet" href=fontawesome_css type="text/css")
......
......@@ -2,14 +2,14 @@ include ../../_mixins/menu-item.pug
nav.header-nav(class=`${isNoHeader ? 'header-nav--sticky' : 'header-nav--fixed'}`)
div.header-nav-inner
div.header-nav-btn(class=`${faPrefix} fa-bars`)
div.header-nav-btn(class=theme.icon.menu_btn)
div.header-nav-menu
+menuItem(theme.menu)
if theme.algolia_search.enable || theme.local_search.enable
div.header-nav-search
if !theme.menu_settings.text_only
i(class=`${faPrefix} fa-search`)
i(class=theme.icon.search)
if !theme.menu_settings.icon_only
span!= __('nav.search')
......@@ -31,4 +31,4 @@ if !isNoHeader
if theme.header.scroll_down_icon.enable
div.header-info-arrow
i.fa.fa-angle-down.header-info-arrow__icon
i.header-info-arrow__icon(class=theme.header.scroll_down_icon.name)
......@@ -28,5 +28,7 @@ section.post-list
if !post.link && isExcerpt
div.post-body-more
a.post-body-more__a(href=url_for(post.path))= __('post.read_more') + ' »'
a.post-body-more__a(href=url_for(post.path))
span= __('post.read_more')
span(class=`post-body-more__icon ${theme.icon.read_more_btn}`)
- })
......@@ -44,9 +44,7 @@ section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
span.sidebar-ov-social__item--logo
!= socialIcon.split('origin:')[1]
else
i.sidebar-ov-social__item--icon(
class=`${faPrefix} fa-${socialIcon ? socialIcon : 'question-circle-o'}`
)
i.sidebar-ov-social__item--icon(class=socialIcon)
if !theme.social_setting.icon_only
span= name
......@@ -62,7 +60,7 @@ section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
target="_blank"
rel="noopener"
)
i.sidebar-ov-feed-email__a--icon(class=`${faPrefix} fa-envelope`)
i.sidebar-ov-feed-email__a--icon(class=theme.icon.feed_email)
span= "Email "
span= __('sidebar.subscribe')
......@@ -75,7 +73,7 @@ section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
target="_blank"
rel="noopener"
)
i.sidebar-ov-feed-rss__a--icon(class=`${faPrefix} fa-rss`)
i.sidebar-ov-feed-rss__a--icon(class=theme.icon.feed_rss)
span= "RSS "
span= __('sidebar.subscribe')
......@@ -103,13 +101,10 @@ section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
href=ccUrl
target="_blank"
rel="noopener"
data-popover=__('prompt.creative_commons')
data-popover=__('popover.creative_commons')
data-popover-pos="up"
)
img(
src=url_for(`/${theme.images}/cc-${ccLicense}.svg`)
alt=__('creative_commons')
)
img(src=url_for(`/${theme.images}/cc-${ccLicense}.svg`))
if theme.reading_progress.enable && is_post()
div.sidebar-reading
......
div#back2top.back2top
i.back2top-icon(class=`${faPrefix} fa-${theme.back2top.icon.name}`)
i.back2top-icon(class=theme.back2top.icon.name)
nav.paginator
if !is_post()
- var prevText = `<i class="${faPrefix} fa-chevron-left"></i>`;
- var nextText = `<i class="${faPrefix} fa-chevron-right"></i>`;
- var prevText = `<i class="${theme.icon.paginator_prev}"></i>`;
- var nextText = `<i class="${theme.icon.paginator_next}"></i>`;
div.paginator-inner
!= paginator({ prev_text: prevText, next_text: nextText, mid_size: 1, escape: false })
else
......@@ -9,10 +9,10 @@ nav.paginator
if page.prev
div.paginator-post-prev
a(href=url_for(page.prev.path))
i(class=`${faPrefix} fa-chevron-left`)
i(class=theme.icon.paginator_prev)
span= page.prev.title || __('post.untitled')
if page.next
div.paginator-post-next
a(href=url_for(page.next.path))
span= page.next.title || __('post.untitled')
i(class=`${faPrefix} fa-chevron-right`)
i(class=theme.icon.paginator_next)
div.sticky-top(data-popover=__('post.sticky') data-popover-pos="up")
i.sticky-top__i(class=`${faPrefix} fa-${theme.stick_top.icon}`)
i.sticky-top__i(class=theme.stick_top.icon)
......@@ -186,7 +186,7 @@ script.
});
resultInnerHtml += '</ul>';
} else {
resultInnerHtml += '<div class="search-results-none"><i class="!{faPrefix} fa-meh-o"></i></div>';
resultInnerHtml += '<div class="search-results-none"><i class="!{theme.icon.localsearch_empty}"></i></div>';
}
$result.html(resultInnerHtml);
};
......
......@@ -16,10 +16,7 @@ block content
footer.post-footer
if theme.post_widget.end_text.enable
div.post-end
p
span= '------ '
span= __('post.end')
span= ' ------'
p= __('post.end')
if (page.copyright !== false) && (theme.creative_commons.enable && theme.creative_commons.post)
include ./_partials/widgets/copyright.pug
......@@ -29,7 +26,7 @@ block content
div.post-tags
each tag in page.tags.data
span.post-tags-item
i.post-tags-item__i(class=`${faPrefix} fa-tags`)
i.post-tags-item__i(class=theme.icon.post_tags)
a.post-tags-item__a(href=tag.permalink)= tag.name
if theme.post_widget.share.enable
......
......@@ -32,11 +32,10 @@ hexo.extend.filter.register('after_post_render', function (data) {
return match;
};
var faPrefix = theme.fa_prefix || 'fa';
return (
'<span class="external-link">' +
`<a ${attrBegin} href="${href}" ${attrEnd}>${html}</a>` +
`<i class="${faPrefix} fa-external-link"></i>` +
`<i class="${theme.external_link.icon.name}"></i>` +
'</span>'
);
}
......
.busuanzi {
&-site-uv,
&-site-pv {
&__icon {
margin-right: .3rem;
&-siteuv,
&-sitepv {
&__icon,
&__info,
&__value {
margin: 0 2px;
}
}
}
......@@ -220,10 +220,10 @@ if (hexo-config('header.nav.height') && match('%', hexo-config('header.nav.heigh
}
&-title {
margin-bottom: .5rem;
margin-bottom: 2rem;
font-size: 4rem;
font-weight: $font-weight-bolder;
line-height: 1.6em;
line-height: 1;
color: $header-text-color;
}
......@@ -245,7 +245,7 @@ if (hexo-config('header.nav.height') && match('%', hexo-config('header.nav.heigh
cursor: pointer;
if (hexo-config('header.scroll_down_icon.animation')) {
animation: arrowUpDown 1.5s infinite;
animation: arrowUpDown 2s infinite;
@keyframes arrowUpDown {
0%,
......
......@@ -25,6 +25,10 @@
background-color: $home-readmore-bg-hover-color;
}
}
&__icon {
margin-left: .3rem;
}
}
}
}
......
......@@ -38,52 +38,48 @@
}
}
}
}
&-meta {
i {
margin-right: .25rem;
&-meta {
&-item {
&:not(:first-child)::before {
content: '•';
margin: 0 .5rem;
color: var(--color-gray-700);
}
& > span {
&:not(:first-child)::before {
content: '•';
margin: 0 .5rem;
color: var(--color-gray-700);
}
&__icon,
&__info,
&__value {
margin: 0 2px;
}
if (hexo-config('post_meta.created.enable')) {
&-create {
&--createtime {
color: var(--color-gray-700);
}
}
if (hexo-config('post_meta.updated.enable')) {
&-update {
&--updatetime {
color: $post-update-color;
}
}
if (hexo-config('post_meta.reading_time.enable')) {
&-reading-time {
color: $post-reading-time-color;
}
}
if (hexo-config('post_meta.word_count.enable')) {
&-word-count {
&--wordcount {
color: var(--color-gray-700);
}
}
if (hexo-config('busuanzi.post_pv.enable')) {
&-reading-count {
color: $post-reading-count-color;
if (hexo-config('post_meta.reading_time.enable')) {
&--readtime {
color: $post-reading-time-color;
}
}
if (hexo-config('valine.visitor')) {
.leancloud_visitors {
if (hexo-config('busuanzi.post_pv.enable')) {
&--visitors {
color: $post-reading-count-color;
}
}
......
......@@ -15,7 +15,7 @@
}
&-icon {
font-size: 1.5rem;
font-size: 1.2rem;
color: convert(hexo-config('back2top.icon.color') || '#666');
transition: color .2s ease;
transform: rotate(convert(hexo-config('back2top.icon.rotate') || '0'));
......
.external-link {
i {
margin: 0 .1em 0 .3em;
font-size: .8em;
color: convert(hexo-config('external_link.icon.color') || '#aaa');
}
a {
break-word();
}
}
.footer-inner {
.external-link i {
font-size: .7em;
color: #fff;
}
}
.post-header-title {
.external-link i {
font-size: .7em;
}
}
if (hexo-config('external_link.icon.enable')) {
.external-link {
i {
margin: 0 .1em 0 .3em;
font-size: .8em;
color: convert(hexo-config('external_link.icon.color') || '#aaa');
}
a {
break-word();
}
}
.footer-inner {
.external-link i {
color: #fff;
}
}
}
@import './copyright.styl' if (hexo-config('creative_commons.post'));
@import './reward.styl' if (hexo-config('reward.enable'));
@import './back2top.styl' if (hexo-config('back2top.enable'));
@import './external-link.styl' if (hexo-config('external_link.icon.enable'));
@import './fancybox.styl' if (hexo-config('fancybox'));
@import './zoom-image.styl' if (hexo-config('zoom_image.enable'));
@import './gallery-image.styl' if (hexo-config('gallery_waterfall.enable'));
......@@ -9,6 +8,7 @@
@import './loading-bar.styl' if (hexo-config('pjax.enable'));
@import './night-mode.styl' if (hexo-config('night_mode.enable'));
@import './share.styl' if (hexo-config('post_widget.share.enable'));
@import './font-icon.styl';
@import './comments.styl';
@import './copy-button.styl';
@import './sticky-top.styl';
......
......@@ -15,6 +15,7 @@
stick-top-rotate = convert(hexo-config('stick_top.rotate' || '0deg'));
&__i {
font-size: .7rem;
color: convert(hexo-config('stick_top.color' || '#999'));
transform: scale(1.2) rotate(stick-top-rotate);
}
......
......@@ -43,6 +43,12 @@
height: 17rem;
}
&-info {
&-title {
margin-bottom: 1rem;
}
}
&-nav {
&-btn {
display: block;
......@@ -117,6 +123,7 @@
&-info {
&-title {
margin-bottom: 1rem;
font-size: 3rem;
}
......@@ -173,12 +180,17 @@
&-info {
&-title {
margin-bottom: .5rem;
font-size: 2rem;
}
&-subtitle {
font-size: $font-size-base;
}
&-arrow {
bottom: .5rem;
}
}
}
......
......@@ -242,21 +242,14 @@ Stun.utils = Stun.$u = {
* @param {Number} delay Message stay time (unit is 's', default 5s).
*/
popAlert: function (status, text, delay) {
var icon = {
success: 'check-circle',
info: 'exclamation-circle',
warning: 'exclamation-circle',
error: 'times-circle'
};
if ($('.stun-message').length !== 0) {
$('.stun-message').remove();
}
var faPrefix = (CONFIG.fontawesome && CONFIG.fontawesome.prefix) || 'fa';
var $alert = $(
'<div class="stun-message">' +
`<div class="stun-alert stun-alert-${status}">` +
`<i class="stun-alert-icon ${faPrefix} fa-${icon[status]}"></i>` +
`<i class="stun-alert-icon ${CONFIG.fontIcon.prompt[status]}"></i>` +
`<span class="stun-alert-description">${text}</span>` +
'</div>' +
'</div>'
......@@ -387,10 +380,8 @@ Stun.utils = Stun.$u = {
return;
}
var faPrefix = (CONFIG.fontawesome && CONFIG.fontawesome.prefix) || 'fa';
var extIconName = CONFIG.external_link.icon.name;
var $wrapper = $('<span class="external-link"></span>');
var $icon = $(`<i class="${faPrefix} fa-${extIconName}"></i>`);
var $icon = $(`<i class="${CONFIG.external_link.icon.name}"></i>`);
$(container)
.find('a[target="_blank"]')
......@@ -546,10 +537,9 @@ Stun.utils = Stun.$u = {
},
addCopyButton: function (type) {
var btnContainer = '.post-copyright,';
var faPrefix = (CONFIG.fontawesome && CONFIG.fontawesome.prefix) || 'fa';
var $copyIcon = $(
`<div class="copy-button" data-popover="${CONFIG.prompt.copy_button}" data-popover-pos="up">` +
`<i class="${faPrefix} fa-clipboard"></i>` +
`<i class="${CONFIG.fontIcon.copyBtn}"></i>` +
'</div>'
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册