Commit e47248b0 authored by caihaifei's avatar caihaifei

update theme files.

parent ff99bd48
Pipeline #15357 canceled with stage
stun @ 7d8f6db2
Subproject commit 7d8f6db2692a8d1284c346d7af26f22f5867cf6e
# ---------------------------------------------------------------
# Theme Core Configuration Settings
# ---------------------------------------------------------------
# Remove unnecessary files after hexo generate.
shake_file: true
# ---------------------------------------------------------------
# SEO Settings
# ---------------------------------------------------------------
# If true, will add site-subtitle to index page.
# Remember to set up your site-subtitle in Hexo `_config.yml`.
index_subtitle: false
# Set a canonical link tag for your Hexo site.
# See: https://support.google.com/webmasters/answer/139066
# Remember to set up your URL in Hexo `_config.yml` (e.g. url: http://yoursite.com)
canonical: true
# Webmaster tools verification setting
# ---------------------------------------------------------------
# Google Webmaster tools verification setting
# See: https://www.google.com/webmasters/
google_site_verification:
# Bing Webmaster tools verification setting
# See: https://www.bing.com/webmaster/
bing_site_verification:
# Baidu Webmaster tools verification setting
# See: https://ziyuan.baidu.com/site/
baidu_site_verification:
# 360 Webmaster tools verification setting
# see http://zhanzhang.so.com/
qihu360_site_verification:
# Sougou Webmaster tools verification setting
# see http://zhanzhang.sogou.com/
sougou_site_verification:
# ---------------------------------------------------------------
# Menu config
# ---------------------------------------------------------------
# The menu in the website header.
# Value before `||` is the target link, value after `||` is the name of FontAwesome icon.
# Usage(With Icon): `Key: /link/ || fa(s|r|l|d|b) fa-iconname`
# Usage(No Icon) : `Key: /link/`
# Select your icon name, see: https://fontawesome.com/icons
menu:
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.
# xxx1: javascript:; || fa(s|r|l|d|b) fa-xxx
# Secondary menu
submenu:
# Add item of secondary menu in here.
# 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.
icon_only: false
# Only show by text.
text_only: false
# ---------------------------------------------------------------
# Site config
# ---------------------------------------------------------------
favicon:
small: /images/icons/favicon-16x16.png
medium: /images/icons/favicon-32x32.png
# ! --------------------------------------------------
# ! If you don't know the following, please ignore it.
# ! --------------------------------------------------
# apple_touch_icon: /images/icons/apple-touch-icon.png
# safari_pinned_tab: /images/icons/stun-logo.svg
# msapplication: /images/icons/favicon-144x144.png
# Progressive Web Apps
# See: https://github.com/lavas-project/hexo-pwa/
pwa:
enable: false
manifest: /manifest.json
# (Please use "" to wrap the value)
theme_color: "#54bcff"
# Night mode
night_mode:
enable: true
# The button of switching to the night mode.
button:
# Color of button (Please use "" to wrap the value).
color: "#fafafa"
# Background color of button (Please use "" to wrap the value).
bg_color: "#8c8a8a"
# The icon that stand for day and night.
icon:
dark: 🌜
light: 🌞
# The layout for sidebar and content of site.
layout:
# The width of the content area in website.
content: 768px
# The width of the sidebar in website.
sidebar: 300px
# The width between the content and the sidebar.
content_sidebar_gap: 30px
# The padding property of the main tag.
# e.g. Usage:
# 20px
# 20px 30px
# 20px 20px 30px
# 20px 30px 40px 25px
main_padding:
# Take effect when screen width in: [768px, Infinity)
default: 20px
# Take effect when screen width in: [576px, 768px)
tablet: 15px
# Take effect when screen width in: [0px, 576px)
mobile: 10px
# The header of site.
header:
enable: false
show_on:
# Whether to show on the article page.
post: true
# If you set a percentage, it will be calculated based on the height of screen (Supports all CSS units)
height: 80%
# Background image of site header.
bg_image:
enable: false
# In theme directory (source/images): /images/avatar.png
# In site directory (source/uploads): /uploads/avatar.png
# You can also use a link of image.
url:
# Mask effect of the background image.
mask:
enable: false
# Opacity of the mask (value: 0 ~ 1)
opacity: 0.5
nav:
# Height of the navigation bar (Supports all CSS units)
height: 50px
# Background color of the navigation bar (Please use "" to wrap the value).
bg_color: "#333"
# The icon that prompts the user to pull down.
scroll_down_icon:
enable: false
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-angle-down
animation: true
# The body of site.
body:
# Background image of site body.
bg_image:
enable: false
# In theme directory (source/images): /images/avatar.png
# In site directory (source/uploads): /uploads/avatar.png
# You can also use a link of image.
url:
# Whether to fixed the background image.
fixed: true
# Whether to repeat the image as much as possible to cover the entire area.
repeat: false
# Mask effect of the background image.
mask:
enable: false
# Opacity of mask (value: 0 ~ 1)
opacity:
# Opacity of the mask by default.
default: 0.1
# Opacity of the mask in night mode.
night_mode: 0.6
# The footer of site.
footer:
# Background image of site footer.
bg_image:
enable: false
# In theme directory (source/images): /images/avatar.png
# In site directory (source/uploads): /uploads/avatar.png
# You can also use a link of image.
url:
# Mask effect of the background image.
mask:
enable: false
# Opacity of mask (value: 0 ~ 1)
opacity: 0.5
# Copyright information.
copyright:
enable: true
# 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:
# End time. If not set, the current year will be used.
end:
# The icon between the copyright and the owner.
icon:
enable: true
# Icon name in FontAwesome, see: https://fontawesome.com/icons
name: fas fa-heart
# Heartbeat animation.
animation: false
# (Please use "" to wrap the value)
color: "#ff0000"
# Hexo link
powered:
enable: true
# Whether to show version after Hexo link (e.g. vX.X.X)
version: true
# Theme link
theme:
enable: true
# Whether to show version after theme link (e.g. vX.X.X)
version: true
# Beian information for Chinese users, see: http://www.miitbeian.gov.cn/
beian:
enable: false
# 备案 XXXXXXXX 号
icp:
# Any custom text (e.g. Hosted by <a href="https://pages.github.com/" rel="noopener" target="_blank">Github Pages</a>)
custom:
enable: false
text:
# Creative Commons 4.0 International License
creative_commons:
enable: true
# Optional values: BY | BY-SA | BY-ND | BY-NC | BY-NC-SA | BY-NC-ND
# For details, please see: https://creativecommons.org/share-your-work/licensing-types-examples/
license: BY-NC-SA
# Show the CC license in the sidebar.
sidebar: true
# Show the CC license at the post bottom.
post: true
# Optional values:
# id | ms | ca | da | de | en | es | es_ES | eo | eu | fr | gl | hr
# it | lv | lt | hu | nl | no | pt | pt_BR | pl | ro | sl | fi | sv
# tr | is | cs | el | be | ru | zh | zh_TW | uk | ar | fa | bn | ja | ko
# If not set, `en` will be used by default.
language: zh
# Back to top
back2top:
enable: true
icon:
# Icon name in FontAwesome, see: https://fontawesome.com/icons
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
# ---------------------------------------------------------------
# The sidebar of site.
sidebar:
enable: true
# Optional values: left | right
position: right
# The distance from the top of the page when the sidebar is fixed (Only `px` unit is supported)
offsetTop: 20px
# Whether to show horizon line.
horizon_line: false
author:
enable: true
# Avatar in the site sidebar.
avatar:
# In theme directory (source/images): /images/avatar.png
# In site directory (source/uploads): /uploads/avatar.png
# You can also use a link of image.
url: /images/icons/stun-logo.svg
# If true, the avatar would be displayed in a circle.
rounded: false
# Opacity of avatar (value: 0 ~ 1)
opacity: 1
# Mouse hover animation
# Optional values: turn | shake
animation: turn
# Your favorite motto.
motto: 易服前端
# Social links
# 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, see: 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/ || 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/ || fab fa-weibo
# zhihu: https://www.zhihu.com/ || origin:知
# wechat: yournumber || fab fa-weixin
# telegram: yournumber || fab fa-telegram
# qq: yournumber || fab fa-qq
social_setting:
enable: false
# Only show by icon.
icon_only: true
# Table Of Contents in the Sidebar.
toc:
enable: true
# Automatically add list number to toc.
list_number: true
# If true, all words will be placed on the next lines when they overflow.
wrap: true
# If true, the toc of post will always be displayed, rather than the activated part of it.
expand_all: false
# Minimum heading depth of generated toc.
# You can also set it in Front-matter by `toc_max_depth`.
min_depth: 1
# You can also set it in Front-matter by `toc_min_depth`.
# Maximum heading depth of generated toc.
max_depth: 6
# Subscribe of email and rss.
feed:
enable: false
# Enter your email subscription link (e.g. http://eepurl.com/guAE6j)
email:
# Enter the rss address of you set (e.g. /atom.xml)
# 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.
reading_progress:
enable: true
# (Please use "" to wrap the value)
color: "#fc6423"
height: 1px
# ---------------------------------------------------------------
# Page config
# ---------------------------------------------------------------
codeblock:
# The style of code block.
# Optional values: default | simple | carbon
style: default
# The theme of code highlight.
# Optional values: light | dark | ocean
highlight: light
# Whether to wrap when code overflow.
word_wrap: false
# Add a line below h1, h2 tags.
heading_line: true
# Reward QR Code
reward:
enable: false
# Your QR code for collecting money.
alipay:
wechat:
# ---------------------------------------------------------------
# Post config
# ---------------------------------------------------------------
# The information of post.
post_meta:
# Only show by icon.
icon_only: false
# The create time of post.
created:
enable: true
# 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/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/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
# 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/icons
icon: far fa-file-word
# The article list on the homepage or archives page.
post_list:
# Whether to paginate.
paginate:
home: true
archives: false
# Whether to show the cover image of post.
cover_image:
home: false
# The widget of post.
post_widget:
# Whether to show tags at the bottom of post.
tags: true
# Whether to show "------ END ------" at the bottom of post.
end_text:
enable: true
# Whether to show a horizon line before "------ END ------".
horizon_line: true
# Article sharing
share:
enable: false
# The text displayed before the share button.
label: "Share to: "
# Optional values: qzone | qq | weibo | wechat | douban | linkedin | facebook | twitter | google
target: qzone, qq, weibo, wechat, douban, linkedin, facebook, twitter, google
# Stick post to the top
# 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
# Optional values: left | right
position: right
# Icon name in FontAwesome, see: https://fontawesome.com/icons
icon: fas fa-thumbtack
# Rotation Angle of icon.
rotate: 45deg
# (Please use "" to wrap the value)
color: "#999"
# ---------------------------------------------------------------
# Comment config
# ---------------------------------------------------------------
# Gittalk
# See: https://github.com/gitalk/gitalk/
gitalk:
enable: false
# Github username.
owner:
# Github repository.
repo:
# Github Application Client ID.
client_id:
# Github Application Client Secret.
client_secret:
# GitHub repo owner and collaborators, only these guys can initialize github issues.
admin:
# 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.
# Optional values: en | zh-CN | es-ES | fr | ru | zh-TW
language: zh-CN
# Waline
# 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
# Custom comment header.
meta: nick,mail,link
# The number of comments per page.
pageSize: 10
# Optional values: en | zh-CN | zh-TW | jp
lang: zh-CN
# Article reading statistics.
visitor: false
# Valine
# See: https://valine.js.org/quickstart.html
valine:
enable: false
# Your leancloud application appid.
appid:
# Your leancloud application appkey.
appkey:
# Mail notifier.
notify: true
# Verification code.
verify: true
# Comment box placeholder.
placeholder: Just go go
# Gravatar style.
avatar: mp
# Custom comment header.
meta: nick,mail,link
# Pagination size.
pageSize: 10
# Article reading statistics.
visitor: false
# Whether to record the commenter IP.
recordIP: false
# Optional values: en | zh-cn
language: zh-cn
# MiniValine
# See: https://github.com/MiniValine/MiniValine#Options
minivaline:
enable: false
appId: # Your leancloud application appid
appKey: # Your leancloud application appkey
placeholder: Write a Comment # Comment box placeholder
adminEmailMd5: # The MD5 of Admin Email to show Admin Flag.
math: true # Support MathJax.
md: true # Support Markdown.
# MiniValine'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
# Optional values: en | zh-CN | (and many more)
# More i18n info: https://github.com/MiniValine/minivaline-i18n
lang: zh-CN
# Livere
# See: https://www.livere.com/
livere:
enable: false
uid:
# Disqus
# See: https://disqus.com/
disqus:
enable: false
shortname:
count: true
# Utterances
# See: https://utteranc.es/
utterances:
enable: false
# Github username.
owner:
# Github repository.
repo:
# Choose the mapping between blog posts and GitHub issues.
# Optional values: pathname | url | title | og:title
mapping: title
# Choose the label that will be assigned to issues created by Utterances.
# Emoji are supported in label names.
label: utterances
# Choose an Utterances theme that matches your blog.
# Optional values: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark
theme: github-light
# ! -------------------------------------------------------------------------------
# ! Don't set this unless the URL of the script in the official website is changed.
# ! -------------------------------------------------------------------------------
script_url: https://utteranc.es/client.js
# Facebook Comments
# See: https://developers.facebook.com/docs/plugins/comments
fbcomments:
enable: false
# The ID of your own Facebook App.
appId:
# See: https://developers.facebook.com/docs/internationalization#locales
# Example: en_US | zh_CN | zh_HK ... and so on. For detail, see: ☝
lang: zh-CN
# Number of comments displayed by default.
numPosts: 10
# See: https://developers.facebook.com/docs/plugins/comments#sorting
# Optional values: social | reverse_time | time
order_by: reverse_time
# Optional values: true | false
lazy: true
# Whether to optimize the display on the mobile.
# Optional values: true | false
mobile: true
width: 100%
# ---------------------------------------------------------------
# Statistics and Analytics config
# ---------------------------------------------------------------
# Busuanzi statistics
# See: https://busuanzi.ibruce.info/
busuanzi:
enable: false
# Only show by icon.
icon_only: false
# Number of unique visitor to the entire site.
site_uv:
enable: true
# 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: fas fa-eye
# Number of page view to a post.
post_pv:
enable: true
icon: fas fa-eye
# Google analytics ID
# See: https://analytics.google.com/
google_analytics:
# Baidu analytics ID
# See: https://tongji.baidu.com/
baidu_analytics:
# Tencent analytics ID
# See: https://v2.ta.qq.com/
tencent_analytics:
# ---------------------------------------------------------------
# Search config
# ---------------------------------------------------------------
# Algolia Search
# Dependency: https://github.com/algolia/instantsearch.js/
algolia_search:
enable: false
hits:
# Number of search results displayed per page.
per_page: 10
labels:
# Whether to show stats of search.
show_stats: true
# Local Search
# See: https://github.com/wzpan/hexo-generator-search/
local_search:
enable: false
# Auxiliary search buttons
# ! -----------------------------------------------------------------------------------------
# ! This feature can only be enabled if either `algolia_search` or `local_search` is enabled.
# ! -----------------------------------------------------------------------------------------
assist_search:
enable: false
# Show the Google Search button. Use `www.google.com` to search for what you type.
google: true
# Show the Bing Search button. Use `www.bing.com` to search for what you type.
bing: true
# Show the Baidu Search button. Use `www.baidu.com` to search for what you type.
baidu: true
# ---------------------------------------------------------------
# Background config
# ---------------------------------------------------------------
# Canvas-ribbon
# Dependency: https://github.com/hustcc/ribbon.js
canvas_ribbon:
enable: false
# The width of the ribbon.
size: 120
# The transparency of the ribbon.
alpha: 0.6
# The display level of the ribbon.
zIndex: -1
# Canvas-nest
# Dependency: https://github.com/hustcc/canvas-nest.js
canvas_nest:
enable: false
# Color of lines.
# RGB values, use `,` to separate.
color: "0,0,0"
# The opacity of lines (value: 0 ~ 1)
opacity: 0.6
# The number of lines.
count: 99
# `z-index` property of the background.
zIndex: -1
# ---------------------------------------------------------------
# Math and Chart config
# ---------------------------------------------------------------
math:
enable: false
# If true, this function will be enabled on every page.
# If false, this function will be enabled only if the page where `math: true` is set in `Front-matter`.
per_page: false
# ! -------------------------------------------------------------------------------
# ! Please see the documentation before using. See:
# ! https://theme-stun.github.io/docs/zh-CN/advanced/third-part.html#mathjax
# ! -------------------------------------------------------------------------------
# Optional values: mathjax | katex
engine: katex
mathjax:
cdn: https://cdn.jsdelivr.net/npm/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML
# See: https://mhchem.github.io/MathJax-mhchem/
mhchem:
enable: false
mhchem_js: https://cdn.jsdelivr.net/npm/mathjax-mhchem@3.3.2/mhchem.min.js
katex:
cdn: https://cdn.jsdelivr.net/npm/katex@0.10.2/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
# ---------------------------------------------------------------
# Other config
# ---------------------------------------------------------------
# Fancybox
# See: https://fancyapps.com/fancybox/3/
fancybox: false
# Click to enlarge picture.
zoom_image:
enable: true
# The color of mask.
# (Please use "" to wrap the value)
mask_color: "rgba(0,0,0,0.6)"
# The gap between image and a edge of screen when image is enlarged.
# (Only `px` unit is supported)
gap_aside: 20px
# If you are use "photos" attribute in the Front-matter,
# you can enable this to show images in waterfalls flow.
# See: https://github.com/desandro/masonry/
gallery_waterfall:
enable: false
col_width: 220px
gap_x: 10px
gap_y: 10px
# Lazy load the images of post.
# See: https://github.com/tuupola/lazyload
lazyload:
enable: false
# Optional values: gif | block
placeholder: gif
# Quicklink support
# See: https://github.com/GoogleChromeLabs/quicklink/
quicklink:
enable: false
# Quicklink (quicklink.umd.js script) is loaded on demand.
# Add `quicklink: true` in Front-matter of the page or post you need.
# Home page and archive page can be controlled through home and archive options below.
home: true
archive: true
# Initialize quicklink after the load event fires.
delay: true
# Custom a time in milliseconds by which the browser must execute prefetching.
timeout: 10000
# Enable fetch() or falls back to XHR.
priority: true
# For more flexibility you can add some patterns (RegExp, Function, or Array) to ignores.
# See: https://github.com/GoogleChromeLabs/quicklink#custom-ignore-patterns
# ! --------------------------------------------------
# ! If you don't know the following, please ignore it.
# ! --------------------------------------------------
ignores:
- /\/api\/?/
- uri => uri.includes('.xml')
- uri => uri.includes('.zip')
- (uri, el) => el.hasAttribute('nofollow')
- (uri, el) => el.hasAttribute('noprefetch')
# Pjax
# See: https://github.com/MoOx/pjax/
pjax:
enable: false
# When switching pages, scroll to the bottom of the top image.
avoid_banner: false
# ! --------------------------------------------------
# ! If you don't know the following, please ignore it.
# ! --------------------------------------------------
# Please see: https://github.com/MoOx/pjax/#options
elements:
selectors:
switches:
switchesOptions:
history: true
# If you enable this, you must set `avoid_banner: false` firstly.
scrollTo: false
scrollRestoration: false
cacheBust: false
debug: false
currentUrlFullReload: false
timeout: 0
# Google AdSense
google_adsense:
enable: false
client:
js_src: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
# The links with `target="_blank"` attribute.
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/icons
name: fas fa-external-link-alt
# (Please use "" to wrap the value)
color: "#aaa"
# The shortcuts of the site.
shortcuts:
# Switch to the prev / next post by key.
# `Ctrl + ←` is the shortcuts to prev post.
# `Ctrl + →` is the shortcuts to next post.
switch_post:
enable: false
# Tag cloud
# If not used, comment it or ignore it.
tag_cloud:
# (Please use "" to wrap the value)
start_color: "#a4d8fa"
end_color: "#49b1f5"
# Size for tag.
min_size: 16
max_size: 26
# Maximum number of tags displayed. Change it if you have more than 200 tags.
max_amount: 200
# Eliminate the old version of IE browser (IE6~11).
# See: https://support.dmeng.net/upgrade-your-browser.html
kill_old_ie:
enable: false
# The URL of warning page (Please use "" to wrap the value).
# ! ----------------------------------------------------------------
# ! Usually you don't need to set this option, just use the default.
# ! ----------------------------------------------------------------
warning_url: https://support.dmeng.net/upgrade-your-browser.html
# Assets
# In theme directory (source/css)
css: css
# In theme directory (source/js)
js: js
# In theme directory (source/images)
images: images
# 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
waline_visitor: fas fa-eye
valine_visitor: fas fa-eye
post_heading: fas fa-link
notetag_default: fas fa-arrow-circle-right
notetag_success: fas fa-check-circle
notetag_info: fas fa-info-circle
notetag_warning: fas fa-exclamation-circle
notetag_danger: fas fa-minus-circle
google: fab fa-google
# bing: fab fa-bing # not exist
# Set a CDN address for the vendor you want to customize.
# ! -------------------------------------------------------------------
# ! Do not edit the follow configs, unless you know what you are doing.
# ! -------------------------------------------------------------------
cdn:
# Using version: 5.12.1
# See: https://fontawesome.com/
# Example:
# 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.12.1/css/all.min.css
fontawesome:
# Using version: 3.4.1
# 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:
# Using version: 1.5.2
# See: http://velocityjs.org/
# Example:
# velocity: //cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js
# velocity: //cdnjs.cloudflare.com/ajax/libs/velocity/1.5.2/velocity.min.js
# velocity_ui: //cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js
# velocity_ui: //cdnjs.cloudflare.com/ajax/libs/velocity/1.5.2/velocity.ui.min.js
velocity:
velocity_ui:
# gitalk & js-md5
# Using version: latest & latest
# See: https://github.com/gitalk/gitalk/, https://github.com/emn178/js-md5/
# Example:
# gitalk_js: //cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
# gitalk_css: //cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.css
# md5: //cdn.jsdelivr.net/npm/js-md5@latest/src/md5.min.js
gitalk_js:
gitalk_css:
gitalk_md5:
# valine & leancloud-storage
# Using version: latest & latest
# See: https://github.com/xCss/Valine/, https://www.npmjs.com/package/leancloud-storage/
# Example:
# valine: //cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js
# leancloud_storage: //cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js
valine:
leancloud_storage:
# Waline
# See: https://github.com/lizheming/waline
# Example:
# waline: //unpkg.com/@waline/client@0.8.5/dist/Waline.min.js
waline:
# minivaline
# See: https://github.com/MiniValine/MiniValine
# Example:
# minivaline: //cdn.jsdelivr.net/npm/minivaline/dist/MiniValine.min.js
minivaline:
# busuanzi
# Using version: latest
# See: https://busuanzi.ibruce.info/
# Example:
# busuanzi: //cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js
busuanzi:
# Using version: 2.1.1
# See: https://busuanzi.ibruce.info/
# Example:
# instantsearch_js: //cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js
# instantsearch_css: //cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css
instantsearch_js:
instantsearch_css:
# Using version: latest
# See: https://github.com/hustcc/ribbon.js
# Example:
# canvas_ribbon: //cdn.jsdelivr.net/npm/ribbon.js@latest/dist/ribbon.min.js
canvas_ribbon:
# Using version: latest
# See: https://github.com/hustcc/canvas-nest.js
# Example:
# canvas_nest: //cdn.jsdelivr.net/npm/canvas-nest.js@1.0.1/dist/canvas-nest.min.js
canvas_nest:
# Using version: 3.5.7
# See: https://www.fancyapps.com/fancybox/3/
# Example:
# fancybox_js: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js
# fancybox_css: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
fancybox_js:
fancybox_css:
# Using version: 4.2.2
# See: https://masonry.desandro.com/
# Example:
# masonry: //cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js
masonry:
# Using version: 2.0.0-rc.2
# See: https://github.com/tuupola/lazyload/
# Example:
# lazyload: //cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js
lazyload:
# Using version: latest
# See: https://github.com/GoogleChromeLabs/quicklink/
# Example:
# quicklink: //cdn.jsdelivr.net/npm/quicklink@latest/dist/quicklink.umd.js
quicklink:
# Using version: latest
# See: https://github.com/MoOx/pjax/
# Example:
# pjax: //cdn.jsdelivr.net/npm/pjax@latest/pjax.min.js
pjax:
# Using version: 1.0.16
# See: https://github.com/overtrue/share.js
# Example:
# share_js: //cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js
# share_css: //cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css
share_js:
share_css:
# Site title
title:
home: Home
archive: Archive
category: Category
tag: Tag
# Header nav
nav:
search: Search
# Header menu
menu:
home: Home
archives: Archives
categories: Categories
tags: Tags
about: About
# Archives page, Categories page, Tags page
page:
tags: Tags
categories: Categories
posts-empty: No articles
posts-total: Total %s Articles, Go on!
# Sidebar
sidebar:
overview: Overview
catalog: Catalog
subscribe: Subscribe
archives: Archives
categories: Categories
tags: Tags
read_info: You have read
# Social link
social:
github: Github
google: Google
twitter: Twitter
youtube: Youtube
segmentfault: Segmentfault
zhihu: Zhihu
weibo: Weibo
wechat: Wechat
telegram: Telegram
qq: QQ
# Article
post:
created: Created
updated: Updated
word_count: Words
reading_count: Visited
reading_time: Reading
reading_unit: m
read_more: Read More
sticky: Sticky
untitled: "[ Untitled ]"
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
# Algolia search
algolia_search:
input_placeholder: Search for Posts
hits_empty: "We didn't find any results for the search: ${query}"
hits_stats: '${hits} results found in ${time} ms'
# Local search
local_search:
input_placeholder: Search for Posts (Support multiple keywords)
hits_empty: We didn't find any results for the search
# Auxiliary search buttons
assist_search:
prompt_label: "Search by:"
prompt_input: Please enter characters
google: Google
bing: Bing
baidu: Baidu
# Reward
reward:
btn_text: Buy me a coffee
alipay: Alipay
wechat: Wechat
# Site footer
footer:
powered: Powered by %s
theme: Theme
site_uv: Visitors
site_pv: Views
# Prompt message
prompt:
copy_success: Copy Success
copy_error: Copy Error
popover:
copy_button: Copy
creative_commons: Creative Commons
post:
create_time: Created Time
update_time: Updated Time
word_count: Words Count
reading_time: Reading Time
visit_num: Visitors
site_uv: Unique Visitor
site_pv: Page View
# Site title
title:
home: Inicio
archive: Archivo
category: Categoría
tag: Etiqueta
# Header nav
nav:
search: Búsqueda
# Header menu
menu:
home: Inicio
archives: Archivos
categories: Categorías
tags: Etiquetas
about: Sobre Nosotros
# Archives page, Categories page, Tags page
page:
tags: Etiquetas
categories: Categorías
posts-empty: Sin artículos
posts-total: Hay %s artículos en total, ¡Adelante!
# Sidebar
sidebar:
overview: Reseña
catalog: Contenido
subscribe: Suscríbete
archives: Archivo
categories: Categorías
tags: Etiquetas
read_info: Has leído
# Social link
social:
github: Github
google: Google
twitter: Twitter
youtube: Youtube
segmentfault: Segmentfault
zhihu: Zhihu
weibo: Weibo
wechat: Wechat
telegram: Telegram
qq: QQ
# Article
post:
created: Creado
updated: Actualizado
word_count: Palabras
reading_count: Visitado
reading_time: Leyendo
reading_unit: m
read_more: Leer más
sticky: pegajoso
untitled: "[ Sin título ]"
end: ------ FIN ------
copyright:
author: Autor
link: Enlace
license_title: Copyright
license_content: Todos los artículos de este blog están bajo licencia de <a href="%s" rel="external nofollow" target="_blank">%s</a> a menos que se indique lo contrario
# Algolia search
algolia_search:
input_placeholder: Buscar entradas
hits_empty: "No encontramos resultados para la búsqueda: ${query}"
hits_stats: '${hits} resultados encontrados en ${time} ms'
# Local search
local_search:
input_placeholder: Buscar entradas (Soporte para varias palabras)
hits_empty: No encontramos resultados para la búsqueda
# Reward
reward:
btn_text: Cómprame un café
alipay: Alipay
wechat: Wechat
# Site footer
footer:
powered: Potenciado por %s
theme: Tema
site_uv: Visitantes
site_pv: Vistas
# Prompt message
prompt:
copy_success: Éxito en copia
copy_error: Error en copia
popover:
copy_button: Copiar
creative_commons: Creative Commons
post:
create_time: Hora de creación
update_time: Hora de actualización
word_count: Conteo de palabras
reading_time: Tiempo de lectura
visit_num: Visitantes
site_uv: Visitantes únicos
site_pv: Vista de página
# 网站标题
title:
home: 首页
archive: 归档
category: 分类
tag: 标签
# 导航栏
nav:
search: 搜索
# 导航栏菜单
menu:
home: 首页
archives: 归档
categories: 分类
tags: 标签
about: 关于
# 归档页、分类页、标签页
page:
tags: 标签
categories: 分类
posts-empty: 目前还没有文章哦!
posts-total: 目前共计 %s 篇文章,继续加油!
# 侧边栏
sidebar:
overview: 站点概览
catalog: 文章目录
subscribe: 订阅
archives: 归档
categories: 分类
tags: 标签
read_info: 你已阅读了
# 社交链接
social:
github: Github
google: Google
twitter: Twitter
youtube: Youtube
segmentfault: 思否
zhihu: 知乎
weibo: 微博
wechat: 微信
telegram: Telegram
qq: QQ
# 文章
post:
created: 发表于
updated: 更新于
word_count: 字数统计
reading_count: 阅读次数
reading_time: 阅读时长
reading_unit:
read_more: 阅读全文
sticky: 置顶文章
untitled: "[ 文章无标题 ]"
end: ------ 本文结束,感谢您的阅读 ------
copyright:
author: 本文作者
link: 本文链接
license_title: 版权声明
license_content: 本博客所有文章除特别声明外,均采用 <a href="%s" rel="external nofollow" target="_blank">%s</a> 许可协议。转载请注明出处!
# Algolia 搜索
algolia_search:
input_placeholder: 搜索文章
hits_empty: '没有找到任何搜索结果:${query}'
hits_stats: '找到 ${hits} 条搜索结果,耗时 ${time} 毫秒'
# 本地搜索
local_search:
input_placeholder: 搜索文章(支持多关键词,请用空格分隔)
hits_empty: 没有找到任何搜索结果
# 搜索的辅助按钮
assist_search:
prompt_label: "使用搜索:"
prompt_input: 请输入字符
google: 谷歌
bing: 必应
baidu: 百度
# 打赏
reward:
btn_text: 请我喝杯咖啡~
alipay: 支付宝打赏
wechat: 微信打赏
# 网站底部
footer:
powered: 由 %s 强力驱动
theme: 主题
site_uv: 访问人数
site_pv: 浏览总量
# 提示信息
prompt:
copy_success: 复制成功
copy_error: 复制失败
popover:
copy_button: 复制
creative_commons: 知识共享许可协议
post:
create_time: 发表时间
update_time: 修改时间
word_count: 字数统计
reading_time: 阅读时间
visit_num: 阅读次数
site_uv: 访问人数
site_pv: 浏览总量
# 網站標題
title:
home: 首頁
archive: 歸檔
category: 分類
tag: 標籤
# 巡覽列
nav:
search: 檢索
# 巡覽列選單
menu:
home: 首頁
archives: 歸檔
categories: 分類
tags: 標籤
about: 關於
# 歸檔頁、分類頁、標籤頁
page:
tags: 標籤
categories: 分類
posts-empty: 現時還沒有文章哦!
posts-total: 現時共計 %s 篇文章,繼續加油!
# 側邊欄
sidebar:
overview: 本站概覽
catalog: 文章目錄
subscribe: 訂閱
archives: 歸檔
categories: 分類
tags: 標籤
read_info: 你已閱讀了
# 社交連結
social:
github: Github
google: Google
twitter: Twitter
youtube: Youtube
segmentfault: 思否
zhihu: 知乎
weibo: 微博
wechat: 微信
telegram: Telegram
qq: QQ
# 文章
post:
created: 發表於
updated: 更新於
word_count: 字數統計
reading_count: 閱讀次數
reading_time: 閱讀時長
reading_unit:
read_more: 閱讀全文
sticky: 置頂文章
untitled: "[ 文章無標題 ]"
end: ------ 本文結束,感謝您的閱讀 ------
copyright:
author: 本文作者
link: 本文連結
license_title: 版權聲明
license_content: 本部落格所有文章除特別聲明外,均採用 <a href="%s" rel="external nofollow" target="_blank">%s</a> 許可協議。轉載請注明出處!
# Algolia 檢索
algolia_search:
input_placeholder: 檢索文章
hits_empty: '沒有找到任何檢索結果:${query}'
hits_stats: '找到 ${hits} 條檢索結果,耗時 ${time} 毫秒'
# 本地檢索
local_search:
input_placeholder: 檢索文章(支持多關鍵字,請用空格分隔)
hits_empty: 沒有找到任何檢索結果
# 搜索的輔助按鈕
assist_search:
prompt_label: "使用搜索:"
prompt_input: 請輸入字符
google: 谷歌
bing: 必應
baidu: 百度
# 打賞
reward:
btn_text: 請我喝杯咖啡~
alipay: 支付寶打賞
wechat: 微信打賞
# 網站底部
footer:
powered: 由 %s 強力驅動
theme: 主題
site_uv: 訪客總數
site_pv: 總瀏覽次數
# 提示信息
prompt:
copy_success: 複製成功
copy_error: 複製失敗
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 isNoHeader = !theme.header.enable || (is_post() && !theme.header.show_on.post);
var isEnableNoHeader = !theme.header.enable || !theme.header.show_on.post;
var isShowReward = typeof page.reward === 'boolean' ? page.reward === true : (theme.reward.enable && is_post());
var isShowCC = typeof page.copyright === 'boolean' ? page.copyright === true : (theme.creative_commons.enable && is_post());
var pjax = false;
var dataPjax = {};
if (theme.pjax.enable) {
pjax = true;
dataPjax = { 'data-pjax': '' };
}
var ccLicense = '';
var ccLanguage = '';
if (theme.creative_commons) {
var cc = theme.creative_commons;
ccLicense = cc.license && cc.license.toLowerCase();
ccLanguage = cc.language && cc.language.toLowerCase() || 'en';
}
var ccUrl = `https://creativecommons.org/licenses/${ccLicense}/4.0/deed.${ccLanguage}`;
doctype html
html(lang=config.language)
head
include ./_partials/head/head.pug
body
div#container.container
header#header.header
div.header-inner(class=`${isNoHeader ? 'header-inner--height header-inner--bgcolor' : ''}`)
include ./_partials/header/header.pug
main#main.main
div.main-inner
div#content-wrap.content-wrap(
class=`${page.sidebar === false ? 'content-wrap--noside' : ''}`
)
div#content.content(class=`${is_home() ? 'content-home' : ''}`)
block content
if (is_archive() && theme.post_list.paginate.archives) || is_category() || is_tag()
include ./_partials/widgets/paginator.pug
if page.comments
include ./_partials/widgets/comments.pug
if page.sidebar !== false && theme.sidebar.enable
div#sidebar-wrap.sidebar-wrap
aside#sidebar.sidebar
include ./_partials/sidebar/sidebar.pug
div.clearfix
footer#footer.footer
div.footer-inner
include ./_partials/footer/footer.pug
include ./_partials/widgets/loading-bar.pug
if theme.back2top.enable
include ./_partials/widgets/back2top.pug
include ./_partials/search/index.pug
include ./_scripts/vendors.pug
include ./_third-party/search/index.pug
if pjax
include ./_third-party/pjax.pug
div#pjax-reload
include ./_third-party/math/index.pug
include ./_third-party/quicklink.pug
include ./_third-party/analytics/busuanzi.pug
else
include ./_third-party/math/index.pug
include ./_third-party/quicklink.pug
include ./_third-party/analytics/busuanzi.pug
include ./_third-party/comments/index.pug
include ./_scripts/stun.pug
mixin gallery(post)
div.gallery
each photo in post.photos
img(src=url_for(photo))
mixin menuItem(menu, className)
each value, name in (menu || {})
if name && value
-
var item = value.split('||');
var menuPath = item[0] ? item[0].trim() : '/';
var menuIcon = item[1] ? item[1].trim() : false;
var hasSubMenu = menuPath.toLowerCase() === 'javascript:;';
var aTagAttr = {};
if (hasSubMenu) aTagAttr.onclick = 'return false;';
div(class=`header-nav-${className || ''}menu-item`)
a(
href=hasSubMenu ? 'javascript:;' : menuPath
class=`header-nav-${className || ''}menu-item__link`
)&attributes(aTagAttr)
if !theme.menu_settings.text_only && menuIcon
span(class=`header-nav-${className || ''}menu-item__icon`)
i(class=menuIcon)
if !theme.menu_settings.icon_only
span(class=`header-nav-${className || ''}menu-item__text`)= __(`menu.${name}`)
if hasSubMenu
div.header-nav-submenu
+menuItem(theme.submenu[name], 'sub')
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
include ../_partials/widgets/sticky-top.pug
h1.post-title
if post.link
a.post-title__link(href=url_for(post.link) target="_blank" rel="noopener" )
= post.title || post.link
else if is_post()
= post.title || __('post.untitled')
else
a.post-title__link(href=url_for(post.path))
= post.title || __('post.untitled')
if !post.link
- var isPostMetaIconOnly = theme.post_meta.icon_only;
div.post-meta
if theme.post_meta.created.enable
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-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-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
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.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
- var iconClass = theme.icon.waline_visitor;
+postMetaItem({
isIconOnly: isPostMetaIconOnly,
iconClass: iconClass,
iconText: __('post.reading_count'),
popoverPos: 'up',
popoverText: __('popover.post.visit_num'),
valueAttr: {
class: 'leancloud-visitors-count'
}
})
if theme.valine.enable && theme.valine.visitor
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-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'
}
})
mixin timeline(posts)
section.timeline
- var year, tmpYear;
- var sortPosts = [];
//- Sort posts by date in descending order.
each post in posts
if sortPosts.length === 0
- sortPosts.push(post)
else
each sPost, index in sortPosts
- var isBigTime = new Date(post.date).getTime() > new Date(sPost.date).getTime();
if post.top
if !sPost.top || isBigTime
- sortPosts.splice(index, 0, post)
- break
else if index + 1 === sortPosts.length
- sortPosts.push(post)
- break
else
if !sPost.top && isBigTime
- sortPosts.splice(index, 0, post)
- break
else if index + 1 === sortPosts.length
- sortPosts.push(post)
- break
each post in sortPosts
if post.date
- tmpYear = full_date(post.date, 'YYYY')
if tmpYear !== year
- year = tmpYear
time.timeline-item.timeline-item--year= year
article.timeline-item
if post.date
time.timeline-item__time= full_date(post.date, 'MM-DD')
h2.timeline-item__title
if post.link
a(
class="timeline-item__link"
href=url_for(post.link)
target="_blank"
rel="noopener"
)= post.title || post.link
else
a(
class="timeline-item__link"
href=url_for(post.path)
)= post.title || __('post.untitled')
if post.top
include ../_partials/widgets/sticky-top.pug
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-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_pv.enable
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
-
var algolia = 'undefined';
var env = process.env;
if (theme.algolia_search.enable) {
algolia = JSON.stringify({
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
hits: theme.algolia_search.hits,
languages: {
inputPlaceholder: __('algolia_search.input_placeholder'),
hitsEmpty: __('algolia_search.hits_empty'),
hitsStats: __('algolia_search.hits_stats')
}
});
}
var assistSearch = 'undefined';
if (theme.assist_search.enable) {
assistSearch = [];
for (var key in theme.assist_search) {
var value = theme.assist_search[key];
if (value && key !== 'enable') {
assistSearch.push(key);
}
}
assistSearch = JSON.stringify(assistSearch);
}
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
});
}
var sidebar = 'undefined';
if (theme.sidebar.enable) {
sidebar = JSON.stringify({
offsetTop: theme.sidebar.offsetTop,
tocMaxDepth: theme.toc.max_depth
});
}
var header = 'undefined';
if (theme.header.enable) {
var isScrollDownIcon = theme.header.scroll_down_icon.enable || false;
header = JSON.stringify({
enable: theme.header.enable,
showOnPost: theme.header.show_on.post,
scrollDownIcon: isScrollDownIcon,
});
}
var postWidget = 'undefined';
if (theme.post_widget) {
var endText = theme.post_widget.end_text.enable || false;
if (endText) {
postWidget = JSON.stringify({
endText: endText,
});
}
}
var nightMode = 'undefined';
if (theme.night_mode.enable) {
nightMode = JSON.stringify({
enable: theme.night_mode.enable,
});
}
var back2top = 'undefined';
if (theme.back2top.enable) {
back2top = JSON.stringify({
enable: theme.back2top.enable
});
}
var codeStyle = theme.codeblock.style || 'default';
var highlight = theme.codeblock.highlight || 'light';
var wordWrap = theme.codeblock.word_wrap || false;
var codeblock = JSON.stringify({
style: codeStyle,
highlight: highlight,
wordWrap: wordWrap
});
var zoomImage = 'undefined';
if (theme.zoom_image.enable) {
zoomImage = JSON.stringify({
gapAside: theme.zoom_image.gap_aside
});
}
var galleryWaterfall = 'undefined';
if (theme.gallery_waterfall.enable) {
galleryWaterfall = JSON.stringify({
colWidth: theme.gallery_waterfall.col_width,
gapX: theme.gallery_waterfall.gap_x
});
}
var pjaxConfig = 'undefined';
if (theme.pjax.enable) {
pjaxConfig = JSON.stringify({
avoidBanner: theme.pjax.avoid_banner
});
}
var externalLink = 'undefined';
if (theme.external_link) {
var iconEnable = theme.external_link.icon.enable || false;
var iconName = theme.external_link.icon.name || '';
if (iconEnable) {
externalLink = JSON.stringify({
icon: {
enable: iconEnable,
name: iconName
}
});
}
}
var shortcuts = 'undefined';
if (theme.shortcuts) {
var isSwitchPost = theme.shortcuts.switch_post.enable || false;
if (isSwitchPost) {
shortcuts = JSON.stringify({
switchPost: isSwitchPost
});
}
}
var prompt = JSON.stringify({
copyButton: __('popover.copy_button'),
copySuccess: __('prompt.copy_success'),
copyError: __('prompt.copy_error')
});
var sourcePath = JSON.stringify({
js: theme.js,
css: theme.css,
images: theme.images
});
script.
var Stun = window.Stun || {};
var CONFIG = {
root: '!{ config.root }',
algolia: !{ algolia },
assistSearch: !{ assistSearch },
fontIcon: !{ fontIcon },
sidebar: !{ sidebar },
header: !{ header },
postWidget: !{ postWidget },
nightMode: !{ nightMode },
back2top: !{ back2top },
codeblock: !{ codeblock },
reward: !{ isShowReward },
fancybox: !{ theme.fancybox },
zoomImage: !{ zoomImage },
galleryWaterfall: !{ galleryWaterfall },
lazyload: !{ theme.lazyload.enable },
pjax: !{ pjaxConfig },
externalLink: !{ externalLink },
shortcuts: !{ shortcuts },
prompt: !{ prompt },
sourcePath: !{ sourcePath },
};
window.CONFIG = CONFIG;
-
var footer = theme.footer;
var nowYear = new Date().getFullYear();
var startYear = footer.copyright.since || nowYear;
var endYear = footer.copyright.end || nowYear;
var footerCopyright = footer.copyright.enable
var footerBeian = footer.beian.enable
if footerCopyright || footerBeian
div
if footerCopyright
span= `Copyright © ${startYear}` + ((startYear !== endYear) ? `~${endYear}` : '')
if footer.icon.enable
span(class="footer__icon")
i(class=footer.icon.name)
else
span.footer__devider
span!= footer.copyright.text || config.author
if footerCopyright && footerBeian
span.footer__devider= '|'
if footerBeian
span!= footer.beian.icp
-
var footerPowered = footer.powered.enable
var footerTheme = footer.theme.enable
if footerPowered || footerTheme
div
if footerPowered
span
!= _p('footer.powered', link_to(HEXO_URL, 'Hexo', { external: true }))
if footer.powered.version
span= ' v' + hexo_env('version')
if footerPowered && footerTheme
span.footer__devider= '|'
if footerTheme
span= __('footer.theme') + ' - '
!= link_to(STUN_URL, 'Stun', { external: true })
if footer.theme.version
span= ' v' + stun_env('version')
if theme.busuanzi.enable
include ../analytics/busuanzi.pug
if footer.custom.enable
div!= footer.custom.text
-
var title = __('title') !== 'title' ? __('title') : config.title;
var subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle;
var author = __('author') !== 'author' ? __('author') : config.author;
var description = __('description') !== 'description' ? __('description') : config.description;
var keywords = config.author + ', ' + config.title;
var title_suffix = ' | ' + title;
if (is_home()) {
title = title + ((theme.index_subtitle && subtitle) ? (' | ' + subtitle) : '');
} else if (is_archive()) {
title = __('title.archive') + title_suffix;
} else if (is_category()) {
title = __('title.category') + ': ' + page.category + title_suffix;
} else if (is_tag()) {
title = __('title.tag') + ': ' + page.tag + title_suffix;
} else if (is_post()) {
title = (page.title || __('post.untitled')) + title_suffix;
} else {
if (page.type === 'tags') {
title = __('title.tag') + title_suffix;
} else if (page.type === 'categories') {
title = __('title.category') + title_suffix;
} else {
title = page.title + title_suffix;
}
}
meta(charset="UTF-8")
meta(http-equiv="X-UA-Compatible" content="IE=edge")
if (theme.kill_old_ie && theme.kill_old_ie.enable)
include ./kill-old-ie.pug
meta(name="viewport" content="width=device-width, initial-scale=1")
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.pwa.enable
if theme.pwa.theme_color
meta(name="theme-color" content=theme.pwa.theme_color)
if theme.pwa.manifest
link(rel="manifest" href=`${url_for(theme.pwa.manifest)}?v=${stun_env('version')}`)
if theme.favicon.small
link(rel="icon" href=`${url_for(theme.favicon.small)}?v=${stun_env('version')}` type="image/png" sizes="16x16")
if theme.favicon.medium
link(rel="icon" href=`${url_for(theme.favicon.medium)}?v=${stun_env('version')}` type="image/png" sizes="32x32")
if theme.favicon.apple_touch_icon
link(rel="apple-touch-icon" href=`${url_for(theme.favicon.apple_touch_icon)}?v=${stun_env('version')}` sizes="180x180")
if theme.favicon.safari_pinned_tab
link(rel="mask-icon" href=`${url_for(theme.favicon.safari_pinned_tab)}?v=${stun_env('version')}` color="#54bcff")
if theme.favicon.msapplication
meta(name="msapplication-TileImage" content=`${url_for(theme.favicon.msapplication)}`)
meta(name="msapplication-TileColor" content="#000000")
if theme.google_site_verification
meta(name="google-site-verification" content=theme.google_site_verification)
if theme.bing_site_verification
meta(name="msvalidate.01" content=theme.bing_site_verification)
if theme.baidu_site_verification
meta(name="baidu-site-verification" content=theme.baidu_site_verification)
if theme.qihu360_site_verification
meta(name="360-site-verification" content=theme.qihu360_site_verification)
if theme.sougou_site_verification
meta(name="sogou_site_verification" content=theme.sougou_site_verification)
!= open_graph()
title= title
if theme.canonical
link(ref="canonical" href=full_url_for(page.path))
if theme.feed.rss
link(rel="alternate" href=url_for(theme.feed.rss) type="application/atom+xml")
link(rel="dns-prefetch" href="https://cdn.jsdelivr.net")
- 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")
if theme.fancybox
- var fancybox_css = 'https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css';
- if (theme.cdn.fancybox_css) fancybox_css = theme.cdn.fancybox_css;
link(rel="stylesheet" href=fancybox_css type="text/css")
if page.comments || theme.pjax.enable
if theme.gitalk.enable
- var gitalk_css = 'https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.css';
- if (theme.cdn.gitalk_css) gitalk_css = theme.cdn.gitalk_css;
link(rel="stylesheet" href=gitalk_css type="text/css")
if theme.algolia_search.enable
- var instantsearch_css = 'https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css';
- if (theme.cdn.instantsearch_css) instantsearch_css = theme.cdn.instantsearch_css;
link(rel="stylesheet" href=instantsearch_css type="text/css")
if theme.post_widget.share.enable
- var share_css = 'https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css';
- if (theme.cdn.share_css) share_css = theme.cdn.share_css;
link(rel="stylesheet" href=share_css type="text/css")
link(rel="stylesheet" href=`${url_for(theme.css)}/index.css?v=${stun_env('version')}`)
if theme.google_analytics
link(rel="dns-prefetch" href="https://www.googletagmanager.com")
if theme.baidu_analytics
link(rel="dns-prefetch" href="https://hm.baidu.com")
if theme.tencent_analytics
link(rel="dns-prefetch" href="https://tajs.qq.com")
include ../../_third-party/advertising/index.pug
include ../../_third-party/analytics/index.pug
include ../config.pug
meta(name="renderer" content="webkit")
meta(name="force-rendering" content="webkit")
script.
if (/*@cc_on!@*/false || (!!window.MSInputMethodContext && !!document.documentMode)) {
window.location.href = '!{ theme.kill_old_ie.warning_url }';
}
include ../../_mixins/menu-item.pug
nav.header-nav(class=`${isNoHeader ? 'header-nav--sticky' : 'header-nav--fixed'}`)
div.header-nav-inner
div.header-nav-menubtn
i(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
span.header-nav-search__icon
i(class=theme.icon.search)
if !theme.menu_settings.icon_only
span.header-nav-search__text= __('nav.search')
if theme.night_mode.enable
div.header-nav-mode
include ../widgets/night-mode.pug
if !isNoHeader
div.header-banner(
style=`${
(theme.header.bg_image.enable && page.top_image)
? 'background: url(' + page.top_image + ') no-repeat center/cover;'
: ''
}`
)
div.header-banner-info
div.header-banner-info__title= config.title
div.header-banner-info__subtitle= config.subtitle
if theme.header.scroll_down_icon.enable
div.header-banner-arrow
div.header-banner-arrow__icon
i(class=theme.header.scroll_down_icon.name)
section.postlist
include ../../_mixins/post-header.pug
include ../../_mixins/gallery.pug
- var postLists = theme.post_list.paginate.home ? page.posts : site.posts;
- postLists.each(function (post) {
article.postlist-item.post
+postHeader(post)
div.post-body
if theme.post_list.cover_image.home && post.top_image
img(src=post.top_image)
if post.photos && post.photos.length
+gallery(post)
- var isExcerpt = true;
if post.excerpt
div.post-excerpt!= post.excerpt
else
- isExcerpt = false;
div.post-excerpt!= post.content
if !post.link && isExcerpt
div.post-readmore
a.post-readmore__link(href=url_for(post.path))
span.post-readmore__text= __('post.read_more')
span.post-readmore__icon
i(class=theme.icon.read_more_btn)
- })
div.search-mask
div.search-popup
span.search-close
div.search-input
include ./assist-btns.pug
div.search-results
div#algolia-hits
div#algolia-pagination
if theme.algolia_search.labels.show_stats
div#algolia-stats
if theme.assist_search.enable
div.search-btns
= __('assist_search.prompt_label')
if theme.assist_search.google
span.search-btns-item.search-btns-item--google
i(class=theme.icon.google)
= __('assist_search.google')
if theme.assist_search.bing
span.search-btns-item.search-btns-item--bing
i(class=theme.icon.bing)
= __('assist_search.bing')
if theme.assist_search.baidu
span.search-btns-item.search-btns-item--baidu
i(class=theme.icon.baidu)
= __('assist_search.baidu')
if theme.algolia_search.enable
include ./algolia.pug
else if theme.local_search.enable
include ./localsearch.pug
div.search-mask
div.search-popup
span.search-close
div.search-input
input(placeholder= __('local_search.input_placeholder'))
include ./assist-btns.pug
div.search-results
-
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')
span.sidebar-nav-ov= __('sidebar.overview')
section.sidebar-toc(class=`${isShowToc ? '' : 'hide'}`)
if page.content
- var tocMaxDepth = page.toc_max_depth || theme.toc.max_depth || 6;
- var tocMinDepth = page.toc_min_depth || theme.toc.min_depth || 1;
!= toc(page.content, {list_number: theme.toc.list_number, min_depth: tocMinDepth, max_depth: tocMaxDepth})
// ov = overview
section.sidebar-ov(class=`${isShowToc ? 'hide' : ''}`)
if theme.author.enable
div.sidebar-ov-author
if theme.author.avatar.url
div.sidebar-ov-author__avatar
img(
class="sidebar-ov-author__avatar_img"
src=theme.author.avatar.url
alt="avatar"
)
if theme.author.motto
p.sidebar-ov-author__text= theme.author.motto
if theme.social_setting.enable
div.sidebar-ov-social
for value, name in (theme.social || {})
if name && value
-
var item = value.split('||');
var socialPath = (item[0] + '').trim();
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';
}
a(
class="sidebar-ov-social-item"
href=socialPath
target="_blank"
rel="noopener"
)&attributes(elemAttr)
if socialIcon && socialIcon.match('origin:')
span.sidebar-ov-social-item__icon
= socialIcon.split('origin:')[1]
else
span.sidebar-ov-social-item__icon
i(class=socialIcon)
if !theme.social_setting.icon_only
span.sidebar-ov-social-item__text= name
if theme.feed.enable
div.sidebar-ov-feed
if theme.feed.email
span.sidebar-ov-feed-email
a(
class="sidebar-ov-feed-email__link"
href=theme.feed.email
target="_blank"
rel="noopener"
)
span.sidebar-ov-feed-email__icon
i(class=theme.icon.feed_email)
span= `Email ${__('sidebar.subscribe')}`
if theme.feed.rss
span.sidebar-ov-feed-rss
a(
class="sidebar-ov-feed-rss__link"
href=url_for(theme.feed.rss)
target="_blank"
rel="noopener"
)
span.sidebar-ov-feed-rss__icon
i(class=theme.icon.feed_rss)
span= `RSS ${__('sidebar.subscribe')}`
if theme.menu && (theme.menu.archives || theme.menu.categories || theme.menu.tags)
div.sidebar-ov-state
if theme.menu.archives
- var menuArchives = (theme.menu.archives.split('||')[0] + '').trim();
a.sidebar-ov-state-item.sidebar-ov-state-item--posts(href=menuArchives)
div.sidebar-ov-state-item__count= site.posts.length
div.sidebar-ov-state-item__name= __('sidebar.archives')
if theme.menu.categories
- var menuCategories = (theme.menu.categories.split('||')[0] + '').trim();
a.sidebar-ov-state-item.sidebar-ov-state-item--categories(href=menuCategories)
div.sidebar-ov-state-item__count= site.categories.length
div.sidebar-ov-state-item__name= __('sidebar.categories')
if theme.menu.tags
- var menuTags = (theme.menu.tags.split('||')[0] + '').trim();
a.sidebar-ov-state-item.sidebar-ov-state-item--tags(href=menuTags)
div.sidebar-ov-state-item__count= site.tags.length
div.sidebar-ov-state-item__name= __('sidebar.tags')
if theme.creative_commons.enable && theme.creative_commons.sidebar
div.sidebar-ov-cc
a(
href=ccUrl
target="_blank"
rel="noopener"
data-popover=__('popover.creative_commons')
data-popover-pos="up"
)
img(src=url_for(`/${theme.images}/cc-${ccLicense}.svg`))
if theme.reading_progress.enable && is_post()
div.sidebar-reading
div.sidebar-reading-info
span.sidebar-reading-info__text= __('sidebar.read_info') + ' '
span.sidebar-reading-info__num= '0'
span.sidebar-reading-info__perc= '%'
div.sidebar-reading-line
div#back2top.back2top
span.back2top__icon
i(class=theme.back2top.icon.name)
if theme.disqus.enable
div#comments.comments
div#disqus_thread
else if theme.waline.enable
div#comments.comments
div#waline-container
else if theme.valine.enable
div#comments.comments
div#valine-container
else if theme.minivaline.enable
div#comments.comments
div#minivaline-container
else if theme.gitalk.enable
div#comments.comments
div#gitalk-container
else if theme.utterances.enable
div#comments.comments
div#utterances-container
else if theme.livere.enable
div#comments.comments
div#lv-container(data-id="city" data-uid=theme.livere.uid)
else if theme.fbcomments.enable
div#comments.comments
div#fb-root
div.fb-comments(
data-href=page.permalink
data-lazy=theme.fbcomments.lazy
data-mobile=theme.fbcomments.mobile
data-numposts=theme.fbcomments.numPosts
data-order-by=theme.fbcomments.order_by
data-width=theme.fbcomments.width
)
div(class=`${is_post() ? 'post-copyright' : ''}`).copyright
div.copyright-author
span.copyright-author__name
= __('post.copyright.author') + ': '
span.copyright-author__value
if config.url && config.author
a(href=config.url)= config.author
div.copyright-link
span.copyright-link__name
= __('post.copyright.link') + ': '
span.copyright-link__value
if config.url
a(href=page.permalink)= page.permalink
div.copyright-notice
span.copyright-notice__name
= __('post.copyright.license_title') + ': '
span.copyright-notice__value
!= _p('post.copyright.license_content', ccUrl, ccLicense.toUpperCase())
div#loading-bar.loading-bar
div.loading-bar__progress
div.mode
div.mode-track
span.mode-track-moon
span.mode-track-sun
div.mode-thumb
nav(class=`${is_post() ? 'post-paginator' : ''}`).paginator
if !is_post()
- 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
if page.prev
div.paginator-prev
a.paginator-prev__link(href=url_for(page.prev.path))
span.paginator-prev__icon
i(class=theme.icon.paginator_prev)
span.paginator-prev__text= page.prev.title || __('post.untitled')
if page.next
div.paginator-next
a.paginator-next__link(href=url_for(page.next.path))
span.paginator-prev__text= page.next.title || __('post.untitled')
span.paginator-next__icon
i(class=theme.icon.paginator_next)
div(class=`${is_post() ? 'post-reward' : ''}`).reward
div.reward-button= __('reward.btn_text')
div.reward-qrcode
span.reward-qrcode-alipay
img.reward-qrcode-alipay__img(src=theme.reward.alipay)
div.reward-qrcode-alipay__text= __('reward.alipay')
span.reward-qrcode-wechat
img.reward-qrcode-wechat__img(src=theme.reward.wechat)
div.reward-qrcode-wechat__text= __('reward.wechat')
-
var socialShare = theme.post_widget.share;
var socialShareLabel = socialShare.label || 'Share to: ';
if socialShare.target
div.post-share
if socialShare.target
div.social-share(data-sites=`${socialShare.target}`)
= socialShareLabel
div.sticky-top(
data-popover=__('post.sticky')
data-popover-pos="up"
)
span.sticky-top__icon
i(class=theme.stick_top.icon)
script(src=`${url_for(theme.js)}/utils.js?v=${stun_env('version')}`)
script(src=`${url_for(theme.js)}/stun-boot.js?v=${stun_env('version')}`)
script(src=`${url_for(theme.js)}/scroll.js?v=${stun_env('version')}`)
script(src=`${url_for(theme.js)}/header.js?v=${stun_env('version')}`)
if theme.sidebar.enable
script(src=`${url_for(theme.js)}/sidebar.js?v=${stun_env('version')}`)
if theme.local_search.enable
script(type="application/json" src=`${config.root}${config.search.path}`)
-
var jquery_js = 'https://cdn.jsdelivr.net/npm/jquery@v3.4.1/dist/jquery.min.js';
var velocity_js = 'https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.min.js';
var velocity_ui_js = 'https://cdn.jsdelivr.net/npm/velocity-animate@1.5.2/velocity.ui.min.js';
if (theme.cdn.jquery) jquery_js = theme.cdn.jquery;
if (theme.cdn.velocity) velocity_js = theme.cdn.velocity;
if (theme.cdn.velocity_ui) velocity_ui_js = theme.cdn.velocity_ui;
script(src=jquery_js)
script(src=velocity_js)
script(src=velocity_ui_js)
if theme.canvas_ribbon.enable
- var ribbon_js = 'https://cdn.jsdelivr.net/npm/ribbon.js@latest/dist/ribbon.min.js';
- var ribbon = theme.canvas_ribbon;
- if (theme.cdn.canvas_ribbon) ribbon_js = theme.cdn.canvas_ribbon;
script(src=ribbon_js size=ribbon.size alpha=ribbon.alpha zIndex=ribbon.zIndex)
if theme.canvas_nest.enable
- var nest_js = 'https://cdn.jsdelivr.net/npm/canvas-nest.js@1.0.1/dist/canvas-nest.min.js';
- var nest = theme.canvas_nest;;
- if (theme.cdn.canvas_nest) nest_js = theme.cdn.canvas_nest;
script(src=nest_js color=nest.color opacity=nest.opacity count=nest.count zIndex=nest.zIndex)
if theme.fancybox
- var fancybox_js = 'https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js';
- if (theme.cdn.fancybox_js) fancybox_js = theme.cdn.fancybox_js;
script(src=fancybox_js)
if theme.gallery_waterfall.enable
- var masonry_js = 'https://cdn.jsdelivr.net/npm/masonry-layout@4.2.2/dist/masonry.pkgd.min.js';
- if (theme.cdn.masonry) masonry_js = theme.cdn.masonry;
script(src=masonry_js)
if theme.lazyload.enable
- var lazyload_js = 'https://cdn.jsdelivr.net/npm/lazyload@2.0.0-rc.2/lazyload.min.js';
- if (theme.cdn.lazyload) lazyload_js = theme.cdn.lazyload;
script(src=lazyload_js)
if theme.post_widget.share.enable
- var share_js = 'https://cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js';
- if (theme.cdn.share_js) share_js = theme.cdn.share_js;
script(src=share_js)
script(
src=theme.google_adsense.js_src
data-ad-client=theme.google_adsense.client
async=""
)&attributes(dataPjax)
if theme.google_adsense.enable
include ./google-adsense.pug
script.
var _hmt = _hmt || [];
(function() {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?!{ theme.baidu_analytics }';
hm.async = true;
if (!{ theme.pjax.enable }) {
hm.setAttribute('data-pjax', '');
}
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
if theme.busuanzi.enable && (theme.busuanzi.site_uv.enable || theme.busuanzi.site_pv.enable || theme.busuanzi.post_pv.enable)
- var busuanzi_js = 'https://cdn.jsdelivr.net/gh/sukkaw/busuanzi@latest/bsz.pure.mini.js';
- if (theme.cdn.busuanzi) busuanzi_js = theme.cdn.busuanzi;
script(src=busuanzi_js async)
- var scriptSrc = `https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`;
script(src=scriptSrc async='')&attributes(dataPjax)
script&attributes(dataPjax).
if (window.location.hostname !== 'localhost') {
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '!{ theme.google_analytics }');
}
if theme.google_analytics
include ./google-analytics.pug
if theme.baidu_analytics
include ./baidu-analytics.pug
if theme.tencent_analytics
include ./tencent-analytics.pug
script.
(function() {
var hm = document.createElement('script');
hm.src = 'https://tajs.qq.com/stats?sId=!{ theme.tencent_analytics }';
hm.async = true;
if (!{ theme.pjax.enable }) {
hm.setAttribute('data-pjax', '');
}
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
script&attributes(dataPjax).
function loadDisqus () {
if (!document.getElementById('disqus_thread')) {
return;
}
if (window.DISQUS) {
DISQUS.reset({
reload: true,
config: function () {
this.page.url = '!{ page.permalink }';
this.page.identifier = '!{ page.path }';
this.page.title = '!{ page.title }';
}
});
} else {
var d = document;
var sc = d.createElement('script');
var se = d.createElement('script');
if (!{ theme.disqus.count }) {
sc.src = 'https://!{ theme.disqus.shortname }.disqus.com/count.js';
sc.id = 'dsq-count-scr';
sc.async = true;
if (!{ pjax }) {
sc.setAttribute('data-pjax', '');
}
(d.head || d.body).appendChild(sc);
}
se.src = 'https://!{ theme.disqus.shortname }.disqus.com/embed.js';
(d.head || d.body).appendChild(se);
}
}
if (!{ pjax }) {
loadDisqus();
} else {
window.addEventListener('DOMContentLoaded', loadDisqus, false);
}
- let fbCommentsSrc = `https://connect.facebook.net/${theme.fbcomments.lang}/sdk.js#xfbml=1&version=v8.0`;
- if (pjax) {
script(src=fbCommentsSrc)
script&attributes(dataPjax).
function loadFBComments() {
if (!'!{ theme.fbcomments.appId }') {
console.error('Stun Error: Facebook AppId not found. Please search for `fbcomments` in _config.yml of «Stun» theme and set `fbcomments.appId`.');
return;
}
window.FB.init({
appId : '!{ theme.fbcomments.appId }',
autoLogAppEvents : true,
xfbml : true,
version : 'v8.0'
});
}
loadFBComments();
- } else {
script(async defer crossorigin="anonymous" src=fbCommentsSrc)
- }
-
var gitalk_js = 'https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js';
var gitalk_md5 = 'https://cdn.jsdelivr.net/npm/js-md5@latest/src/md5.min.js';
if (theme.cdn.gitalk_js) {
gitalk_js = theme.cdn.gitalk_js;
}
if (theme.cdn.gitalk_md5) {
gitalk_md5 = theme.cdn.gitalk_md5;
}
script(src=gitalk_js)&attributes(dataPjax)
script(src=gitalk_md5)&attributes(dataPjax)
-
var gtLang = theme.gitalk.language
? theme.gitalk.language
: config.language;
script&attributes(dataPjax).
function loadGitalk () {
if (!document.getElementById('gitalk-container')) {
return;
}
var gitalk = new Gitalk({
id: md5(window.location.pathname.slice(1)),
clientID: '!{ theme.gitalk.client_id }',
clientSecret: '!{ theme.gitalk.client_secret }',
repo: '!{ theme.gitalk.repo }',
owner: '!{ theme.gitalk.owner }',
admin: ['!{ theme.gitalk.admin }'],
distractionFreeMode: '!{ theme.gitalk.distraction_free_mode }',
language: '!{ gtLang }'
});
gitalk.render('gitalk-container');
}
if (!{ pjax }) {
loadGitalk();
} else {
window.addEventListener('DOMContentLoaded', loadGitalk, false);
}
if page.comments || theme.pjax.enable
if theme.disqus.enable
include ./disqus.pug
else if theme.waline.enable
include ./waline.pug
else if theme.valine.enable
include ./valine.pug
else if theme.minivaline.enable
include ./minivaline.pug
else if theme.gitalk.enable
include ./gitalk.pug
else if theme.utterances.enable
include ./utterances.pug
else if theme.livere.enable
include ./livere.pug
else if theme.fbcomments.enable
include ./fbcomments.pug
else if theme.waline.enable && theme.waline.visitor
include ./waline.pug
else if theme.valine.enable && theme.valine.visitor
include ./valine.pug
script&attributes(dataPjax).
function loadLivere () {
var d = document, s = d.createElement('script');
if (!d.getElementById('lv-container')) {
return;
}
if (typeof LivereTower === 'function') {
return;
}
s.src = 'https://cdn-city.livere.com/js/embed.dist.js';
if (!{ pjax }) {
s.setAttribute('data-pjax-rm', '');
}
(d.head || d.body).appendChild(s);
}
if (!{ pjax }) {
loadLivere();
} else {
window.addEventListener('DOMContentLoaded', loadLivere, false);
}
-
var minivaline_js = 'https://cdn.jsdelivr.net/npm/minivaline/dist/MiniValine.min.js';
if (theme.cdn.minivaline) {
minivaline_js = theme.cdn.minivaline;
}
script(src=minivaline_js)
script&attributes(dataPjax).
function loadminivaline () {
new MiniValine({
el: '#minivaline-container',
appId: '!{ theme.minivaline.appId }',
appKey: '!{ theme.minivaline.appKey }',
placeholder: '!{ theme.minivaline.placeholder }',
lang: '!{ theme.minivaline.lang }',
adminEmailMd5: '!{ theme.minivaline.adminEmailMd5 }',
math: !{ theme.minivaline.math },
md: !{ theme.minivaline.md }
});
}
if (!{ pjax }) {
loadminivaline();
} else {
window.addEventListener('DOMContentLoaded', loadminivaline, false);
}
script&attributes(dataPjax).
function loadUtterances() {
var d = document, s = d.createElement('script');
var container = d.getElementById('utterances-container');
if (!container) {
return;
}
s.src = '!{ theme.utterances.script_url }';
s.setAttribute('repo', '!{ theme.utterances.owner }/!{ theme.utterances.repo }');
s.setAttribute('issue-term', '!{ theme.utterances.mapping }');
s.setAttribute('label', '!{ theme.utterances.label }');
s.setAttribute('theme', '!{ theme.utterances.theme }');
s.setAttribute('crossorigin', 'anonymous');
s.setAttribute('async', '');
if (!{ pjax }) {
s.setAttribute('data-pjax-rm', '');
}
container.append(s);
}
if (!{ pjax }) {
loadUtterances();
} else {
window.addEventListener('DOMContentLoaded', loadUtterances, false);
}
-
var leancloud_storage_js = 'https://cdn.jsdelivr.net/npm/leancloud-storage@latest/dist/av-min.js';
var valine_js = 'https://cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js';
if (theme.cdn.leancloud_storage) {
leancloud_storage_js = theme.cdn.leancloud_storage;
}
if (theme.cdn.valine) {
valine_js = theme.cdn.valine;
}
script(src=leancloud_storage_js)
script(src=valine_js)
script&attributes(dataPjax).
function loadValine () {
var GUEST_INFO = ['nick', 'mail', 'link'];
var guest_info = '!{ theme.valine.meta }';
guest_info = guest_info.split(',').filter(function(item) {
return GUEST_INFO.indexOf(item) > -1;
});
new Valine({
el: '#valine-container',
appId: '!{ theme.valine.appid }',
appKey: '!{ theme.valine.appkey }',
notify: !{ theme.valine.notify },
verify: !{ theme.valine.verify },
placeholder: '!{ theme.valine.placeholder }',
avatar: '!{ theme.valine.avatar }',
meta: guest_info,
pageSize: '!{ theme.valine.pageSize }' || 10,
visitor: !{ theme.valine.visitor },
recordIP: !{ theme.valine.recordIP },
lang: '!{ theme.valine.language }' || 'zh-cn',
path: window.location.pathname
});
}
if (!{ pjax }) {
loadValine();
} else {
window.addEventListener('DOMContentLoaded', loadValine, false);
}
-
var waline_js = 'https://unpkg.com/@waline/client/dist/Waline.min.js';
if (theme.cdn.waline) {
waline_js = theme.cdn.waline;
}
script(src=waline_js)
script&attributes(dataPjax).
function loadWaline () {
var GUEST_INFO = ['nick', 'mail', 'link'];
var guest_info = '!{ theme.waline.meta }';
guest_info = guest_info.split(',').filter(function(item) {
return GUEST_INFO.indexOf(item) > -1;
});
new Waline({
el: '#waline-container',
serverURL: '!{ theme.waline.serverURL }',
placeholder: '!{ theme.waline.placeholder }',
pageSize: '!{ theme.waline.pageSize }' || 10,
lang: '!{ theme.waline.language }' || 'zh-cn',
visitor: !{ theme.waline.visitor },
avatar: '!{ theme.waline.avatar }',
path: window.location.pathname,
meta: guest_info
});
}
if (!{ pjax }) {
loadWaline();
} else {
window.addEventListener('DOMContentLoaded', loadWaline, false);
}
if theme.math.enable
- var isHomeHasMath = false;
if is_home()
- page.posts.each(function (post) {
if post.math && !isHomeHasMath
- isHomeHasMath = true;
- })
if pjax || (!is_tag() && !is_category() && !is_archive())
if pjax || isHomeHasMath || (theme.math.per_page || page.math)
if theme.math.engine === 'mathjax'
include ./mathjax.pug
else if theme.math.engine === 'katex'
include ./katex.pug
link(href=theme.math.katex.cdn rel="stylesheet" type="text/css")
if theme.math.katex.copy_tex.enable
if theme.math.katex.copy_tex.copy_tex_css
link(href=theme.math.katex.copy_tex.copy_tex_css rel="stylesheet" type="text/css")
if theme.math.katex.copy_tex.copy_tex_js
script(src=theme.math.katex.copy_tex.copy_tex_js)
script(type="text/x-mathjax-config").
var mathjaxMhchem = '';
var mathJaxTex = {
equationNumbers: {
autoNumber: 'AMS'
}
};
if (!{ theme.math.mathjax.mhchem.enable }) {
mathjaxMhchem = '!{ theme.math.mathjax.mhchem.mhchem_js }';
MathJax.Ajax.config.path['mhchem'] = mathjaxMhchem;
mathJaxTex.extensions = [mathjaxMhchem];
} else {
mathJaxTex.extensions = ['AMSmath.js','AMSsymbols.js'];
}
MathJax.Hub.Config({
menuSettings: {
zoom: 'None'
},
showMathMenu: false,
jax: ['input/TeX','output/CommonHTML'],
extensions: ['tex2jax.js'],
TeX: mathJaxTex,
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['\\[', '\\]']],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
MathJax.Hub.Register.StartupHook('TeX Jax Ready', function() {
MathJax.InputJax.TeX.prefilterHooks.Add(function(data) {
if (data.display) {
var next = data.script.nextSibling;
while (next && next.nodeName.toLowerCase() === '#text') { next = next.nextSibling; }
if (next && next.nodeName.toLowerCase() === 'br') { next.parentNode.removeChild(next); }
}
});
});
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for (i = 0; i < all.length; i++) {
document.getElementById(all[i].inputID + '-Frame').parentNode.className += ' has-jax';
}
});
script(src=theme.math.mathjax.cdn)
-
var pjaxSelectors = [
'head title',
'#main',
'.pjax-reload'
];
if (isEnableNoHeader) {
pjaxSelectors.push('.header-inner');
}
var pjaxArgs = {
'selectors': pjaxSelectors,
'history': theme.pjax.history,
'scrollTo': theme.pjax.scrollTo,
'scrollRestoration': theme.pjax.scrollRestoration,
'cacheBust': theme.pjax.cacheBust,
'debug': theme.pjax.debug,
'currentUrlFullReload': theme.pjax.currentUrlFullReload,
'timeout': theme.pjax.timeout
};
if (theme.pjax.elements) {
pjaxArgs.elements.push(theme.pjax.elements);
}
if (theme.pjax.selectors) {
pjaxArgs.selectors.push(theme.pjax.selectors);
}
if (theme.pjax.selectors) {
pjaxArgs.switches = theme.pjax.selectors;
}
if (theme.pjax.selectors) {
pjaxArgs.switchesOptions = theme.pjax.selectors;
}
pjaxArgs = JSON.stringify(pjaxArgs);
if theme.pjax.enable
- var pjax_js = 'https://cdn.jsdelivr.net/npm/pjax@latest/pjax.min.js';
- if (theme.cdn.pjax) pjax_js = theme.cdn.pjax;
script(src=pjax_js)
script.
window.addEventListener('DOMContentLoaded', function () {
var pjax = new Pjax(!{ pjaxArgs });
// 加载进度条的计时器
var loadingTimer = null;
// 重置页面 Y 方向上的滚动偏移量
document.addEventListener('pjax:send', function () {
$('.header-nav-menu').removeClass('show');
if (CONFIG.pjax && CONFIG.pjax.avoidBanner) {
$('html').velocity('scroll', {
duration: 500,
offset: $('#header').height(),
easing: 'easeInOutCubic'
});
}
var loadingBarWidth = 20;
var MAX_LOADING_WIDTH = 95;
$('.loading-bar').addClass('loading');
$('.loading-bar__progress').css('width', loadingBarWidth + '%');
clearInterval(loadingTimer);
loadingTimer = setInterval(function () {
loadingBarWidth += 3;
if (loadingBarWidth > MAX_LOADING_WIDTH) {
loadingBarWidth = MAX_LOADING_WIDTH;
}
$('.loading-bar__progress').css('width', loadingBarWidth + '%');
}, 500);
}, false);
window.addEventListener('pjax:complete', function () {
clearInterval(loadingTimer);
$('.loading-bar__progress').css('width', '100%');
$('.loading-bar').removeClass('loading');
setTimeout(function () {
$('.loading-bar__progress').css('width', '0');
}, 400);
$('link[rel=prefetch], script[data-pjax-rm]').each(function () {
$(this).remove();
});
$('script[data-pjax], #pjax-reload script').each(function () {
$(this).parent().append($(this).remove());
});
if (Stun.utils.pjaxReloadBoot) {
Stun.utils.pjaxReloadBoot();
}
if (Stun.utils.pjaxReloadScroll) {
Stun.utils.pjaxReloadScroll();
}
if (Stun.utils.pjaxReloadSidebar) {
Stun.utils.pjaxReloadSidebar();
}
if (!{ isEnableNoHeader }) {
if (Stun.utils.pjaxReloadHeader) {
Stun.utils.pjaxReloadHeader();
}
if (Stun.utils.pjaxReloadScrollIcon) {
Stun.utils.pjaxReloadScrollIcon();
}
if (Stun.utils.pjaxReloadLocalSearch) {
Stun.utils.pjaxReloadLocalSearch();
}
}
}, false);
}, false);
if theme.quicklink.enable
-
var loadQuicklink = false;
var quicklink_js = 'https://cdn.jsdelivr.net/npm/quicklink@1.0.1/dist/quicklink.umd.js';
if (theme.cdn.quicklink) quicklink_js = theme.cdn.quicklink;
if is_home() && theme.quicklink.home
- loadQuicklink = true;
if is_archive() && theme.quicklink.archive
- loadQuicklink = true;
if theme.pjax.enable
- loadQuicklink = true;
if loadQuicklink || ((page && page.quicklink) || (post && post.quicklink))
script(src=quicklink_js)
script.
function initQuicklink() {
quicklink({
timeout: '!{ theme.quicklink.timeout }',
priority: !{ theme.quicklink.priority },
ignores: [uri => uri.includes('#'), uri => uri === '!{ url.replace("index.html", '') }', !{ theme.quicklink.ignores }]
});
}
if (!{ pjax } || !{ !theme.quicklink.delay }) {
initQuicklink();
} else {
window.addEventListener('DOMContentLoaded', initQuicklink, false);
}
-
var instantsearch_js = 'https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.js';
if (theme.cdn.instantsearch_js) {
instantsearch_js = theme.cdn.instantsearch_js;
}
script(src=instantsearch_js defer)
script.
window.addEventListener('DOMContentLoaded', function () {
$('.header-nav-search').on('click', function (e) {
e.stopPropagation();
$('body').css('overflow', 'hidden');
$('.search-popup')
.velocity('stop')
.velocity('transition.expandIn', {
duration: 300,
complete: function () {
$('.search-popup input').focus();
}
});
$('.search-mask')
.velocity('stop')
.velocity('transition.fadeIn', {
duration: 300
});
});
function closeSearch () {
$('body').css({ overflow: 'auto' });
$('.search-popup').css({ display: 'none' });
$('.search-mask').css({ display: 'none' });
}
$('.search-mask, .search-close').on('click', function () {
closeSearch();
});
$(document).on('keydown', function (e) {
// Escape <=> 27
if (e.keyCode === Stun.utils.codeToKeyCode('Escape')) {
closeSearch();
}
});
var algolia = CONFIG.algolia;
if (!algolia && !(algolia.appId && algolia.apiKey && algolia.indexName)) {
return console.error('Algolia setting is invalid.');
}
var search = instantsearch({
appId: algolia.appId,
apiKey: algolia.apiKey,
indexName: algolia.indexName,
searchParameters: {
hitsPerPage: algolia.hits.per_page || 10
},
searchFunction: function (helper) {
var searchInput = $('.search-input').find('input');
if (searchInput.val()) {
helper.search();
}
}
});
search.addWidget(
instantsearch.widgets.searchBox({
container: '.search-input',
reset: false,
magnifier: false,
placeholder: algolia.languages.inputPlaceholder
})
);
// The hits of search results.
search.addWidget(
instantsearch.widgets.hits({
container: '#algolia-hits',
templates: {
item: function (data) {
var link = data.permalink ? data.permalink : CONFIG.root + data.path;
return (
'<a href="' + link + '" class="algolia-hit-item-link">' +
data._highlightResult.title.value +
'</a>'
);
},
empty: function (data) {
return (
'<div id="algolia-hits-empty">' +
algolia.languages.hitsEmpty.replace(/\$\{query}/, data.query) +
'</div>'
);
}
},
cssClasses: {
item: 'algolia-hit-item'
}
})
);
// The stats of search results.
if ($('#algolia-stats')[0]) {
search.addWidget(
instantsearch.widgets.stats({
container: '#algolia-stats',
templates: {
body: function (data) {
var stats = algolia.languages.hitsStats
.replace(/\$\{hits}/, data.nbHits)
.replace(/\$\{time}/, data.processingTimeMS);
return (
stats +
'<span class="algolia-logo pull-right">' +
'<img src="' + CONFIG.root +
`${CONFIG.sourcePath.images}/algolia.svg" alt="Algolia" />` +
'</span>'
);
}
}
})
);
}
// The pagination of the results.
search.addWidget(
instantsearch.widgets.pagination({
container: '#algolia-pagination',
scrollTo: false,
showFirstLast: false,
labels: {
first: '<i class="fa fa-angle-double-left"></i>',
last: '<i class="fa fa-angle-double-right"></i>',
previous: '<i class="fa fa-angle-left"></i>',
next: '<i class="fa fa-angle-right"></i>'
},
cssClasses: {
root: 'pagination',
item: 'pagination-item',
link: 'page-number',
active: 'current',
disabled: 'disabled-item'
}
})
);
search.start();
});
if theme.algolia_search.enable
include ./algolia.pug
else if theme.local_search.enable
include ./localsearch.pug
script.
function initSearch() {
var isXML = true;
var search_path = '!{ config.search.path }';
if (!search_path) {
search_path = 'search.xml';
} else if (/json$/i.test(search_path)) {
isXML = false;
}
var path = '!{ config.root }' + search_path;
$.ajax({
url: path,
dataType: isXML ? 'xml' : 'json',
async: true,
success: function (res) {
var datas = isXML ? $('entry', res).map(function () {
// 将 XML 转为 JSON
return {
title: $('title', this).text(),
content: $('content', this).text(),
url: $('url', this).text()
};
}).get() : res;
var $input = $('.search-input input');
var $result = $('.search-results');
// 搜索对象(标题、内容)的权重,影响显示顺序
var WEIGHT = { title: 100, content: 1 };
var searchPost = function () {
var searchText = $input.val().toLowerCase().trim();
// 根据空白字符分隔关键字
var keywords = searchText.split(/[\s]+/);
// 搜索结果
var matchPosts = [];
// 有多个关键字时,将原文字整个保存下来
if (keywords.length > 1) {
keywords.push(searchText);
}
// 防止未输入字符时搜索
if (searchText.length > 0) {
datas.forEach(function (data) {
var isMatch = false;
// 没有标题的文章使用预设的 i18n 变量代替
var title = (data.title && data.title.trim()) || '!{_p("post.untitled")}';
var titleLower = title && title.toLowerCase();
// 删除 HTML 标签 和 所有空白字符
var content = data.content && data.content.replace(/<[^>]+>/g, '');
var contentLower = content && content.toLowerCase();
// 删除重复的 /
var postURL = data.url && decodeURI(data.url).replace(/\/{2,}/g, '/');
// 标题中匹配到的关键词
var titleHitSlice = [];
// 内容中匹配到的关键词
var contentHitSlice = [];
keywords.forEach(function (keyword) {
/**
* 获取匹配的关键词的索引
* @param {String} keyword 要匹配的关键字
* @param {String} text 原文字
* @param {Boolean} caseSensitive 是否区分大小写
* @param {Number} weight 匹配对象的权重。权重大的优先显示
* @return {Array}
*/
function getIndexByword (word, text, caseSensitive, weight) {
if (!word || !text) {
return [];
};
var startIndex = 0; // 每次匹配的开始索引
var index = -1; // 匹配到的索引值
var result = []; // 匹配结果
if (!caseSensitive) {
word = word.toLowerCase();
text = text.toLowerCase();
}
while((index = text.indexOf(word, startIndex)) !== -1) {
var hasMatch = false;
// 索引位置相同的关键词,保留长度较长的
titleHitSlice.forEach(function (hit) {
if (hit.index === index && hit.word.length < word.length) {
hit.word = word;
hasMatch = true;
}
});
startIndex = index + word.length;
!hasMatch && result.push({ index: index, word: word, weight: weight });
}
return result;
}
titleHitSlice = titleHitSlice.concat(getIndexByword(keyword, titleLower, false, WEIGHT.title));
contentHitSlice = contentHitSlice.concat(getIndexByword(keyword, contentLower, false, WEIGHT.content));
});
var hitTitle = titleHitSlice.length;
var hitContent = contentHitSlice.length;
if (hitTitle > 0 || hitContent > 0) {
isMatch = true;
}
if (isMatch) {
;[titleHitSlice, contentHitSlice].forEach(function (hit) {
// 按照匹配文字的索引的递增顺序排序
hit.sort(function (left, right) {
return left.index - right.index;
});
});
/**
* 给文本中匹配到的关键词添加标记,从而进行高亮显示
* @param {String} text 原文本
* @param {Array} hitSlice 匹配项的索引信息
* @param {Number} start 开始索引
* @param {Number} end 结束索引
* @return {String}
*/
function highlightKeyword (text, hitSlice, start, end) {
if (!text || !hitSlice || !hitSlice.length) {
return;
}
var result = '';
var startIndex = start;
var endIndex = end;
hitSlice.forEach(function (hit) {
if (hit.index < startIndex) {
return;
}
var hitWordEnd = hit.index + hit.word.length;
result += text.slice(startIndex, hit.index);
result += '<b>' + text.slice(hit.index, hitWordEnd) + '</b>';
startIndex = hitWordEnd;
});
result += text.slice(startIndex, endIndex);
return result;
}
var postData = {};
// 文章总的搜索权重
var postWeight = titleHitSlice.length * WEIGHT.title + contentHitSlice.length * WEIGHT.content;
// 标记匹配关键词后的标题
var postTitle = highlightKeyword(title, titleHitSlice, 0, title.length) || title;
// 标记匹配关键词后的内容
var postContent;
// 显示内容的长度
var SHOW_WORD_LENGTH = 200;
// 命中关键词前的字符显示长度
var SHOW_WORD_FRONT_LENGTH = 20;
var SHOW_WORD_END_LENGTH = SHOW_WORD_LENGTH - SHOW_WORD_FRONT_LENGTH;
// 截取匹配的第一个字符,前后共 200 个字符来显示
if (contentHitSlice.length > 0) {
var firstIndex = contentHitSlice[0].index;
var start = firstIndex > SHOW_WORD_FRONT_LENGTH ? firstIndex - SHOW_WORD_FRONT_LENGTH : 0;
var end = firstIndex + SHOW_WORD_END_LENGTH;
postContent = highlightKeyword(content, contentHitSlice, start, end);
} else { // 未匹配到内容,直接截取前 200 个字符来显示
postContent = content.slice(0, SHOW_WORD_LENGTH);
}
postData.title = postTitle;
postData.content = postContent;
postData.url = postURL;
postData.weight = postWeight;
matchPosts.push(postData);
}
});
}
var resultInnerHtml = '';
if (matchPosts.length) {
// 按权重递增的顺序排序,使权重大的优先显示
matchPosts.sort(function (left, right) {
return right.weight - left.weight;
});
resultInnerHtml += '<ul>';
matchPosts.forEach(function (post) {
resultInnerHtml += '<li><a class="search-results-title" href="' + post.url + '">';
resultInnerHtml += post.title;
resultInnerHtml += '</a><div class="search-results-content">';
resultInnerHtml += post.content;
resultInnerHtml += '</div></li>';
});
resultInnerHtml += '</ul>';
} else {
resultInnerHtml += '<div class="search-results-none"><i class="!{theme.icon.localsearch_empty}"></i></div>';
}
$result.html(resultInnerHtml);
};
$input.on('input', searchPost);
$input.on('keyup', function (e) {
if (e.keyCode === Stun.utils.codeToKeyCode('Enter')) {
searchPost();
}
});
}
});
}
function closeSearch () {
$('body').css({ overflow: 'auto' });
$('.search-popup').css({ display: 'none' });
$('.search-mask').css({ display: 'none' });
}
window.addEventListener('DOMContentLoaded', function () {
Stun.utils.pjaxReloadLocalSearch = function () {
$('.header-nav-search').on('click', function (e) {
e.stopPropagation();
$('body').css('overflow', 'hidden');
$('.search-popup')
.velocity('stop')
.velocity('transition.expandIn', {
duration: 300,
complete: function () {
$('.search-popup input').focus();
}
});
$('.search-mask')
.velocity('stop')
.velocity('transition.fadeIn', {
duration: 300
});
initSearch();
});
$('.search-mask, .search-close').on('click', function () {
closeSearch();
});
$(document).on('keydown', function (e) {
// Escape <=> 27
if (e.keyCode === Stun.utils.codeToKeyCode('Escape')) {
closeSearch();
}
});
};
Stun.utils.pjaxReloadLocalSearch();
}, false);
function safeOpenUrl(url) {
var newTab = window.open();
newTab.opener = null;
newTab.location = url;
}
function extSearch(engine) {
var engines = {
google: 'https://www.google.com/search?q=',
bing: 'https://cn.bing.com/search?q=',
baidu: 'https://www.baidu.com/s?ie=UTF-8&wd=',
};
var host = window.location.host;
var query = $('.search-input input').val().toLowerCase().trim();
var uri = engines[engine] + query + ' site:' + host;
if (query) {
safeOpenUrl(uri);
} else {
Stun.utils.popAlert('warning', '!{ __("assist_search.prompt_input") }');
}
}
var assistSearchList = window.CONFIG.assistSearch;
if (Array.isArray(assistSearchList)) {
assistSearchList.forEach(function (name) {
document.querySelector('.search-btns-item--' + name).addEventListener('click', function () {
extSearch(name);
}, false);
});
}
extends ./_layout.pug
include ./_mixins/timeline.pug
block content
div.archive
div.archive-total
= site.posts.length === 0 ? __('page.posts-empty') : _p('page.posts-total', site.posts.length)
+timeline(theme.post_list.paginate.archives ? page.posts.data : site.posts.data)
extends ./_layout.pug
include ./_mixins/timeline.pug
block content
div.categorypage
div.categorypage-title
span.categorypage-title__text= `${__('page.categories')} -- `
span.categorypage-title__name= page.category
+timeline(page.posts.data)
extends ./_layout.pug
block content
include ./_partials/post/post-list.pug
if theme.post_list.paginate.home
include ./_partials/widgets/paginator.pug
extends ./_layout.pug
block content
include ./_mixins/gallery.pug
if page.type === 'tags'
div.tagcloud
div.tagcloud-total= __('page.tags') + ' - '
span= site.tags.length
- var min_font = theme.tag_cloud ? theme.tag_cloud.min_size : 14;
- var max_font = theme.tag_cloud ? theme.tag_cloud.max_size : 24;
- var start_color = theme.tag_cloud ? theme.tag_cloud.start_color : '#a4d8fa';
- var end_color = theme.tag_cloud ? theme.tag_cloud.end_color : '#1b9ef3';
div.tagcloud-item
!= tagcloud({min_font: min_font, max_font: max_font, amount: theme.tag_cloud.max_amount, color: true, start_color, end_color})
else if page.type === 'categories'
div.category
div.category-total= __('page.categories') + ' - '
span= site.categories.length
!= list_categories()
else
div.custompage
if page.photos && page.photos.length
+gallery(page)
!= page.content
if isShowReward
include ./_partials/widgets/reward.pug
if isShowCC
include ./_partials/widgets/copyright.pug
extends ./_layout.pug
block content
// Just used to judge whether it is an article page
div#is-post
div.post
include ./_mixins/post-header.pug
include ./_mixins/gallery.pug
+postHeader(page)
div.post-body
if page.photos && page.photos.length
+gallery(page)
!= page.content
footer.post-footer
if theme.post_widget.end_text.enable
div.post-ending.ending
div.ending__text= __('post.end')
if page.copyright === true || (isShowCC && theme.creative_commons.post)
include ./_partials/widgets/copyright.pug
if theme.post_widget.tags
if page.tags && page.tags.length > 0
div.post-tags
each tag in page.tags.data
span.post-tags-item
span.post-tags-item__icon
i(class=theme.icon.post_tags)
a.post-tags-item__link(href=tag.permalink)= tag.name
if theme.post_widget.share.enable
include ./_partials/widgets/share.pug
if isShowReward
include ./_partials/widgets/reward.pug
include ./_partials/widgets/paginator.pug
extends ./_layout.pug
include ./_mixins/timeline.pug
block content
div.tagpage
div.tagpage-title
span.tagpage-title__text= `${__('page.tags')} -- `
span.tagpage-title__name= page.tag
+timeline(page.posts.data)
{
"name": "hexo-theme-stun",
"version": "2.6.2",
"description": "A beautiful & simple theme for Hexo",
"homepage": "https://liuyib.github.io",
"scripts": {
"commit": "git cz",
"release": "standard-version",
"release:lts": "npm run release -- --release-as",
"release:pre": "npm run release -- --prerelease",
"lint": "standard",
"lint:fix": "standard --fix"
},
"repository": {
"type": "git",
"url": "https://github.com/liuyib/hexo-theme-stun"
},
"keywords": [
"Stun",
"Hexo"
],
"author": "liuyib",
"license": "MIT",
"bugs": {
"url": "https://github.com/liuyib/hexo-theme-stun/issues"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"commitizen": "^4.2.2",
"commitlint-config-cz": "^0.13.3",
"cz-customizable": "^6.3.0",
"eslint": "^7.17.0",
"husky": "^4.3.6",
"standard": "^14.3.4",
"standard-version": "^9.1.0"
},
"standard": {
"globals": [
"$",
"CONFIG",
"hexo",
"Stun",
"instantsearch"
]
},
"husky": {
"hooks": {
"pre-commit": "npm run lint",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
},
"cz-customizable": {
"config": "./.cz-config.js"
}
}
}
'use strict'
hexo.extend.helper.register('hexo_env', function (type) {
return this.env[type]
})
hexo.extend.helper.register('stun_env', function (type) {
var env = require('../package.json')
return env[type]
})
'use strict'
hexo.extend.filter.register(
'after_post_render',
function (data) {
var theme = hexo.theme.config
if (
!theme.external_link ||
!theme.external_link.icon ||
!theme.external_link.icon.enable
) {
return
}
var config = this.config
var url = new URL(config.url)
var siteHost = url.hostname || config.url
// Match 'a' tags that don't contain html children.
var regPureATag = /<a([^>]*)href="([^"]*)"([^>]*)>([^<]*)<\/a>/gim
data.content = data.content.replace(regPureATag, function (
match,
attrBegin,
href,
attrEnd,
html
) {
// Exit if the href attribute doesn't exists.
if (!href) {
return match
}
var link = ''
try {
link = new URL(href)
} catch (e) {
// Invalid url, e.g. Anchor link.
return match
}
// Exit if the url has same host with `config.url`, which means isn't an external link.
if (!link.protocol || link.hostname === siteHost) {
return match
}
return (
'<span class="exturl">' +
`<a class="exturl__link" ${attrBegin} href="${href}" ${attrEnd}>${html}</a>` +
`<span class="exturl__icon"><i class="${theme.external_link.icon.name}"></i></span>` +
'</span>'
)
})
},
0
)
'use strict'
hexo.extend.filter.register(
'after_post_render',
function (data) {
data.content = data.content.replace(
// Match 'img' tags width the src attribute.
/<img([^>]*)src="([^"]*)"([^>]*)>/gim,
function (match, attrBegin, src, attrEnd) {
// Exit if the src doesn't exists.
if (!src) {
return match
}
var search = src.split('?')[1]
// Exit if the src doesn't include query parameter.
if (!search) {
return match
}
var params = search.split('&').filter(i => i !== '')
// Exit if the query parameter is empty.
if (!params.length) {
return match
}
var size = ''
var show = ''
var style = ''
params.forEach(param => {
if (param.includes('size')) {
size = param.split('=')[1] || ''
}
if (param.includes('show')) {
show = param.split('=')[1] || ''
}
})
if (size !== '') {
// The sign between width and height.
var MULTIPLY_SIGN = 'x'
var w = size.split(MULTIPLY_SIGN)[0]
var h = size.split(MULTIPLY_SIGN)[1]
if (w) {
style += `width: ${w}px;`
}
if (h) {
style += `height: ${h}px;`
}
}
if (show === 'inline') {
style += 'display: inline-block;'
}
return `<img ${attrBegin} src="${src}" style="${style}" ${attrEnd}>`
}
)
},
0
)
'use strict'
hexo.extend.filter.register(
'after_post_render',
function (data) {
var theme = hexo.theme.config
if (!theme.lazyload || !theme.lazyload.enable) {
return
}
data.content = data.content.replace(
// Match 'img' tags width the src attribute.
/<img([^>]*)src="([^"]*)"([^>]*)>/gim,
function (match, attrBegin, src, attrEnd) {
// Exit if the src doesn't exists.
if (!src) {
return match
}
// Smallest 1 * 1 pixel transparent gif
var loadingBlock =
'data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs='
var loadingGIF = `/${theme.images}/loading.svg`
var phClassName = theme.lazyload.placeholder
var placeholder = ''
if (phClassName === 'gif') {
placeholder = loadingGIF
} else if (phClassName === 'block') {
placeholder = loadingBlock
}
var className = `lazyload lazyload-${phClassName}`
return `
<img ${attrBegin} class="${className}"
src="${placeholder}" data-src="${src}" ${attrEnd}>
`
}
)
},
1
)
'use strict'
hexo.extend.filter.register(
'after_post_render',
function (data) {
var theme = hexo.theme.config
var tagName = 'h[1-6]'
var attrId = 'id="([^"]*)"'
var tagNotEnd = '([^>]*)'
var regAttrId = tagNotEnd + attrId + tagNotEnd
// Match the innermost 'h1~6' tags width the id attribute.
var regHTagInnermost = new RegExp(
`<(${tagName})${regAttrId}>((?:(?!<\\/?${tagName}${regAttrId}>)(?:\\s|\\S))*?)</${tagName}>`,
'gim'
)
data.content = data.content.replace(regHTagInnermost, function (
match,
tName,
attrBegin,
id,
attrEnd,
html
) {
if (!id) {
return match
}
return `
<${tName} id="${id}" ${attrBegin} ${attrEnd}>
<a href="#${id}" class="heading-link"><i class="${theme.icon &&
theme.icon.post_heading}"></i></a>${html}</${tName}>
`
})
},
0
)
'use strict'
hexo.extend.filter.register('after_generate', function () {
var theme = hexo.theme.config
if (!theme.shake_file) {
return
}
if (!(theme.sidebar && theme.sidebar.enable)) {
hexo.route.remove('js/sidebar.js')
}
})
'use strict'
hexo.extend.filter.register(
'after_post_render',
function (data) {
data.content = data.content.replace(
// Match the innermost 'table' tag.
/(<table[^>]*>(?:(?!<\/?table>)(?:\s|\S))*?<\/table>)/gim,
function (match, table) {
if (!table) {
return match
}
return `<div class="table-container">${table}</div>`
}
)
},
0
)
'use strict'
/**
* Flatten nested object.
* @param {Object} target
* @returns {Object}
* @example { a: { b: 1, c: 2 } } => { 'a.b': 1, 'a.c': 2 }
*/
function flatten (target) {
const output = {}
function step (object, prev) {
Object.keys(object).forEach(function (key) {
const value = object[key]
const type = Object.prototype.toString.call(value)
const isArray = Array.isArray(value)
const isObject = type === '[object Object]'
const hasOwnPrototype = Object.keys(value).length
const newKey = prev ? `${prev}.${key}` : key
if (!isArray && isObject && hasOwnPrototype) {
return step(value, newKey)
}
output[newKey] = value
})
}
step(target)
return output
}
hexo.on('generateBefore', function () {
var rootConfig = hexo.config
if (hexo.locals.get) {
var data = hexo.locals.get('data')
if (data && data.stun) {
hexo.theme.config = data.stun
}
var usingLang = rootConfig.language
var targetLangData = data[`languages/${usingLang}`]
if (targetLangData) {
var flattenData = flatten(targetLangData)
if (Object.keys(flattenData).length) {
hexo.theme.i18n.data[usingLang] = flattenData
}
}
}
hexo.theme.config.rootConfig = rootConfig
})
'use strict'
var pathFn = require('path')
var fs = require('hexo-fs')
function friends (args) {
var path = pathFn.join(hexo.source_dir, args[0])
fs.exists(path).then(function (exist) {
if (!exist) {
hexo.log.error('Include file not found!')
}
})
return fs.readFile(path).then(function (data) {
if (!data) {
hexo.log.warn('Include file empty.')
return
}
var imgClassName = 'friends-plugin__item-avatar '
var theme = hexo.theme.config
if (theme.lazyload && theme.lazyload.enable) {
imgClassName += `lazyload lazyload-${theme.lazyload.placeholder}`
}
var friends = JSON.parse(data)
var renderHtml = '<div class="friends-plugin">'
friends.forEach(f => {
renderHtml +=
`<a class="friends-plugin__item" href="${f.url}">` +
`<img class="${imgClassName}" src="${f.avatar}" data-zoom="none">` +
'<div class="friends-plugin__item-info">' +
`<p class="friends-plugin__item-info__name" title="${f.name}">${f.name}</p>` +
`<p class="friends-plugin__item-info__intro" title="${f.introduction}">${f.introduction}</p>` +
'</div>' +
'</a>'
})
renderHtml += '</div>'
return renderHtml
})
}
hexo.extend.tag.register('friends', friends, { ends: false, async: true })
'use strict'
function note (args, content) {
var theme = hexo.theme.config
var icon = theme.icon && theme.icon.notetag_default
var iconType = 'default'
var isIcon = true
if (args.includes('no-icon')) {
isIcon = false
}
if (isIcon && theme.icon) {
var tagTypes = ['default', 'success', 'info', 'warning', 'danger']
tagTypes.forEach(type => {
if (args.includes(type)) {
icon = theme.icon[`notetag_${type}`]
iconType = type
}
})
}
var className = args.join(' ')
return `
<div class="note-plugin ${className}">
${
isIcon
? `<span class="note-plugin__icon note-plugin__icon--${iconType}">
<i class="${icon}"></i>
</span>`
: ''
}
${hexo.render
.renderSync({ text: content, engine: 'markdown' })
.split('\n')
.join('')}
</div>
`
}
hexo.extend.tag.register('note', note, { ends: true })
'use strict'
var pathFn = require('path')
var fs = require('hexo-fs')
function table (args) {
var path = pathFn.join(hexo.source_dir, args[0])
var headers = args[1].split(',')
fs.exists(path).then(function (exist) {
if (!exist) {
hexo.log.error('Include file not found!')
}
})
return fs.readFile(path).then(function (data) {
if (!data) {
hexo.log.warn('Include file empty.')
return
}
var tableData = JSON.parse(data)
var result = '<table class="table-plugin"><thead><tr>'
headers.forEach(header => (result += `<th>${header}</th>`))
result += '</tr></thead><tbody>'
tableData.forEach(item => {
result += '<tr style="text-align: center;">'
for (var key in item) {
if (Object.prototype.hasOwnProperty.call(item, key)) {
var value = item[key]
result += `<td>${value}</td>`
}
}
result += '</tr>'
})
result += '</tbody></table>'
return result
})
}
hexo.extend.tag.register('table', table, { ends: false, async: true })
.busuanzi {
&-siteuv,
&-sitepv {
&__icon,
&__info,
&__value {
margin: 0 2px;
}
}
& > span:nth-child(2)::before {
content: '|';
margin: 0 10px;
}
}
@import './busuanzi.styl' if (hexo-config('busuanzi.enable'));
.footer {
if (hexo-config('footer.icon.enable')) {
&__icon {
display: inline-block;
margin: 0 .4rem;
font-size: 1em;
color: convert(hexo-config('footer.icon.color') || '#f00');
if (hexo-config('footer.icon.animation')) {
animation: footerHeartBeat 1.2s infinite;
@keyframes footerHeartBeat {
0% {
transform: scale(1);
}
15% {
transform: scale(1.2);
}
30% {
transform: scale(1);
}
45% {
transform: scale(1.2);
}
}
}
}
}
&-inner {
position: relative;
padding: 1rem;
font-size: $font-size-footer;
text-align: center;
color: $footer-text-color;
background-color: $footer-bg-color;
if (hexo-config('footer.bg_image.enable') && hexo-config('footer.bg_image.url')) {
z-index: $z-index0;
background: url(hexo-config('footer.bg_image.url')) no-repeat center / cover;
}
if (hexo-config('footer.mask.enable')) {
&::before {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
z-index: $z-index-1;
width: 100%;
height: 100%;
background-color: alpha(#000, hexo-config('footer.mask.opacity'));
}
}
}
a {
color: $footer-link-color;
transition: color .2s ease;
&:hover {
color: $footer-link-hover-color;
}
}
&__devider {
margin: 0 10px;
}
}
if (hexo-config('header.nav.height') && match('%', hexo-config('header.nav.height'))) {
header-nav-height = unit(convert(hexo-config('header.nav.height')), 'vh');
} else {
header-nav-height = convert(hexo-config('header.nav.height') || '50px');
}
.header {
&-inner {
width: 100%;
font-size: $font-size-header;
background-color: $header-bg-color;
if (hexo-config('header.enable')) {
if (hexo-config('header.height') && match('%', hexo-config('header.height'))) {
height: unit(convert(hexo-config('header.height')), 'vh');
} else {
height: convert(hexo-config('header.height') || '80vh');
}
}
&--bgcolor {
background-color: convert(hexo-config('header.nav.bg_color'));
}
&--height {
height: header-nav-height !important;
}
}
&-nav {
position: relative;
top: 0;
left: 0;
z-index: $z-index1;
width: 100%;
height: header-nav-height;
transition: transform .2s ease-out, background-color .2s ease;
&--fixed {
position: fixed;
transform: translateY(0);
}
&--sticky {
position: fixed;
background-color: convert(hexo-config('header.nav.bg_color') || '$header-nav-bg-color');
transform: translateY(-100%);
}
&.slider {
&--down {
transform: translateY(0);
}
&--up {
transform: translateY(-100%);
}
&--clear {
transition: background-color .2s ease;
}
}
&-inner {
margin: 0 auto;
padding: convert(hexo-config('layout.main_padding.default') || '20px');
padding-top: 0 !important;
padding-bottom: 0 !important;
width: 100%;
height: 100%;
}
&-menubtn {
display: none;
padding: 0 .5rem;
line-height: header-nav-height;
color: $header-text-color;
cursor: pointer;
}
menuItemHover(txtColor, bgColor) {
transition: color .2s ease, background-color .2s ease;
&:hover {
color: txtColor;
background-color: bgColor;
}
}
&-menu-item,
&-submenu-item {
&__link {
display: block;
color: $header-text-color;
}
&__icon,
&__text {
margin: 0 3px;
}
}
&-menu-item__link {
padding: 0 .5rem;
menuItemHover(#f4f5f5, #999);
}
&-submenu-item__link {
padding: .75rem .5rem;
menuItemHover(#f4f5f5, #999);
}
&-menu {
display: none;
height: 100%;
line-height: header-nav-height;
&-item {
float: left;
position: relative;
margin: 0 1rem 0 0;
height: header-nav-height;
text-align: center;
cursor: pointer;
&:last-child {
margin: 0;
}
}
}
&-submenu {
display: none;
position: absolute;
right: -.5rem;
left: -.5rem;
width: auto;
background-color: $header-nav-bg-color;
&.hide {
&--force {
display: none !important;
}
}
&-item {
margin: 0;
padding: 0;
width: 100%;
font-size: $font-size-header;
line-height: 1;
text-align: center;
}
}
if (hexo-config('night_mode.enable')) {
&-mode {
display: flex;
float: right;
padding: 0 .5rem;
height: 100%;
line-height: header-nav-height;
align-items: center;
}
}
if (hexo-config('algolia_search.enable') || hexo-config('local_search.enable')) {
&-search {
float: right;
padding: 0 .5rem;
height: 100%;
line-height: header-nav-height;
color: $header-text-color;
transition: color .2s ease;
cursor: pointer;
&:hover {
color: $header-menu-hover-color;
}
&__icon,
&__text {
margin: 0 3px;
}
}
}
}
&-banner {
position: relative;
z-index: $z-index0;
width: 100%;
height: 100%;
if (hexo-config('header.bg_image.enable') && hexo-config('header.bg_image.url')) {
background: url(hexo-config('header.bg_image.url')) no-repeat center / cover;
}
if (hexo-config('header.mask.enable')) {
&::before {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
z-index: $z-index-1;
width: 100%;
height: 100%;
background-color: alpha(#000, hexo-config('header.mask.opacity'));
}
}
&-info {
position: absolute;
top: 50%;
left: 0;
padding: 0 .5rem;
width: 100%;
text-align: center;
transform: translateY(-50%);
&__title {
margin-bottom: 2rem;
font-size: 4rem;
font-weight: $font-weight-bolder;
line-height: 1;
color: $header-text-color;
}
&__subtitle {
font-size: 1.2rem;
font-weight: $font-weight-normal;
color: $header-text-color;
}
}
if (hexo-config('header.scroll_down_icon.enable')) {
&-arrow {
position: absolute;
bottom: 1rem;
left: calc(50% - 1rem);
width: 2rem;
height: 2rem;
text-align: center;
cursor: pointer;
if (hexo-config('header.scroll_down_icon.animation')) {
animation: arrowUpDown 2s infinite;
@keyframes arrowUpDown {
0%,
100% {
opacity: .8;
transform: translateY(0);
}
50% {
opacity: .4;
transform: translateY(-20px);
}
}
}
&__icon {
width: 100%;
height: 100%;
font-size: 2rem;
font-weight: $font-weight-bolder;
line-height: 1;
text-align: center;
color: #fff;
}
}
}
}
}
highlight_theme = hexo-config('codeblock.highlight') || 'light';
if (highlight_theme == 'light') {
$highlight-addition-color = #229922;
$highlight-addition-bg-color = #f0fff4;
$highlight-deletion-color = #dd4444;
$highlight-deletion-bg-color = #ffeef0;
} else if (highlight_theme == 'dark') {
$highlight-addition-color = #229922;
$highlight-addition-bg-color = transparent;
$highlight-deletion-color = #dd4444;
$highlight-deletion-bg-color = transparent;
} else if (highlight_theme == 'ocean') {
$highlight-addition-color = #99c794;
$highlight-addition-bg-color = transparent;
$highlight-deletion-color = #eb606b;
$highlight-deletion-bg-color = transparent;
}
@require './theme.styl';
@require './diff.styl';
codeStyle = hexo-config('codeblock.style') || 'default';
wordWrap = hexo-config('codeblock.word_wrap') || false;
// Show lang in tag plugin.
languages = 'markdown' 'md' 'diff' 'javascript' 'js' 'typescript' 'ts' 'java' 'json' 'html' 'xml' 'css' 'less' 'scss' 'stylus' 'styl' 'sql' 'bash' 'shell' 'python' 'py' 'ruby' 'cpp' 'c\+\+' 'c\#' 'go' 'kotlin' 'kt' 'objectivec' 'php' 'perl' 'pl' 'pm' 'rust' 'rs' 'swift' 'coffeescript' 'coffee' 'lua' 'yaml' 'yml' 'nginx' 'dockerfile' 'makefile';
.highlight {
figcaption {
span {
&:first-child::before {
margin: 0 .6rem 0 0;
color: $highlight-code-lang-color;
}
}
}
}
for lang in languages {
.highlight {
&{'.' + lang} {
figcaption {
span {
&:first-child::before {
content: lang;
}
}
}
}
}
}
.highlight {
margin: 0 0 1rem;
border-radius: .25rem;
width: 100%;
line-height: $line-height-codeblock;
color: $highlight-color;
background-color: $highlight-background;
pre,
code {
font-family: $font-family-code;
}
pre {
margin: 0;
if (wordWrap) {
white-space: pre-wrap;
counter-reset: line;
}
}
td {
border-width: 0;
}
figcaption {
position: relative;
width: 100%;
color: $highlight-header-color;
background-color: $highlight-header-bg-color;
clearfix();
if (codeStyle == 'carbon') {
border-top-left-radius: .25rem;
border-top-right-radius: .25rem;
}
if (codeStyle == 'default') {
padding: .1rem 0;
}
span {
&:first-child {
float: left;
margin-left: .5rem;
color: $highlight-code-note-color;
}
&.external-link {
float: right;
margin-right: 2em;
}
}
}
figcaption.custom {
min-height: 1.5rem;
if (codeStyle == 'default') {
border-radius: .25rem;
}
if (codeStyle == 'carbon') {
display: flex;
}
.custom-lang {
float: left;
margin: 0 .6rem;
color: $highlight-code-lang-color;
}
if (codeStyle == 'carbon') {
.custom-carbon {
display: flex;
margin: .2rem 0 0 .5rem;
font-size: 0;
align-items: center;
&-dot {
display: inline-block;
margin: 0 4px;
border-radius: 50%;
width: 10px;
height: 10px;
&--red {
background-color: #ff5f56;
}
&--yellow {
background-color: #ffbd2e;
}
&--green {
background-color: #27c93f;
}
}
}
}
}
addLineNumber() {
.line {
&::before {
content: counter(line);
display: inline-block;
margin-right: .5rem;
box-sizing: content-box;
padding: 0 .8rem 0 .4rem;
min-width: 1rem;
text-align: right;
color: $highlight-side-color;
background-color: $highlight-side-bg-color;
counter-increment: line;
}
}
}
& figcaption:not(.custom) {
if (codeStyle == 'carbon') {
background-color: $highlight-side-bg-color;
}
if (codeStyle == 'simple' || (codeStyle == 'carbon')) {
& + .table-container,
& + table {
if (wordWrap) {
td.code {
padding: 0;
}
addLineNumber();
} else {
td.gutter {
display: table-cell;
}
}
}
}
}
td.gutter {
border-right: 1px solid $gap-line-color;
padding: .4rem .6rem;
width: 2rem;
background-color: $highlight-side-bg-color;
if (codeStyle == 'default') {
border-radius: .25rem;
}
if (wordWrap || (codeStyle == 'simple' || (codeStyle == 'carbon'))) {
display: none;
}
pre {
text-align: right;
white-space: nowrap;
color: $highlight-side-color;
background-color: inherit;
}
}
td.code {
if (codeStyle == 'simple' || (codeStyle == 'carbon')) {
padding: .5rem .75rem;
} else if (codeStyle == 'default') {
if (wordWrap) {
padding: 0;
} else {
padding: .5rem .6rem;
}
}
}
if (wordWrap && (codeStyle == 'default')) {
addLineNumber();
}
.marked {
background-color: $marked-line-bg-color;
}
.emphasis {
font-style: italic;
}
.strong {
font-weight: bold;
}
.comment {
color: $highlight-comment;
}
.quote,
.params {
color: $highlight-color;
}
.selector-tag,
.template-variable,
.variable,
.deletion,
.regexp,
.name,
.tag {
color: $highlight-red;
}
.builtin-name,
.literal,
.number,
.type,
.meta,
.link {
color: $highlight-orange;
}
.class .keyword:first-child + .title,
.built_in,
.attribute {
color: $highlight-yellow;
}
.class .keyword ~ .title,
.string .template-variable,
.meta-string,
.tag,
.class,
.subst,
.regexp {
color: $highlight-green;
}
.string,
.symbol,
.bullet,
.addition {
color: $highlight-aqua;
}
.title,
.section {
color: $highlight-blue;
}
.meta-keyword,
.doctag,
.selector-id,
.selector-attr,
.selector-class,
.selector-pseudo,
.function,
.tag .attr,
.keyword {
color: $highlight-purple;
}
}
.bash .meta,
.rust .meta {
color: $highlight-comment;
}
.c\\+\\+ .built_in,
.cpp .built_in,
.ini .variable,
.ini .literal,
.ini .number,
.less .variable,
.scss .variable,
.styl .variable,
.stylus .variable {
color: $highlight-color;
}
.html .meta,
.xml .meta,
.yaml .attr,
.yml .attr {
color: $highlight-red;
}
.js .params,
.javascript .params {
color: $highlight-orange;
}
.json .attr,
.swift .type {
color: $highlight-yellow;
}
.variable .variable,
.bash .variable,
.c\\+\\+ .meta,
.cpp .meta,
.c\\# .meta,
.css .number,
.diff .meta {
color: $highlight-green;
}
.md .section,
.markdown .section,
.py .string .meta,
.python .string .meta {
color: $highlight-aqua;
}
.bash .built_in,
.css .built_in,
.go .built_in,
.py .meta,
.python .meta,
.shell .meta,
.shell .keyword,
.shell .built_in {
color: $highlight-blue;
}
.ini .attr,
.objectivec .meta,
.yaml .type,
.yml .type {
color: $highlight-purple;
}
.diff {
.addition {
color: $highlight-addition-color;
background-color: $highlight-addition-bg-color;
}
.deletion {
color: $highlight-deletion-color;
background-color: $highlight-deletion-bg-color;
}
}
if (hexo-config('night_mode.enable')) {
.nightmode {
if (hexo-config('codeblock.highlight') == 'light') {
.diff {
.addition {
background-color: transparent;
}
.deletion {
background-color: transparent;
}
}
}
}
}
@import './theme.styl';
@import './highlight.styl';
@import './diff.styl';
codeStyle = hexo-config('codeblock.style') || 'default';
highlight_theme = hexo-config('codeblock.highlight') || 'light';
if (highlight_theme == 'light') {
$highlight-color = #333333;
$highlight-background = #f5f6f7;
$highlight-side-color = lighten($highlight-color, 60%);
$highlight-side-bg-color = $highlight-background;
$highlight-header-color = $highlight-color;
$highlight-header-bg-color = $highlight-side-bg-color;
$highlight-code-lang-color = lighten($highlight-header-color, 60%);
$highlight-code-note-color = $highlight-header-color;
$copy-button-color = lighten($highlight-header-color, 60%);
$gap-line-color = darken($highlight-background, 10%);
$marked-line-bg-color = darken($highlight-background, 6%);
$highlight-comment = #969896;
$highlight-red = #c82829;
$highlight-orange = #ee8019;
$highlight-yellow = #eab700;
$highlight-green = #4eb4b4;
$highlight-aqua = #4dc14c;
$highlight-blue = #2a75c8;
$highlight-purple = #be4dbc;
if (hexo-config('night_mode.enable')) {
$highlight-color = var(--color-gray-850);
$highlight-background = var(--color-gray-200);
$highlight-side-color = var(--color-gray-550);
$highlight-side-bg-color = var(--color-gray-200);
$highlight-header-color = var(--color-gray-850);
$highlight-header-bg-color = var(--color-gray-200);
$highlight-code-lang-color = var(--color-gray-550);
$highlight-code-note-color = var(--color-gray-850);
$copy-button-color = var(--color-gray-550);
$gap-line-color = var(--color-gray-300);
$marked-line-bg-color = var(--color-gray-260);
}
}
if (highlight_theme == 'dark') {
$highlight-color = #abb2bf;
$highlight-background = #282c34;
$highlight-side-color = darken($highlight-color, 40%);
$highlight-side-bg-color = $highlight-background;
$highlight-header-color = $highlight-color;
$highlight-header-bg-color = $highlight-side-bg-color;
$highlight-code-lang-color = darken($highlight-header-color, 40%);
$highlight-code-note-color = $highlight-header-color;
$copy-button-color = darken($highlight-header-color, 40%);
$gap-line-color = lighten($highlight-background, 10%);
$marked-line-bg-color = lighten($highlight-background, 6%);
$highlight-comment = #5c6370;
$highlight-red = #f45a5a;
$highlight-orange = #de812c;
$highlight-yellow = #eedc6e;
$highlight-green = #56b6c2;
$highlight-aqua = #98c379;
$highlight-blue = #4a98d8;
$highlight-purple = #be74d5;
}
if (highlight_theme == 'ocean') {
$highlight-color = #f8f8f8;
$highlight-background = #304148;
$highlight-side-color = darken($highlight-color, 40%);
$highlight-side-bg-color = $highlight-background;
$highlight-header-color = $highlight-color;
$highlight-header-bg-color = $highlight-side-bg-color;
$highlight-code-lang-color = darken($highlight-header-color, 40%);
$highlight-code-note-color = $highlight-header-color;
$copy-button-color = darken($highlight-header-color, 40%);
$gap-line-color = lighten($highlight-background, 10%);
$marked-line-bg-color = lighten($highlight-background, 6%);
$highlight-comment = #65737e;
$highlight-red = #eb606b;
$highlight-orange = #f99157;
$highlight-yellow = #fac863;
$highlight-green = #5fb3b3;
$highlight-aqua = #99c794;
$highlight-blue = #6699cc;
$highlight-purple = #c594c5;
}
if (codeStyle == 'carbon') {
$highlight-header-bg-color = $highlight-background;
}
@import './header/index.styl';
@import './footer/index.styl';
@import './sidebar/index.styl';
@import './search/index.styl';
@import './pages/index.styl';
@import './post/index.styl';
@import './highlight/index.styl';
@import './widgets/index.styl';
@import './plugins/index.styl';
@import './analytics/index.styl';
@import './page.styl';
@import './timeline.styl';
.archive {
margin-left: 1rem;
&-total {
position: relative;
padding: 0 0 1.5rem 1.5rem;
font-size: calc(1em + 2px);
&::before {
content: '';
position: absolute;
top: 1em;
bottom: -1em;
left: 0;
border-left: .2rem dashed var(--color-gray-250);
transform: translateX(-50%);
}
&::after {
content: '';
position: absolute;
top: 1em;
left: 0;
border: .15rem solid $post-timeline-dot-color;
border-radius: 50%;
width: .6rem;
height: .6rem;
background-color: var(--color-gray-250);
transition: border-color .2s ease;
transform: translate(-50%, -50%);
}
&:hover {
&::after {
border-color: $post-timeline-dot-hover-color;
}
}
}
}
.tagcloud,
.category {
width: 100%;
&-total {
font-size: calc(1em + 10px);
text-align: center;
cursor: default;
}
}
.tagcloud {
text-align: center;
&-item {
a {
margin: 0 .4rem;
transition: color .2s ease;
&:hover {
color: $tag-hover-color !important;
}
}
}
}
.category {
&-list {
&-item {
&::before {
color: $category-list-dot-color;
}
&:hover {
&::before {
color: $category-list-dot-hover-color;
}
}
}
&-link {
font-size: 1em;
color: $category-link-color;
transition: color .2s ease;
&:hover {
color: $category-link-hover-color;
}
}
&-count {
margin-left: .3em;
font-size: $font-size-base - 1px;
color: var(--color-gray-600);
&::before {
content: '(';
}
&::after {
content: ')';
}
}
}
}
.categorypage,
.tagpage {
&-title {
font-size: $font-size-base + 10px;
text-align: center;
&__name {
color: $blue-light;
}
}
}
.custompage {
width: 100%;
}
.timeline {
position: relative;
&::before {
content: '';
position: absolute;
top: 1em;
bottom: 1em;
left: 0;
border-left: .2rem solid var(--color-gray-250);
transform: translateX(-50%);
}
&-item {
display: block;
position: relative;
margin-bottom: .8rem;
padding-left: 1.5rem;
width: 100%;
align-items: center;
&::before {
content: '';
position: absolute;
top: 50%;
left: 0;
border-radius: 50%;
width: .3rem;
height: .3rem;
background-color: $post-timeline-dot-color;
transition: background-color .2s ease;
transform: translate(-50%, -50%);
}
&:hover::before {
background-color: $post-timeline-dot-hover-color;
}
&:last-child {
margin-bottom: 0;
}
&--year {
font-weight: 700;
&::before {
border: .12rem solid $post-timeline-dot-color;
width: .4rem;
height: .4rem;
background-color: var(--color-gray-250);
}
&:hover {
&::before {
border-color: $post-timeline-dot-hover-color;
background-color: var(--color-gray-250);
}
}
}
time-width = 3.5rem;
sticky-top-width = 1rem;
&__time {
display: inline-block;
width: time-width;
vertical-align: middle;
color: #99a9bf;
transform: translateY(3%);
}
&__title {
display: inline-block;
margin: 0;
width: 'calc(100% - %s)' % (time-width + sticky-top-width);
font-size: 1em;
font-weight: normal;
vertical-align: middle;
}
&__link {
color: var(--color-gray-900);
}
}
}
.friends-plugin {
overflow: hidden;
max-width: 100%;
&__item {
display: flex;
float: left;
padding: .5rem 1rem;
width: 50%;
height: 100px;
transition: background-color .3s;
align-items: center;
&:hover {
background-color: alpha($blue-light, .1);
}
p {
margin: 0;
}
avatar-width = 60px;
&-avatar {
margin: 0 1rem 0 0;
border-radius: 50% !important;
width: avatar-width;
height: avatar-width;
}
&-info {
overflow: hidden;
width: 100%;
color: var(--color-gray-800);
&__name,
&__intro {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
&__name {
font-weight: $font-weight-bolder;
}
&__intro {
font-size: .9em;
color: #999;
}
}
}
}
@import './table.styl';
@import './note.styl';
@import './friends.styl';
$note-padding = 12px;
$note-icon-size = $font-size-base + 4px;
.note-plugin {
position: relative;
margin-bottom: 20px;
border: 1px solid var(--color-gray-250);
border-left-width: 6px;
padding: 0 $note-padding + 5px;
&:not(.no-icon) {
padding-left: 40px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
}
p {
margin: $note-padding 0;
}
strong {
font-size: $note-icon-size;
line-height: 1.75;
}
&__icon {
position: absolute;
top: 1em;
left: 12px;
font-size: $note-icon-size;
line-height: 1;
&--default {
color: $note-default-color;
}
&--success {
color: $note-success-color;
}
&--info {
color: $note-info-color;
}
&--warning {
color: $note-warning-color;
}
&--danger {
color: $note-danger-color;
}
}
&.default {
border-left-color: $note-default-color;
strong {
color: $note-default-color;
}
}
&.success {
border-left-color: $note-success-color;
strong {
color: $note-success-color;
}
}
&.info {
border-left-color: $note-info-color;
strong {
color: $note-info-color;
}
}
&.warning {
border-left-color: $note-warning-color;
strong {
color: $note-warning-color;
}
}
&.danger {
border-left-color: $note-danger-color;
strong {
color: $note-danger-color;
}
}
}
.table-plugin {
tr {
transition: background-color .2s ease;
&:nth-of-type(even) {
background-color: var(--color-gray-150);
}
&:hover {
background-color: var(--color-gray-200);
}
}
th,
td {
min-width: 5rem;
}
}
@import './post-list.styl';
@import './post.styl';
// Only in homepage.
.postlist {
&-item {
margin: 0 0 1.5rem;
width: 100%;
layout-card();
}
}
.post {
&-readmore {
margin-top: 1.5rem;
text-align: center;
&__link {
display: inline-block;
border-radius: 5px;
padding: 0 .6em;
color: var(--color-gray-200);
background-color: $home-readmore-bg-color;
transition: background-color .2s ease;
cursor: pointer;
&:hover {
color: var(--color-gray-200);
background-color: $home-readmore-bg-hover-color;
}
}
&__icon {
margin-left: .3rem;
}
}
}
.post {
&-header {
position: relative;
margin-bottom: 1rem;
font-size: 1em;
text-align: center;
}
&-title {
margin: 0;
color: var(--color-gray-950);
cursor: auto;
&__link {
position: relative;
color: var(--color-gray-800);
break-word();
&::before {
content: '';
visibility: hidden;
position: absolute;
right: 0;
bottom: -4px;
left: 0;
height: 2px;
background-color: var(--color-gray-800);
transition: transform .2s ease-in-out;
transform: scaleX(0);
}
&:hover {
color: var(--color-gray-800);
&::before {
visibility: visible;
transform: scaleX(1);
}
}
}
}
&-meta {
&-item {
&: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')) {
&--createtime {
color: var(--color-gray-700);
}
}
if (hexo-config('post_meta.updated.enable')) {
&--updatetime {
color: $post-update-color;
}
}
if (hexo-config('post_meta.word_count.enable')) {
&--wordcount {
color: var(--color-gray-700);
}
}
if (hexo-config('post_meta.reading_time.enable')) {
&--readtime {
color: $post-reading-time-color;
}
}
if (hexo-config('busuanzi.post_pv.enable')) {
&--visitors {
color: $post-reading-count-color;
}
}
}
}
if (hexo-config('post_widget.end_text.enable')) {
&-ending {
margin-bottom: 1rem;
}
}
&-copyright {
margin-bottom: 1rem;
}
if (hexo-config('post_widget.tags')) {
&-tags {
margin-bottom: 1rem;
&-item {
margin: 0 .5rem;
&:hover {
cursor: pointer;
}
&__icon,
&__link {
margin: .1rem;
color: $post-tags-icon-color;
transition: color .2s;
^[-1]:hover & {
color: $orange-dark;
}
}
}
}
}
&-reward {
margin-bottom: 1rem;
}
&-paginator {
border-top: 1px solid var(--color-gray-250);
padding-top: 1rem;
}
}
.search-input {
.ais-search-box {
max-width: 100%;
}
}
.algolia-hit-item {
&::before {
content: '';
display: inline-block;
margin-right: .8rem;
border: .15rem solid $blue-light;
border-radius: 50%;
width: .6rem;
height: .6rem;
background-color: #f5f6f7;
transition: color .2s;
}
em {
font-style: normal;
color: $red-dark;
background-color: transparent;
}
}
#algolia-pagination {
margin: .5rem 0;
ul {
margin: 0;
padding: 0;
text-align: center;
}
}
.ais-pagination {
&--item {
a {
display: block;
border-radius: 3px;
width: 1.5rem;
height: 1.5rem;
font-size: $font-size-base + 2pxr;
line-height: 1.5rem;
text-align: center;
transition: color .2s ease, background-color .2s ease;
cursor: pointer;
&:hover {
color: #fff;
background-color: $blue-light;
}
}
}
}
#algolia-stats {
overflow: hidden;
}
.algolia-logo {
img {
width: 4rem;
height: 1.5rem;
}
}
search-popup-padding = 1rem;
search-input-height = 2rem;
search-input-margin = 1rem;
search-assist-height = 2rem;
.search {
&-mask {
display: none;
position: fixed;
top: 0;
left: 0;
z-index: $z-index2;
width: 100%;
height: 100%;
background-color: alpha(#333, .7);
}
&-popup {
display: none;
position: fixed;
top: 10%;
left: 50%;
z-index: $z-index2;
margin-left: -350px;
border-radius: 5px;
padding: search-popup-padding;
width: 700px;
max-height: 80%;
font-size: $font-size-base + 2px;
color: var(--color-gray-700);
background-color: var(--color-gray-250);
}
&-input {
margin: search-input-margin 0;
input {
border: 2px solid alpha($blue-light, .5);
border-radius: 2rem;
padding: .2rem .8rem;
height: search-input-height;
line-height: search-input-height;
color: var(--color-gray-950);
background-color: var(--color-gray-200);
outline: 0;
transition: border-color .3s;
&:hover,
&:focus {
border-color: $blue-light;
}
}
input::placeholder {
color: var(--color-gray-500);
}
}
&-close {
position: absolute;
top: .5rem;
right: .5rem;
width: 1rem;
height: 1rem;
font-size: 1.25em;
color: var(--color-gray-700);
cursor: pointer;
&::before,
&::after {
content: '';
display: block;
position: absolute;
top: 50%;
margin-top: -.1rem;
width: 1rem;
height: .2rem;
background-color: var(--color-gray-700);
}
@extend .anime-close;
}
&-results {
overflow: auto;
max-height: 16rem;
em {
font-style: normal;
background-color: $yellow-light;
}
}
&-btns {
height: search-assist-height;
text-align: center;
&-item {
margin: 0 5px;
border-radius: 5px;
padding: 3px 5px;
line-height: search-assist-height;
color: #fff;
background-color: $blue-lighter;
cursor: pointer;
i {
margin: 0 3px;
}
}
}
}
@import './common.styl' if (hexo-config('algolia_search.enable') || hexo-config('local_search.enable'));
@import './algolia.styl' if (hexo-config('algolia_search.enable'));
@import './localsearch.styl' if (hexo-config('local_search.enable'));
if (hexo-config('assist_search.enable')) {
search-results-height = search-popup-padding * 2 + search-input-margin * 2 + search-input-height + search-assist-height;
} else {
search-results-height = search-popup-padding * 2 + search-input-margin * 2 + search-input-height;
}
.search {
&-input {
input {
width: 100%;
}
}
&-results {
max-height: 'calc(80vh - %s)' % search-results-height;
b {
border-bottom: 1px dashed $red-dark;
color: $red-dark;
transition: color .2s ease;
}
& > ul {
margin: 0;
padding-left: 1.4rem;
li {
&:not(:last-child) {
margin-bottom: 1rem;
&::after {
content: '';
display: block;
border-bottom: 1px dashed var(--color-gray-400);
padding-bottom: .5rem;
width: 100%;
}
}
}
}
&-title {
font-weight: $font-weight-bold;
color: var(--color-gray-950);
transition: color .2s ease;
&:hover {
color: $blue-light;
}
}
&-content {
overflow: hidden;
width: 100%;
max-height: 5rem;
color: var(--color-gray-600);
}
&-none {
font-size: 3rem;
text-align: center;
color: var(--color-gray-600);
}
}
}
if (hexo-config('sidebar.enable')) {
.sidebar {
layout-card();
padding: 1rem;
width: convert(hexo-config('sidebar.width') || '$sidebar-width');
font-size: $font-size-sidebar;
&--sticky {
position: fixed;
top: convert(hexo-config('sidebar.offsetTop') || '30px');
z-index: $z-index0;
transform: translateZ(0);
}
.hide {
display: none;
}
&-wrap {
width: convert(hexo-config('sidebar.width') || '$sidebar-width');
if (hexo-config('sidebar.enable')) {
float: convert(hexo-config('sidebar.position'));
}
}
&-nav {
padding-bottom: 1em;
text-align: center;
&-toc,
&-ov {
border-bottom: 1px solid var(--color-gray-150);
padding: .3em .5em;
color: var(--color-gray-800);
transition: opacity .2s;
&:hover {
color: $sidebar-nav-text-hover-color;
cursor: pointer;
}
}
.current {
border-color: $sidebar-nav-text-hover-color;
color: $sidebar-nav-text-hover-color;
}
}
&-toc {
overflow: auto;
position: relative;
max-height: 70vh;
if (hexo-config('toc.wrap')) {
break-word();
} else {
white-space: nowrap;
}
if (!hexo-config('toc.expand_all')) {
.toc-child {
display: none;
}
.active > .toc-child {
display: block;
}
.current > .toc-child {
display: block;
}
}
.active,
.current {
& > a {
color: $orange-dark;
transition: color .3s;
}
}
ol,
li {
list-style: none;
}
ol {
margin: 0;
padding-left: 1em;
}
}
&-ov {
& > div + div {
if (hexo-config('sidebar.horizon_line')) {
border-top: 1px dashed var(--color-gray-300);
}
}
if (hexo-config('author.enable')) {
&-author {
width: 100%;
text-align: center;
&__avatar {
margin: 0 auto;
width: 120px;
height: 120px;
&_img {
opacity: hexo-config('author.avatar.opacity');
if (hexo-config('author.avatar.rounded')) {
border-radius: 50%;
}
}
&:hover &_img {
animation: convert('avatar-' + (hexo-config('author.avatar.animation') || 'turn')) .8s both ease-out;
}
if (hexo-config('author.avatar.animation') == 'shake') {
@keyframes avatar-shake {
0% {
transform: scale(1);
}
10%,
20% {
transform: scale(.9) rotate(3deg);
}
30%,
50%,
70%,
90% {
transform: scale(1.1) rotate(-3deg);
}
40%,
60%,
80% {
transform: scale(1.1) rotate(3deg);
}
100% {
transform: scale(1);
}
}
} else if (hexo-config('author.avatar.animation') == 'turn') {
@keyframes avatar-turn {
100% {
transform: rotate(1turn);
}
}
}
}
&__text {
margin: .5rem 0 0;
font-weight: $font-weight-bold;
}
}
}
if (hexo-config('social_setting.enable')) {
&-social {
padding: .5rem 0;
text-align: center;
&-item {
display: inline-block;
margin: .2rem;
text-align: center;
color: var(--color-gray-100);
background-color: $sidebar-social-color;
&:hover {
color: var(--color-gray-100);
background-color: $sidebar-social-hover-color;
}
if (hexo-config('social_setting.icon_only')) {
border-radius: .75rem;
padding: 0 .25rem;
min-width: 1.5rem;
height: 1.5rem;
line-height: 1.5rem;
transition: background-color .2s ease;
} else {
border-radius: 3px;
padding: 0 .4rem;
transition: color .2s ease, background-color .2s ease;
&__icon,
&__text {
margin: 0 3px;
}
}
}
}
}
if (hexo-config('feed.enable')) {
&-feed {
padding: .5rem 0;
text-align: center;
&-icon {
margin-right: .3em;
}
&-email,
&-rss {
display: inline-block;
width: 50%;
&__link {
transition: color .2s ease;
}
&__icon {
margin-right: .2rem;
}
}
&-email__link {
color: $sidebar-feed-email-color;
&:hover {
color: darken($sidebar-feed-email-color, 20%);
}
}
&-rss__link {
color: $sidebar-feed-rss-color;
&:hover {
color: darken($sidebar-feed-rss-color, 20%);
}
}
}
}
&-state {
padding: .5rem 0;
text-align: center;
&-item {
display: inline-block;
width: 33.3%;
line-height: 1.5em;
transition: color .2s ease;
&:not(:last-child) {
border-right: 1px dashed var(--color-gray-300);
}
&--posts {
color: $sidebar-state-post-color;
&:hover {
color: darken($sidebar-state-post-color, 30%);
}
}
&--categories {
color: var(--color-gray-700);
&:hover {
color: var(--color-gray-900);
}
}
&--tags {
color: $sidebar-state-tag-color;
&:hover {
color: darken($sidebar-state-tag-color, 30%);
}
}
&__count {
font-weight: $font-weight-bold;
color: var(--color-gray-950);
}
}
}
if (hexo-config('creative_commons.enable') && hexo-config('creative_commons.sidebar')) {
&-cc {
padding-top: .5rem;
text-align: center;
}
}
}
if (hexo-config('reading_progress.enable')) {
&-reading {
overflow: hidden;
margin-top: .5em;
text-align: center;
&-info {
margin-bottom: .3em;
}
&-line {
width: 100%;
height: convert(hexo-config('reading_progress.height') || '1px');
background-color: convert(hexo-config('reading_progress.color') || '#49b1f5');
transition: transform .2s ease;
transform: translateX(-100%);
}
}
}
}
}
.back2top {
position: fixed;
right: 0;
bottom: 5vh;
transition: transform .2s ease;
transform: translateX(100%);
cursor: pointer;
&--show {
transform: translateX(-100%);
}
&--hide {
transform: translateX(100%);
}
&__icon {
display: block;
font-size: 1.2rem;
line-height: 1;
color: convert(hexo-config('back2top.icon.color') || '#666');
transition: color .2s ease;
transform: rotate(convert(hexo-config('back2top.icon.rotate') || '0'));
&:hover {
color: convert(hexo-config('back2top.icon.hover_color') || '#999');
}
}
}
.comments {
margin: 1.5rem 0 0;
width: 100%;
layout-card();
if (hexo-config('sidebar.position') == 'left') {
float: right;
} else if (hexo-config('sidebar.position') == 'right') {
float: left;
}
}
if (hexo-config('fbcomments.enable')) {
.fb-comments {
iframe {
width: 100% !important;
}
}
}
if (hexo-config('night_mode.enable')) {
if (hexo-config('gitalk.enable')) {
:root {
--color-gt-textarea-bg: #f6f6f6;
--color-gt-btn-bg: #ffffff;
--color-gt-user-bg: #f9f9f9;
--color-gt-admin-bg: #f6f9fe;
--color-gt-code-bg: #f9f9f9;
}
html.nightmode {
--color-gt-textarea-bg: #323c4c;
--color-gt-btn-bg: #323c4c;
--color-gt-user-bg: #333943;
--color-gt-admin-bg: #2f3945;
--color-gt-code-bg: #1b2b34;
}
}
if (hexo-config('valine.enable')) {
:root {
--color-gradient-begin: rgba(255, 255, 255, 0);
--color-gradient-end: rgba(255, 255, 255, 1);
}
html.nightmode {
--color-gradient-begin: rgba(43, 49, 59, 0);
--color-gradient-end: rgba(43, 49, 59, 1);
}
}
}
if (hexo-config('gitalk.enable')) {
// Gitalk
.gt-container {
width: 100%;
color: #6190E8;
.gt-header-textarea {
background-color: var(--color-gt-textarea-bg);
}
.gt-btn-preview {
background-color: var(--color-gt-btn-bg);
}
.gt-meta {
margin-top: 0;
border-color: var(--color-gray-250);
padding-top: 0;
}
.gt-user {
.gt-ico svg {
fill: var(--color-gray-900);
}
}
.gt-comment {
&-body {
color: var(--color-gray-850) !important;
h1,
h2,
h3,
h4,
h5,
h6 {
color: var(--color-gray-850);
}
h1,
h2 {
border-bottom: 1px solid var(--color-gray-250);
}
blockquote {
color: var(--color-gray-600);
}
code,
pre {
color: var(--color-gray-700);
background-color: var(--color-gt-code-bg);
}
table tr {
background-color: inherit;
}
th,
td {
border: 1px solid var(--color-blue-200);
}
}
&-text,
&-date {
color: var(--color-gray-600);
}
&-admin {
.gt-comment-content {
background-color: var(--color-gt-admin-bg);
&:hover {
box-shadow: 0 0 16px 8px var(--color-gray-300);
}
}
}
&-content {
background-color: var(--color-gt-user-bg);
&:hover {
box-shadow: 0 0 16px 8px var(--color-gray-300);
}
}
}
.markdown-body {
.pl-md,
.pl-mc {
background-color: var(--color-gray-150);
}
.pl-ii,
.pl-c2,
.pl-mi1,
.pl-mi2 {
color: var(--color-gray-200);
}
.pl-sg {
color: var(--color-gray-500);
}
.pl-c,
.pl-ba {
color: var(--color-gray-700);
}
.pl-smi,
.pl-s .pl-s1,
.pl-mi,
.pl-mb {
color: var(--color-gray-900);
}
.pl-c1,
.pl-s .pl-v {
color: #6699cc;
}
.pl-s,
.pl-pds,
.pl-s .pl-pse .pl-s1,
.pl-sr,
.pl-sr .pl-cce,
.pl-sr .pl-sre,
.pl-sr .pl-sra {
color: #99c794;
}
.pl-corl {
color: #99c794;
}
}
}
}
if (hexo-config('valine.enable')) {
#valine-container {
code,
pre {
background-color: var(--color-gray-200);
}
.markdown {
fill: var(--color-gray-700);
}
.vnum,
.vbtn,
.vctrl,
.vinput,
.vcount,
.vemoji-btn,
.vpreview-btn,
.vcontent *,
.vpreview *,
a {
color: var(--color-gray-700);
}
.vinput {
border-bottom: 1px dashed var(--color-gray-300);
}
.vcontent {
&.expand {
&::before {
color: var(--color-gray-600);
background: linear-gradient(180deg, var(--color-gradient-begin), var(--color-gradient-end));
}
&::after {
color: var(--color-gray-600);
background: var(--color-gradient-end);
}
}
}
.vsys,
.vbtn {
background-color: var(--color-gray-250);
}
.vbtn {
border-color: var(--color-gray-250);
&:hover {
border-color: #3090e4;
color: #3090e4;
}
}
.vwrap {
border-color: var(--color-gray-250);
}
.vlist .vcard .vh {
border-bottom: 1px dashed var(--color-gray-250);
}
.vcode {
color: var(--color-gray-900);
background-color: var(--color-gray-250);
}
}
}
if (hexo-config('livere.enable')) {
// Livere
#lv-container {
width: 100%;
}
}
if (hexo-config('disqus.enable')) {
// Disqus
#disqus_thread {
width: 100%;
background-color: #fff;
}
}
.copy-button {
position: absolute;
top: 0;
right: 0;
width: 1.5rem;
height: 1.5rem;
line-height: 1.5rem;
text-align: center;
color: var(--color-gray-800);
cursor: pointer;
i {
color: $copy-button-color;
}
}
.copyright {
position: relative;
border: 1px solid var(--color-gray-250);
padding: .8rem 1rem;
width: 100%;
transition: box-shadow .2s ease;
&:hover {
box-shadow: 0 0 16px 8px var(--color-gray-250);
}
&-author,
&-link,
&-notice {
&__name {
font-weight: $font-weight-bold;
break-word();
}
&__value {
color: var(--color-gray-800);
break-all();
}
}
}
.ending {
padding: 1rem 0 0;
text-align: center;
color: var(--color-gray-400);
if (hexo-config('post_widget.end_text.horizon_line')) {
border-top: 1px dashed var(--color-gray-300);
}
}
if (hexo-config('external_link.icon.enable')) {
.exturl {
&__icon {
margin: 0 .1em 0 .3em;
font-size: .8em;
color: convert(hexo-config('external_link.icon.color') || '#aaa');
}
&__link {
break-word();
}
}
.footer {
.exturl__icon {
color: #fff;
}
}
}
.gallery {
img {
margin-bottom: convert(hexo-config('gallery_waterfall.gap_y') || '10px');
if (hexo-config('gallery_waterfall.enable')) {
width: convert(hexo-config('gallery_waterfall.col_width') || '220px');
}
}
}
@import './ending.styl' if (hexo-config('post_widget.end_text.enable'));
@import './back2top.styl' if (hexo-config('back2top.enable'));
@import './fancybox.styl' if (hexo-config('fancybox'));
@import './zoom-image.styl' if (hexo-config('zoom_image.enable'));
@import './lazyload.styl' if (hexo-config('lazyload.enable'));
@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 './reward.styl';
@import './copyright.styl';
@import './gallery-image.styl';
@import './font-icon.styl';
@import './comments.styl';
@import './copy-button.styl';
@import './sticky-top.styl';
@import './paginator.styl';
.lazyload {
&-block {
box-sizing: content-box;
min-width: 30px;
min-height: 30px;
}
}
.loading-bar {
position: fixed;
top: 0;
left: 0;
z-index: 99999;
opacity: 0;
transition: opacity .4s linear;
&__progress {
position: fixed;
top: 0;
left: 0;
width: 0;
height: 2px;
background-color: $loading-bar-bg-color;
box-shadow: 0 0 10px $loading-bar-shadow-color;
}
&.loading {
opacity: 1;
transition: none;
}
&.loading &__progress {
transition: width .4s ease;
}
}
.mode {
position: relative;
border: 0;
padding: 0;
line-height: 100%;
background-color: transparent;
cursor: pointer;
user-select: none;
track-width = 50px;
track-height = 24px;
&--focus {
.mode-thumb {
box-shadow: 0 0 2px 3px #0099e0;
}
}
&--checked {
.mode-thumb {
transform: translateX(track-width - track-height);
}
}
&-track {
border-radius: 30px;
width: 50px;
height: 24px;
font-size: 0;
background-color: convert(hexo-config('night_mode.button.bg_color') || '#8c8a8a');
&-moon,
&-sun {
display: inline-block;
position: absolute;
top: 0;
bottom: 0;
width: (track-width / 2);
height: 100%;
font-size: 14px;
&::before {
display: block;
width: 100%;
height: 100%;
font-size: 14px;
line-height: track-height;
text-align: center;
}
}
&-moon {
left: 0;
&::before {
if (hexo-config('night_mode.icon.dark')) {
content: hexo-config('night_mode.icon.dark');
} else {
content: '🌜';
}
}
}
&-sun {
right: 0;
&::before {
if (hexo-config('night_mode.icon.light')) {
content: hexo-config('night_mode.icon.light');
} else {
content: '🌞';
}
}
}
}
&-thumb {
position: absolute;
top: 1px;
left: 1px;
box-sizing: border-box;
border: 1px solid #4d4d4d;
border-radius: 50%;
width: track-height - 2px;
height: track-height - 2px;
background-color: convert(hexo-config('night_mode.button.color') || '#fafafa');
transition: transform .2s ease;
}
&-input {
position: absolute;
border: 0;
width: 0;
height: 0;
}
}
.paginator {
margin-top: 1rem;
text-align: center;
// ------------------------------
// Pagination for Home/Archives
// ------------------------------
&-inner {
border-radius: 5px;
padding: 12px 0;
background-color: var(--color-gray-150);
}
.page-number,
.prev,
.next {
display: inline-block;
margin: 0 .5em;
border: 1px solid transparent;
border-radius: 3px;
width: 1.5rem;
height: 1.5rem;
line-height: 1.5rem;
text-align: center;
vertical-align: middle;
transition: border .2s ease;
&:hover {
border-color: var(--color-gray-260);
}
}
.current {
color: $pagination-item-active-color;
background-color: $pagination-item-active-bg-color;
&:hover {
border-color: transparent;
}
}
// -------------------------
// Pagination for Articles
// -------------------------
&-prev,
&-next {
width: 100%;
&__link {
break-word();
color: $pagination-arrow-color;
transition: color .2s ease;
&:hover {
color: $pagination-arrow-hover-color;
}
}
}
&-prev {
text-align: left;
&__icon {
margin-right: .3rem;
}
}
&-next {
text-align: right;
&__icon {
margin-left: .3rem;
}
}
}
.reward {
text-align: center;
&-button {
display: inline-block;
margin: 1rem 0 1.5rem;
border-radius: 6px;
padding: .2rem 1rem;
color: #f5f6f7;
background-color: $reward-btn-color;
transition: background-color .2s ease;
cursor: pointer;
&:hover {
background-color: $reward-btn-hover-color;
}
}
&-qrcode {
display: none;
&-alipay,
&-wechat {
display: inline-block;
margin: 0 2rem;
&__img {
width: 200px;
height: 200px;
}
&__text {
margin: .5rem 0;
}
}
&-alipay {
&__text {
color: $reward-alipay-color;
}
}
&-wechat {
&__text {
color: $reward-wechat-color;
}
}
}
}
.sticky-top {
position: absolute;
top: 0;
width: 1rem;
height: 1rem;
line-height: 1rem;
text-align: center;
if (hexo-config('stick_top.position') == 'left') {
left: 0;
} else if (hexo-config('stick_top.position') == 'right') {
right: 0;
}
stick-top-rotate = convert(hexo-config('stick_top.rotate' || '0deg'));
&__icon {
display: block;
width: 100%;
height: 100%;
color: convert(hexo-config('stick_top.color' || '#999'));
transform: rotate(stick-top-rotate);
}
}
.archive {
.sticky-top {
top: 50%;
right: 0;
left: auto;
transform: translate(0, -50%);
}
}
.zoomimg-mask {
position: fixed;
top: 0;
left: 0;
z-index: $z-index2;
width: 100%;
height: 100%;
background-color: convert(hexo-config('zoom_image.mask_color') || '#fff');
opacity: 0;
}
// Zoom in image without fancybox.
.zoomimg {
cursor: zoom-in;
&--hide {
visibility: hidden;
}
&-clone {
position: absolute;
z-index: $z-index2;
background-color: #fff;
cursor: zoom-out;
will-change: transform;
}
}
@import './scaffolding/index.styl';
@import './outline/index.styl';
@import './components/index.styl';
@import './responsive.styl';
bodyBgSet() {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
if (hexo-config('body.bg_image.fixed')) {
position: fixed;
height: 100vh;
}
}
if (hexo-config('body.bg_image.enable')) {
body {
position: relative;
&::after {
bodyBgSet();
z-index: $z-index-2;
background: url(hexo-config('body.bg_image.url')) no-repeat center / cover;
if (hexo-config('body.bg_image.repeat')) {
background-repeat: repeat;
background-size: auto;
}
}
}
}
body {
if (hexo-config('body.mask.enable')) {
&::before {
bodyBgSet();
z-index: $z-index-1;
background-color: alpha(#000, hexo-config('body.mask.opacity.default'));
}
}
}
if (hexo-config('body.mask.enable')) {
.nightmode {
body {
&::before {
background-color: alpha(#000, hexo-config('body.mask.opacity.night_mode'));
}
}
}
}
.container {
break-word();
display: flex;
overflow: hidden; /* !!! */
position: relative;
min-height: 100vh;
flex-direction: column;
}
.header {
flex: 0 0 auto;
}
.footer {
flex: 0 0 auto;
}
.main {
width: 100%;
flex: 1 0 auto;
}
.main-inner {
margin: 0 auto;
padding: convert(hexo-config('layout.main_padding.default') || '20px');
width: 100%;
font-size: $font-size-main;
}
.content-wrap {
if (hexo-config('sidebar.enable')) {
width: 'calc(100% - %s)' % ($sidebar-width + $content-sidebar-gap);
if (hexo-config('sidebar.position') == 'left') {
float: right;
} else if (hexo-config('sidebar.position') == 'right') {
float: left;
}
} else {
width: 100%;
}
&--noside {
float: none;
margin: 0 auto;
}
}
.content {
width: 100%;
layout-card();
img {
border: 1px solid var(--color-gray-300);
border-radius: 3px;
padding: .2rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
&:hover {
.heading-link {
visibility: visible;
}
}
}
}
.heading-link {
display: inline-block;
visibility: hidden;
margin: -10px 0 0 -20px;
padding-right: 5px;
width: 20px;
height: 16px;
font-size: 16px;
line-height: 20px;
vertical-align: middle;
color: var(--color-font);
}
.content-home {
padding: 0 !important;
background-color: transparent;
}
.pullquote {
&.left {
text-align: left;
}
&.right {
text-align: right;
}
}
.post-body {
if (hexo-config('heading_line')) {
h1,
h2 {
border-bottom: 1px solid var(--color-gray-250);
padding-bottom: .3em;
}
}
}
.table-container {
overflow: auto;
margin-bottom: 1rem;
}
// $main-width: A calc value.
// -----------------------------------------
@media (min-width: $main-width) {
if (hexo-config('sidebar.enable')) {
.header-nav-inner {
width: $main-width;
}
}
.main-inner {
width: $main-width;
}
}
// $md-width: 992px - 0.02px
// -----------------------------------------
@media (min-width: $md-width) {
if (!hexo-config('sidebar.enable')) {
.header-nav-inner {
width: $md-width;
}
}
.header {
&-nav {
&-menu {
display: inline-block !important;
opacity: 1 !important;
}
&-submenu {
border-radius: 3px;
}
}
}
}
// $md-width: 992px - 0.02px
// -----------------------------------------
@media (max-width: $md-width) {
.header {
&-inner {
height: 17rem;
}
&-banner {
&-info {
&__title {
margin-bottom: 1rem;
}
}
}
&-nav {
&-menubtn {
display: block;
float: left;
}
&-menu {
overflow: hidden;
position: absolute;
top: header-nav-height;
right: 0;
left: 0;
width: auto;
height: auto;
background-color: $header-nav-bg-color;
&-item {
float: none;
overflow: hidden;
margin: 0;
&__link {
padding-right: 1.5rem;
padding-left: 1.5rem;
text-align: left;
color: #f4f5f5;
}
}
}
&-submenu {
display: block;
position: initial;
width: 100%;
&-item {
&__link {
padding-right: 1rem;
padding-left: 3rem;
text-align: left;
}
}
}
}
}
.content-wrap {
width: 100%;
}
if (hexo-config('sidebar.enable')) {
.sidebar-wrap {
display: none;
}
}
.post-list .post {
margin: 0 0 1rem;
padding: 1rem;
}
}
// sm-width: 768px - 0.02px
// -----------------------------------------
@media (max-width: $sm-width) {
.header {
&-nav {
&-inner {
padding: convert(hexo-config('layout.main_padding.tablet') || '15px');
}
}
&-banner {
&-info {
&__title {
margin-bottom: 1rem;
font-size: 3rem;
}
&__subtitle {
font-size: .9rem;
}
}
}
}
.main-inner {
padding: convert(hexo-config('layout.main_padding.tablet') || '15px');
}
if (hexo-config('algolia_search.enable') || hexo-config('local_search.enable')) {
.search {
&-popup {
top: 0;
left: 0;
margin: 0;
border-radius: 0;
width: 100%;
height: 100vh;
max-height: 100vh;
}
&-results {
max-height: 'calc(100vh - %s)' % search-results-height;
}
}
}
}
// xs-width: 576px - 0.02px
// -----------------------------------------
@media (max-width: $xs-width) {
.header {
&-inner {
height: 13rem;
}
&-nav {
&-inner {
padding: convert(hexo-config('layout.main_padding.mobile') || '10px');
}
if (hexo-config('algolia_search.enable') || hexo-config('local_search.enable')) {
&-search__text {
display: none;
}
}
}
&-banner {
&-info {
&__title {
margin-bottom: .5rem;
font-size: 2rem;
}
&__subtitle {
font-size: $font-size-base;
}
}
&-arrow {
bottom: .5rem;
}
}
}
.main-inner {
padding: convert(hexo-config('layout.main_padding.mobile') || '10px');
}
.content,
.comments {
padding: .6rem .8rem;
font-size: $font-size-base + 1px;
}
.archive {
margin-left: .5rem;
&-total {
padding-left: 1rem;
}
}
.timeline {
&-item {
padding-left: 1rem;
&__time {
width: 2.75rem;
}
&__title {
width: calc(100% - 4rem);
}
}
}
.post-list .post {
margin: 0 0 .8rem;
padding: .8rem;
}
if (hexo-config('algolia_search.enable')) {
.algolia-hit-item {
margin: 0;
}
}
if (hexo-config('gallery_waterfall.enable')) {
.gallery {
img {
width: 100%;
}
}
}
.friends-plugin {
&__item {
margin: 0;
padding: .5rem 1rem;
width: 100%;
}
}
}
:root {
--color-gray-100: #ffffff;
--color-gray-150: #f9f9f9;
--color-gray-200: #f5f6f7;
--color-gray-250: #efefef;
--color-gray-260: #e5e7ea;
--color-gray-300: #dadada;
--color-gray-400: #ccd0d5;
--color-gray-500: #bec3c9;
--color-gray-550: #adadad;
--color-gray-600: #8d949e;
--color-gray-650: #757474;
--color-gray-700: #606770;
--color-gray-800: #444950;
--color-gray-850: #303846;
--color-gray-900: #2c323c;
--color-gray-950: #1c1e21;
--color-font: var(--color-gray-900);
--color-card: var(--color-gray-100);
--color-blue-200: #ebeef5;
}
html.nightmode {
--color-gray-100: #1c1e21;
--color-gray-150: #2c323c;
--color-gray-200: #303846;
--color-gray-250: #444950;
--color-gray-260: #555b64;
--color-gray-300: #606770;
--color-gray-400: #757474;
--color-gray-500: #8d949e;
--color-gray-550: #959595;
--color-gray-600: #bec3c9;
--color-gray-650: #ccd0d5;
--color-gray-700: #dadada;
--color-gray-800: #eaecef;
--color-gray-850: #f5f6f7;
--color-gray-900: #f9f9f9;
--color-gray-950: #ffffff;
--color-font: var(--color-gray-600);
--color-card: var(--color-gray-150);
--color-blue-200: #444950;
}
::selection {
color: $selection-color;
background-color: $selection-bg;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
html {
box-sizing: border-box;
font-size: $font-size-rem;
}
body {
margin: 0;
padding: 0;
font-family: $font-family-base;
font-size: $font-size-base;
line-height: $line-height-base;
color: var(--color-font);
background-color: var(--color-gray-250);
}
h1,
h2,
h3,
h4,
h5,
h6 {
padding: 0;
font-family: $font-family-heading;
font-weight: $font-weight-bolder;
line-height: $line-height-heading;
}
for size in 1 .. 6 {
h{size} {
font-size: $font-size-headings[size - 1];
}
}
p {
margin: 0 0 1rem;
}
a {
text-decoration: none;
color: $link-color;
background-color: transparent;
outline: none;
cursor: pointer;
}
img,
video,
iframe {
display: block;
margin-right: auto;
margin-left: auto;
max-width: 100%;
}
hr {
margin: 1rem 0;
border: 2px dashed $hr-color;
height: 0;
}
blockquote {
margin: 0;
border-left: 5px solid var(--color-gray-300);
padding: 0 1rem;
background-color: var(--color-gray-200);
& cite::before {
content: '--';
padding: 0 .25rem;
}
}
code {
break-word();
border-radius: 3px;
padding: 1px 5px;
font-family: $font-family-code;
font-size: .95em;
color: var(--color-gray-700);
background-color: var(--color-gray-200);
}
dt {
font-weight: $font-weight-bolder;
}
dd {
margin: 0;
padding: 0;
}
table {
border-spacing: 0;
border-collapse: collapse;
width: 100%;
}
th,
td {
border: 1px solid var(--color-blue-200);
padding: 0 5px;
}
acronym,
abbr {
cursor: help;
}
kbd {
display: inline-block;
border: 1px solid var(--color-gray-500);
border-radius: 3px;
padding: .1rem .2rem;
font-family: $font-family-kbd;
font-size: .85em;
font-weight: $font-weight-bolder;
line-height: 1;
white-space: nowrap;
color: var(--color-gray-850);
background-color: var(--color-gray-150);
box-shadow: 0 -1px 0 var(--color-gray-300) inset;
}
@import 'nib';
@import './normalize.styl';
@import './base.styl';
@import './utils.styl';
/* normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
margin: .67em 0;
font-size: 2em;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
overflow: visible; /* 2 */
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
margin: 0; /* 2 */
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
overflow: visible; /* 1 */
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
text-transform: none; /* 1 */
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: .35em .75em .625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
display: table; /* 1 */
box-sizing: border-box; /* 1 */
padding: 0; /* 3 */
max-width: 100%; /* 1 */
white-space: normal; /* 1 */
color: inherit; /* 2 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type='checkbox'],
[type='radio'] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type='search'] {
outline-offset: -2px; /* 2 */
-webkit-appearance: textfield; /* 1 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
font: inherit; /* 2 */
-webkit-appearance: button; /* 1 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}
.clearfix {
clearfix();
}
// UI components
// ----------------------------------------
// "Popover" component
[data-popover] {
position: relative;
}
[data-popover]::before {
position: absolute;
top: 0;
left: 50%;
z-index: $z-index2;
font-family: sans-serif, Arial;
font-size: $font-size-base;
font-weight: normal;
font-style: normal;
line-height: $line-height-base;
white-space: nowrap;
color: #fff;
background-color: alpha(#000, .9);
opacity: 0;
text-shadow: none;
transition: opacity .2s ease, transform .2s ease;
transform: translate(-50%, -70%);
pointer-events: none;
}
[data-popover]::before {
content: attr(data-popover);
border-radius: 4px;
padding: .2rem .6rem;
}
@media (min-width: $md-width) {
[data-popover-pos='up']:hover::before {
opacity: 1;
transform: translate(-50%, -120%);
}
}
// "Alert" component
.stun-message {
position: fixed;
top: 1rem;
left: 50%;
z-index: $z-index2;
transform: translateX(-50%);
}
.stun-alert {
position: relative;
border-radius: 3px;
padding: 8px 12px;
font-size: $font-size-base + 2px;
line-height: 1rem;
background-color: #fff;
box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
&-success {
color: $alert-success-color;
& ~ i {
color: $alert-success-color;
}
}
&-info {
color: $alert-info-color;
& ~ i {
color: $alert-info-color;
}
}
&-warning {
color: $alert-warning-color;
& ~ i {
color: $alert-warning-color;
}
}
&-error {
color: $alert-error-color;
& ~ i {
color: $alert-error-color;
}
}
&-description {
margin-left: .5rem;
}
}
// Animation class
// ----------------------------------------
.anime-close {
&::before,
&::after {
transition: transform .2s ease;
transform: rotate(-45deg);
}
&::after {
transform: rotate(-135deg);
}
&:hover {
&::before,
&::after {
transform: rotate(0);
}
}
}
// Custom styles by yourself.
// You should always modify the style here, not in the source code.
// Otherwise, when the theme is updated, the code you modified will be overwritten.
clearfix() {
&::before,
&::after {
content: ' ';
display: table;
}
&::after {
clear: both;
}
}
break-word() {
white-space: normal;
word-wrap: break-word;
word-break: break-word;
}
break-all() {
white-space: normal;
word-wrap: normal;
word-break: break-all;
}
layout-card() {
border-radius: 5px;
padding: 1rem 2rem;
background-color: var(--color-card);
}
fontawesome-base() {
font: normal normal normal 14px / 1 $font-family-icons;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Global variables
// ==========================================
// Global color
$blue-light = #49b1f5
$blue-lighter = #a4d8fa
$red-dark = #ff0000
$orange-dark = #fc6423
$orange-light = #ff8d5c
$yellow-dark = #f2df17
$yellow-light = #fff494
// -------------------------------------------
// z-index list
// -------------------------------------------
$z-index-2 = -2
$z-index-1 = -1
$z-index0 = 0
$z-index1 = 1
$z-index2 = 2
// -------------------------------------------
// Layout
// -------------------------------------------
// Subtract 0.02px to prevent bugs when certain device sizes
// are exactly equal to critical dimensions
$xs-width = 576px - 0.02px
$sm-width = 768px - 0.02px
$md-width = 992px - 0.02px
$lg-width = 1200px - 0.02px
get-main-padding() {
$main-padding = convert(hexo-config('layout.main_padding.default'));
$gap-left = 0;
$gap-right = 0;
if ($main-padding[1]) {
$gap-right = $main-padding[1];
if ($main-padding[3]) {
$gap-left = $main-padding[3];
} else {
$gap-left = $main-padding[1];
}
} else {
$gap-left = $gap-right = $main-padding[0];
}
return $gap-left $gap-right;
}
// Width
$main-padding-width = get-main-padding()[0] + get-main-padding()[1]
$content-width = convert(hexo-config('layout.content') || '$sm-width')
$sidebar-width = convert(hexo-config('layout.sidebar') || '300px')
$content-sidebar-gap = convert(hexo-config('layout.content_sidebar_gap') || '30px')
if (hexo-config('sidebar.enable')) {
$main-width = $content-width + $sidebar-width + $content-sidebar-gap + $main-padding-width
} else {
$main-width = $content-width + $main-padding-width
}
// -------------------------------------------
// Font, line-height
// -------------------------------------------
// Line height
$line-height-base = 2 // global line height
$line-height-heading = 1.5 // <h1~6> line height
$line-height-codeblock = 1.7 // can`t less 1.3
// Font size
$font-size-rem = 20px // <html>
$font-size-base = 14px // <body>
$font-size-header = $font-size-base + 4px
$font-size-sidebar = $font-size-base + 2px
$font-size-main = $font-size-base + 2px
$font-size-footer = $font-size-base + 2px
// h1 h2 h3 h4 h5 h6
$font-size-headings = 2em 1.5em 1.25em 1em .875em .85em
// Font family
$font-family-chinese = 'PingFang SC', 'Microsoft YaHei'
$font-family-base = $font-family-chinese, sans-serif, Arial
$font-family-heading = $font-family-base
$font-family-code = 'Source Code Pro', Consolas, Menlo, Monaco, 'Courier New', monospace
$font-family-kbd = consolas, 'Liberation Mono', courier, monospace
$font-family-icons = 'FontAwesome'
// Font weight
$font-weight-light = 300
$font-weight-normal = 400
$font-weight-bold = 600
$font-weight-bolder = 700
// Element color
// -------------------------------------------
// Selection ( ::selection )
$selection-bg = #8be0e1
$selection-color = #fff
// Body ( <body> )
$body-bg-color = darken(#f4f5f5, 5%)
// Link ( <a> )
$link-color = #058ed2
$link-hover-color = #11a3eb
$link-bottom-color = transparent
$link-bottom-hover-color = #7ebef1
// Heading ( <h1~6> )
$heading-logo-color = $orange-dark
// Horizon line ( <hr> )
$hr-color = #b8dcfd
// Module color
// -------------------------------------------
// Header
$header-bg-color = #2d2e30
$header-text-color = #f5f6f7
$header-nav-bg-color = #2d2e30
$header-menu-hover-color = $blue-light
// Footer
$footer-bg-color = #2d2e30
$footer-text-color = #f5f6f7
$footer-link-color = #c20808
$footer-link-hover-color = #ed0b0b
// Home page
$home-readmore-bg-color = #73c8ff
$home-readmore-bg-hover-color = $blue-light
// Category page
$category-list-dot-color = $blue-light
$category-list-dot-hover-color = $orange-dark
$category-link-color = $blue-light
$category-link-hover-color = $orange-dark
// Tag page
$tag-hover-color = $orange-dark
// Sidebar
$sidebar-nav-text-hover-color = $orange-dark
$sidebar-social-color = #a0daff
$sidebar-social-hover-color = darken(#a0daff, 20%)
$sidebar-feed-email-color = #54bcff
$sidebar-feed-rss-color = #ff8956
$sidebar-state-post-color = #54bcff
$sidebar-state-tag-color = #ff8956
// Post
$post-update-color = $blue-light
$post-reading-time-color = $blue-light
$post-reading-count-color = $orange-dark
$post-tags-icon-color = $blue-light
// Post timeline (In the archive/tag/category page.)
$post-timeline-line-color = #c8edff
$post-timeline-dot-color = #6ec5ff
$post-timeline-dot-hover-color = $orange-dark
// Pagination
$pagination-item-active-color = #f4f5f5
$pagination-item-active-bg-color = $blue-light
$pagination-arrow-color = $blue-light
$pagination-arrow-hover-color = $orange-dark
// Reward
$reward-btn-color = #ff6868
$reward-btn-hover-color = #e45c5c
$reward-alipay-color = #1caceb
$reward-wechat-color = #3cb034
$loading-bar-bg-color = #77b6ff
$loading-bar-shadow-color = alpha(#77b6ff, .7)
// Notification
$alert-success-color = #52c41a
$alert-info-color = #1890ff
$alert-warning-color = #faad14
$alert-error-color = #f5222d
// Note plugin
$note-default-color = var(--color-gray-600)
$note-success-color = #42b983
$note-info-color = #4898dd
$note-warning-color = #e7c000
$note-danger-color = #dc3b3b
// Variables Layer
// --------------------------------------------------
@import './_variables/index.styl';
// Mixins Layer
// --------------------------------------------------
@import './_mixins/index.styl';
// Common Layer
// --------------------------------------------------
@import './_common/index.styl';
// Custom Layer
// --------------------------------------------------
@import './_custom/index.styl';
<svg xmlns="http://www.w3.org/2000/svg" width="273" height="72" x="0" y="0" version="1.0" viewBox="0 0 273 72"><linearGradient id="a" x1="327.272" x2="328.435" y1="-235.03" y2="-236.157" gradientTransform="matrix(94.045 0 0 94.072 -30797.893 22201.137)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#00aeff"/><stop offset="1" stop-color="#3369e7"/></linearGradient><path fill="url(#a)" d="M13.5 3.4h48c4.7 0 8.6 3.8 8.6 8.6v48c0 4.7-3.8 8.6-8.6 8.6h-48c-4.7 0-8.6-3.8-8.6-8.6V12c0-4.7 3.9-8.6 8.6-8.6z"/><path fill="#fff" d="M38.3 19.9c-10.2 0-18.4 8.2-18.4 18.4s8.2 18.4 18.4 18.4 18.4-8.2 18.4-18.4-8.3-18.4-18.4-18.4zm0 31.4c-7.2 0-13-5.8-13-13s5.8-13 13-13 13 5.8 13 13-5.9 13-13 13zm0-23.3v9.7c0 .3.3.5.6.3l8.6-4.4c.2-.1.3-.3.2-.5-1.8-3.1-5.1-5.3-8.9-5.4-.3-.1-.5.1-.5.3zm-12.1-7.1l-1.1-1.1c-1.1-1.1-2.9-1.1-4 0l-1.3 1.3c-1.1 1.1-1.1 2.9 0 4l1.1 1.1c.2.2.4.1.6 0a26.219 26.219 0 0 1 4.7-4.7c.2-.2.2-.4 0-.6zM44.3 18v-2.2c0-1.6-1.3-2.8-2.8-2.8h-6.6c-1.6 0-2.8 1.3-2.8 2.8V18c0 .3.2.4.5.4 1.8-.5 3.8-.8 5.7-.8 1.9 0 3.7.3 5.5.8.2 0 .5-.2.5-.4z"/><path fill="#182359" d="M167.8 53.3c0 5.3-1.3 9.1-4.1 11.6-2.7 2.5-6.8 3.7-12.4 3.7-2 0-6.3-.4-9.6-1.1l1.2-6.1c2.8.6 6.6.8 8.5.8 3.1 0 5.3-.6 6.6-1.9 1.3-1.3 2-3.1 2-5.6v-1.3c-.8.4-1.8.8-3 1.1-1.2.4-2.7.6-4.3.6-2.1 0-4.1-.3-5.8-1-1.8-.7-3.3-1.7-4.5-3-1.2-1.3-2.2-2.9-2.9-4.9-.7-2-1-5.5-1-8 0-2.4.4-5.4 1.1-7.4.8-2 1.8-3.8 3.3-5.2 1.4-1.4 3.2-2.5 5.2-3.4 2-.8 4.4-1.3 7-1.3 2.5 0 4.8.3 7.1.7 2.3.4 4.2.8 5.7 1.2l-.1 30.5zM146.3 38c0 3.2.7 6.8 2.1 8.3s3.3 2.3 5.5 2.3c1.2 0 2.4-.2 3.5-.5s2-.7 2.6-1.2V27.7c-.6-.1-2.9-.6-5.1-.7-2.8-.1-4.9 1.1-6.4 2.9-1.4 1.9-2.2 5.1-2.2 8.1zm58.2 0c0 2.6-.4 4.6-1.1 6.7s-1.9 4-3.3 5.5-3.1 2.7-5.1 3.5c-2 .8-5 1.3-6.5 1.3s-4.5-.5-6.5-1.3-3.6-2-5-3.5-2.5-3.4-3.3-5.5-1.2-4.1-1.2-6.7.4-5.1 1.1-7.3 1.9-4 3.3-5.5 3.1-2.7 5.1-3.5c2-.8 4.1-1.2 6.4-1.2s4.5.4 6.5 1.2c2 .8 3.7 2 5.1 3.5 1.4 1.5 2.5 3.3 3.3 5.5.7 2.2 1.2 4.7 1.2 7.3zm-7.9 0c0-3.3-.7-6.1-2.2-8.1-1.4-2-3.4-2.9-6-2.9-2.5 0-4.5 1-6 2.9-1.4 2-2.1 4.7-2.1 8.1 0 3.4.7 5.7 2.1 7.6 1.4 2 3.4 2.9 6 2.9 2.5 0 4.5-1 6-2.9 1.4-1.9 2.2-4.2 2.2-7.6zm25.1 17.1C209 55.2 209 44.9 209 43.2V6.7l7.7-1.2v36.3c0 .9 0 6.8 5 6.8v6.5zm13.6 0h-7.8V21.7l7.8-1.2v34.6zm-3.9-38.2c2.6 0 4.7-2.1 4.7-4.7s-2.1-4.7-4.7-4.7-4.7 2.1-4.7 4.7 2.1 4.7 4.7 4.7zm23.2 3.6c2.5 0 4.7.3 6.4.9 1.7.6 3.1 1.5 4.2 2.6 1 1.1 1.8 2.7 2.2 4.3.5 1.6.7 3.4.7 5.4v19.9c-1.2.3-3 .6-5.4.9-2.4.4-5.1.5-8.1.5-2 0-3.8-.2-5.5-.6-1.7-.4-3.1-1-4.2-1.8-1.2-.8-2.1-1.9-2.7-3.3-.7-1.3-1-3.2-1-5.2 0-1.9.4-3.1 1.1-4.4.8-1.3 1.8-2.4 3-3.2 1.3-.8 2.7-1.4 4.4-1.8 1.7-.4 3.4-.5 5.3-.5.8 0 1.7.1 2.7.2.9.1 1.9.3 3 .5v-1.3c0-.9-.1-1.7-.3-2.5-.2-.8-.6-1.5-1.1-2.1-.5-.6-1.2-1.1-2.1-1.4s-2-.6-3.3-.6c-1.8 0-3.4.2-4.9.5-1.5.3-2.7.6-3.6.9l-.9-6.3c1-.3 2.4-.7 4.3-1s3.7-.6 5.8-.6zm.6 28.1c2.4 0 4.1-.1 5.4-.4v-7.9c-.4-.1-1-.3-1.9-.4s-1.7-.2-2.7-.2c-.8 0-1.7.1-2.6.2-.9.1-1.7.4-2.4.7-.7.3-1.3.8-1.7 1.4-.4.6-.6 1-.6 1.9 0 1.8.6 2.9 1.8 3.6 1.2.7 2.8 1.1 4.7 1.1zM102.7 20.7c2.5 0 4.7.3 6.4.9s3.1 1.5 4.2 2.6c1 1.1 1.8 2.7 2.2 4.3.5 1.6.7 3.4.7 5.4v19.9c-1.2.3-3 .6-5.4.9-2.4.4-5.1.5-8.1.5-2 0-3.8-.2-5.5-.6-1.7-.4-3.1-1-4.2-1.8-1.2-.8-2.1-1.9-2.7-3.3-.7-1.3-1-3.2-1-5.2 0-1.9.4-3.1 1.1-4.4.8-1.3 1.8-2.4 3-3.2 1.3-.8 2.7-1.4 4.4-1.8s3.4-.5 5.3-.5c.8 0 1.7.1 2.7.2.9.1 1.9.3 3 .5v-1.3c0-.9-.1-1.7-.3-2.5-.2-.8-.6-1.5-1.1-2.1-.5-.6-1.2-1.1-2.1-1.4-.9-.3-2-.6-3.3-.6-1.8 0-3.4.2-4.9.5-1.5.3-2.7.6-3.6.9l-.9-6.3c1-.3 2.4-.7 4.3-1 1.6-.4 3.6-.6 5.8-.6zm.6 28.1c2.4 0 4.1-.1 5.4-.4v-7.9c-.4-.1-1-.3-1.9-.4-.8-.1-1.7-.2-2.7-.2-.8 0-1.7.1-2.6.2-.9.1-1.7.4-2.4.7s-1.3.8-1.7 1.4c-.4.6-.6 1-.6 1.9 0 1.8.6 2.9 1.8 3.6s2.8 1.1 4.7 1.1zm31.3 6.3C122 55.2 122 44.9 122 43.2V6.7l7.7-1.2v36.3c0 .9 0 6.8 5 6.8l-.1 6.5z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M170.5 237.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -167.875 -221.476)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.945v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.602)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .273-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24m5.254 2.843h2.51v1.091h-2.51V7.577m3.712-2.844h1.718l2.17 3.841v-3.84h1.458v5.6h-1.718l-2.17-3.842v3.841h-1.458v-5.6m11.588 5.293a4.092 4.092 0 0 1-.883.311 4.3 4.3 0 0 1-.96.105c-.993 0-1.78-.26-2.36-.78-.582-.523-.872-1.23-.872-2.123 0-.895.29-1.603.871-2.123.58-.523 1.368-.784 2.362-.784a4.137 4.137 0 0 1 1.842.416v1.16a3.446 3.446 0 0 0-.843-.402 2.966 2.966 0 0 0-.876-.127c-.548 0-.98.165-1.294.495-.314.33-.472.785-.472 1.365 0 .578.158 1.032.472 1.362.314.33.746.495 1.294.495.307 0 .599-.043.876-.128s.558-.219.843-.401v1.159m1.162-2.45h2.51v1.092h-2.51V7.577m3.712-2.844h1.719l2.17 3.841v-3.84h1.458v5.6h-1.718l-2.17-3.842v3.841h-1.459v-5.6m8.396 1.092v3.417h.551c.629 0 1.108-.146 1.438-.439.333-.293.5-.718.5-1.275 0-.555-.165-.978-.496-1.268-.33-.29-.81-.435-1.442-.435h-.551m-1.539-1.092h1.622c.906 0 1.58.062 2.022.184.445.12.826.325 1.143.615a2.4 2.4 0 0 1 .623.874c.136.33.204.704.204 1.122 0 .422-.068.8-.204 1.133a2.4 2.4 0 0 1-.623.873c-.32.29-.703.497-1.15.62-.448.12-1.12.18-2.015.18h-1.622v-5.6" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M170.5 237.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -167.875 -221.476)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.945v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.603)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .272-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24m5.254 2.842h2.51v1.092h-2.51V7.576m3.712-2.843h1.718l2.17 3.841v-3.84h1.458v5.6h-1.718l-2.17-3.842v3.841h-1.458v-5.6m11.588 5.293a4.093 4.093 0 0 1-.883.311 4.3 4.3 0 0 1-.96.105c-.993 0-1.78-.26-2.36-.78-.582-.523-.872-1.23-.872-2.123 0-.895.29-1.603.871-2.123.58-.523 1.368-.784 2.362-.784a4.137 4.137 0 0 1 1.842.416v1.16a3.445 3.445 0 0 0-.843-.402 2.967 2.967 0 0 0-.876-.127c-.548 0-.98.165-1.294.495-.314.33-.472.785-.472 1.365 0 .578.158 1.031.472 1.362.314.33.746.495 1.294.495.307 0 .599-.043.876-.128s.558-.219.843-.401v1.159m1.162-2.45h2.51v1.092h-2.51V7.576M61.02 4.91v1.185a5.724 5.724 0 0 0-.959-.311 4.036 4.036 0 0 0-.883-.105c-.368 0-.64.047-.815.142a.47.47 0 0 0-.264.443c0 .15.059.267.176.352.12.083.336.154.647.214l.656.124c.663.125 1.134.315 1.414.57.28.255.42.618.42 1.088 0 .617-.196 1.077-.588 1.38-.389.3-.984.45-1.786.45-.378 0-.758-.034-1.139-.101a7.41 7.41 0 0 1-1.142-.3V8.82c.38.19.748.335 1.102.432.357.095.701.143 1.031.143.336 0 .593-.053.772-.158a.496.496 0 0 0 .267-.45.483.483 0 0 0-.184-.405c-.12-.095-.36-.18-.723-.255l-.595-.124c-.597-.12-1.034-.311-1.31-.574-.275-.262-.412-.616-.412-1.061 0-.558.191-.987.575-1.287.384-.3.935-.45 1.654-.45.328 0 .665.024 1.011.071a9.48 9.48 0 0 1 1.075.207m5.366 4.403h-2.405l-.38 1.02h-1.546l2.21-5.6h1.834l2.21 5.6h-1.547l-.376-1.02m-2.021-1.039h1.634l-.815-2.228-.82 2.228" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M170.5 237.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -167.875 -221.476)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.945v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.603)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .272-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24m5.254 2.842h2.51v1.092h-2.51V7.576m3.712-2.843h1.718l2.17 3.841v-3.84h1.458v5.6h-1.718l-2.17-3.842v3.841h-1.458v-5.6m11.588 5.293a4.092 4.092 0 0 1-.883.311 4.29 4.29 0 0 1-.96.105c-.993 0-1.78-.26-2.36-.78-.582-.523-.872-1.23-.872-2.123 0-.895.29-1.603.871-2.123.58-.523 1.368-.784 2.362-.784a4.137 4.137 0 0 1 1.842.416v1.16a3.445 3.445 0 0 0-.843-.402 2.967 2.967 0 0 0-.876-.127c-.548 0-.98.165-1.294.495-.314.33-.472.785-.472 1.365 0 .578.158 1.031.472 1.362.314.33.746.495 1.294.495.307 0 .599-.043.876-.128s.558-.219.843-.401v1.159" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M328.5 412.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -323.9 -384.812)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.933v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.602)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .272-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24m5.254 2.842h2.51v1.092h-2.51V7.576m3.712-2.843h1.718l2.17 3.841v-3.84h1.458v5.6h-1.718l-2.17-3.842v3.841h-1.458v-5.6m8.395 1.092v3.417h.551c.63 0 1.109-.146 1.439-.439.333-.293.5-.718.5-1.275 0-.555-.166-.978-.496-1.268-.33-.29-.811-.435-1.443-.435h-.55m-1.54-1.092h1.623c.906 0 1.58.062 2.022.184.445.12.826.325 1.143.615a2.4 2.4 0 0 1 .623.874c.136.33.204.704.204 1.122 0 .422-.068.8-.204 1.133a2.4 2.4 0 0 1-.623.873c-.32.29-.704.497-1.151.62-.448.12-1.119.18-2.014.18h-1.622v-5.6" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M170.5 237.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -167.875 -221.476)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.945v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.602)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .272-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24m5.254 2.842h2.51v1.092h-2.51V7.576m7.864-2.666v1.185a5.723 5.723 0 0 0-.96-.311 4.036 4.036 0 0 0-.882-.105c-.368 0-.64.047-.816.142a.47.47 0 0 0-.263.443c0 .15.058.267.175.352.12.083.336.154.648.214l.655.124c.663.125 1.135.315 1.415.57.28.255.42.618.42 1.088 0 .617-.197 1.078-.588 1.38-.39.3-.985.45-1.786.45a6.58 6.58 0 0 1-1.14-.101 7.41 7.41 0 0 1-1.142-.3V8.82a6.1 6.1 0 0 0 1.103.432c.357.095.7.143 1.03.143.336 0 .594-.053.772-.158a.496.496 0 0 0 .268-.45.483.483 0 0 0-.184-.405c-.12-.095-.361-.18-.723-.255l-.596-.124c-.596-.12-1.033-.311-1.31-.574-.275-.262-.412-.616-.412-1.061 0-.558.192-.987.576-1.287.383-.3.935-.45 1.654-.45.327 0 .664.024 1.01.071.347.045.705.114 1.076.207m5.366 4.403h-2.406l-.38 1.02h-1.546l2.21-5.6h1.834l2.21 5.6h-1.547l-.375-1.02m-2.022-1.039h1.634l-.815-2.228-.819 2.228" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="15" version="1.0"><defs><clipPath id="a"><path stroke-width=".922" d="M171.998 239.12h20.614v12.484h-20.614z"/></clipPath></defs><path fill="#fff" stroke="#000" stroke-width="1.042" d="M170.5 237.862h80v15h-80z" transform="matrix(.9875 0 0 .93335 -167.875 -221.476)"/><path d="M1.975 1.933h76.038v11.2H1.975z"/><path fill="#abb1aa" d="M1.975 1.945v11.2h20.08c1.293-1.633 2.165-3.532 2.165-5.6 0-2.054-.857-3.973-2.134-5.6H1.975z"/><g clip-path="url(#a)" transform="matrix(.94924 0 0 .89719 -161.127 -212.603)"><path fill="#fff" d="M190.064 245.362a7.047 7.047 0 0 1-14.094.009v-.009a7.047 7.047 0 1 1 14.094-.008v.008z"/><path d="M188.746 239.622c1.562 1.563 2.344 3.477 2.344 5.74 0 2.264-.768 4.157-2.304 5.68-1.63 1.603-3.556 2.405-5.779 2.405-2.196 0-4.089-.795-5.678-2.385-1.59-1.59-2.385-3.49-2.385-5.7s.795-4.123 2.385-5.74c1.549-1.563 3.442-2.344 5.678-2.344 2.264 0 4.176.781 5.739 2.344zm-10.365 1.052c-1.321 1.334-1.982 2.897-1.982 4.69 0 1.793.654 3.343 1.962 4.65 1.307 1.308 2.864 1.961 4.67 1.961s3.376-.66 4.71-1.98c1.268-1.228 1.901-2.77 1.901-4.63 0-1.847-.644-3.414-1.931-4.701-1.287-1.288-2.847-1.931-4.68-1.931-1.833 0-3.383.647-4.65 1.94zm3.477 3.902c-.202-.44-.504-.66-.907-.66-.713 0-1.07.479-1.07 1.438 0 .96.357 1.439 1.07 1.439.47 0 .806-.234 1.008-.702l.987.526c-.47.836-1.177 1.255-2.118 1.255-.727 0-1.308-.223-1.745-.668-.438-.445-.656-1.06-.656-1.842 0-.769.225-1.38.676-1.831.45-.453 1.012-.679 1.684-.679.996 0 1.709.393 2.14 1.176l-1.07.548zm4.646 0c-.202-.44-.498-.66-.889-.66-.727 0-1.09.479-1.09 1.438 0 .96.363 1.439 1.09 1.439.471 0 .801-.234.99-.702l1.01.526c-.47.836-1.176 1.255-2.116 1.255-.725 0-1.306-.223-1.742-.668-.436-.445-.654-1.06-.654-1.842 0-.769.221-1.38.664-1.831.443-.453 1.007-.679 1.692-.679.994 0 1.706.393 2.135 1.176l-1.09.548z"/></g><path fill="#fff" d="M29.052 6.901c.242 0 .426-.05.551-.15.126-.1.188-.247.188-.442 0-.193-.062-.34-.188-.44-.125-.102-.309-.153-.551-.153h-.851v1.185h.851m.052 2.45c.309 0 .54-.062.695-.184.157-.123.236-.308.236-.555 0-.243-.077-.424-.232-.544-.154-.123-.387-.184-.7-.184h-.902v1.467h.903m1.43-2.015c.33.09.586.257.768.5.18.242.271.54.271.892 0 .54-.194.943-.583 1.208-.389.265-.98.397-1.774.397h-2.553v-5.6h2.31c.828 0 1.427.118 1.797.353.373.235.56.611.56 1.129 0 .272-.068.505-.204.698-.136.19-.333.33-.592.423m.906-2.603h1.682L34.48 6.73l1.359-1.996h1.686l-2.274 3.241v2.36h-1.538v-2.36l-2.273-3.24" font-family="Bitstream Vera Sans" font-size="8.259" font-weight="700"/></svg>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Author: liuyib <https://github.com/liuyib> -->
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="512px" width="512px" x="0px" y="0px">
<style type="text/css">.st1{fill:#FFFFFF;}</style>
<path fill="#73C8FF" d="M354.8,85.9C301.6,55.1,257.2,30,256,30s-45.6,25.1-98.8,55.9l-96.6,55.9v228.4l96.7,56.1 c55.2,31.9,97.6,56,98.8,55.9c1.1-0.1,45.6-25.3,98.7-56.1l96.6-55.9V141.7L354.8,85.9z"/>
<polygon class="st1" points="256,145.1 188,180.1 228.6,201 256,186.9 329.8,224.9 350,215.5 350,193.5 "/>
<polygon class="st1" points="343.5,322 350,318.6 350,283.5 168.5,190 162,193.4 162,228.5 "/>
<polygon class="st1" points="283.4,311.1 256,325.2 182.2,287.2 162,296.6 162,318.6 256,367 324,332 "/>
</svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" x="0" y="0" viewBox="0 0 100 100"><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2"><animate attributeName="opacity" begin="-0.9230769230769231s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(27.692 50 50)"><animate attributeName="opacity" begin="-0.8461538461538461s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(55.385 50 50)"><animate attributeName="opacity" begin="-0.7692307692307693s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(83.077 50 50)"><animate attributeName="opacity" begin="-0.6923076923076923s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(110.77 50 50)"><animate attributeName="opacity" begin="-0.6153846153846154s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(138.462 50 50)"><animate attributeName="opacity" begin="-0.5384615384615384s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(166.154 50 50)"><animate attributeName="opacity" begin="-0.46153846153846156s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(193.846 50 50)"><animate attributeName="opacity" begin="-0.38461538461538464s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(221.538 50 50)"><animate attributeName="opacity" begin="-0.3076923076923077s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(249.23 50 50)"><animate attributeName="opacity" begin="-0.23076923076923078s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(276.923 50 50)"><animate attributeName="opacity" begin="-0.15384615384615385s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(304.615 50 50)"><animate attributeName="opacity" begin="-0.07692307692307693s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect><rect width="7" height="16" x="46.5" y="9" fill="#888" rx="37.2" ry="7.2" transform="rotate(332.308 50 50)"><animate attributeName="opacity" begin="0s" dur="1s" keyTimes="0;1" repeatCount="indefinite" values="1;0"/></rect></svg>
\ No newline at end of file
$(document).ready(function () {
var $menuBtn = $('.header-nav-menubtn')
var $menu = $('.header-nav-menu')
var $menuItem = $('.header-nav-menu-item')
var $submenu = $('.header-nav-submenu')
var isMobile = $menuBtn.is(':visible')
var isMenuShow = false
var isSubmenuShow = false
function resetMenuHeight () {
$menuItem.velocity(
{
height: $menuItem.outerHeight()
},
{
complete: function () {
$submenu.css({ display: 'none', opacity: 0 })
}
}
)
}
$(window).on(
'resize',
Stun.utils.throttle(function () {
isMobile = $menuBtn.is(':visible')
if (isMobile) {
$submenu.removeClass('hide--force')
if (isSubmenuShow) {
resetMenuHeight()
isSubmenuShow = false
}
} else {
$submenu.css({ display: 'none', opacity: 0 })
}
}, 200)
)
var isNightModeFocus = true
var $nightMode = $('.mode')
$(document).on('click', function () {
if ($menu.is(':visible')) {
if (isMobile && isSubmenuShow) {
resetMenuHeight()
isSubmenuShow = false
}
$menu.css({ display: 'none' })
isMenuShow = false
}
if (isNightModeFocus) {
$nightMode.removeClass('mode--focus')
isNightModeFocus = false
}
})
Stun.utils.pjaxReloadHeader = function () {
$menuBtn = $('.header-nav-menubtn')
$menu = $('.header-nav-menu')
$menuItem = $('.header-nav-menu-item')
$submenu = $('.header-nav-submenu')
isMobile = $menuBtn.is(':visible')
isMenuShow = false
isSubmenuShow = false
function getNightMode () {
var nightMode = false
try {
if (parseInt(Stun.utils.Cookies().get(NIGHT_MODE_COOKIES_KEY))) {
nightMode = true
}
} catch (err) {
/* empty */
}
return nightMode
}
if (CONFIG.nightMode && CONFIG.nightMode.enable) {
var isNightMode = false
var NIGHT_MODE_COOKIES_KEY = 'night_mode'
$nightMode = $('.mode')
isNightModeFocus = true
if (getNightMode()) {
$nightMode.addClass('mode--checked')
$nightMode.addClass('mode--focus')
$('html').addClass('nightmode')
isNightMode = true
} else {
isNightMode = false
}
$('.mode').on('click', function (e) {
e.stopPropagation()
isNightMode = !isNightMode
isNightModeFocus = true
Stun.utils.Cookies().set(NIGHT_MODE_COOKIES_KEY, isNightMode ? 1 : 0)
$nightMode.toggleClass('mode--checked')
$nightMode.addClass('mode--focus')
$('html').toggleClass('nightmode')
})
}
$menuBtn.on('click', function (e) {
e.stopPropagation()
if (isMobile && isMenuShow && isSubmenuShow) {
resetMenuHeight()
isSubmenuShow = false
}
if (!isMenuShow) {
isMenuShow = true
} else {
isMenuShow = false
}
$menu.velocity('stop').velocity(
{
opacity: isMenuShow ? 1 : 0
},
{
duration: isMenuShow ? 200 : 0,
display: isMenuShow ? 'block' : 'none'
}
)
})
// Whether to allow events to bubble in the menu.
var isBubbleInMenu = false
$('.header-nav-submenu-item').on('click', function () {
isBubbleInMenu = true
})
$menuItem.on('click', function (e) {
if (!isMobile) {
return
}
var $submenu = $(this).find('.header-nav-submenu')
if (!$submenu.length) {
return
}
if (!isBubbleInMenu) {
e.stopPropagation()
} else {
isBubbleInMenu = false
}
var menuItemHeight = $menuItem.outerHeight()
var submenuHeight =
menuItemHeight + Math.floor($submenu.outerHeight()) * $submenu.length
var menuShowHeight = 0
if ($(this).outerHeight() > menuItemHeight) {
isSubmenuShow = false
menuShowHeight = menuItemHeight
} else {
isSubmenuShow = true
menuShowHeight = submenuHeight
}
$submenu.css({ display: 'block', opacity: 1 })
// Accordion effect.
$(this)
.velocity('stop')
.velocity({ height: menuShowHeight }, { duration: 300 })
.siblings()
.velocity({ height: menuItemHeight }, { duration: 300 })
})
$menuItem.on('mouseenter', function () {
var $submenu = $(this).find('.header-nav-submenu')
if (!$submenu.length) {
return
}
if (!$submenu.is(':visible')) {
if (isMobile) {
$submenu.css({ display: 'block', opacity: 1 })
} else {
$submenu.removeClass('hide--force')
$submenu
.velocity('stop')
.velocity('transition.slideUpIn', { duration: 200 })
}
}
})
$menuItem.on('mouseleave', function () {
var $submenu = $(this).find('.header-nav-submenu')
if (!$submenu.length) {
return
}
if (!isMobile) {
$submenu.addClass('hide--force')
isSubmenuShow = false
}
})
}
Stun.utils.pjaxReloadScrollIcon = function () {
if (CONFIG.header && CONFIG.header.scrollDownIcon) {
$('.header-banner-arrow').on('click', function (e) {
e.stopPropagation()
$('#container').velocity('scroll', {
offset: $('#header').outerHeight()
})
})
}
}
// Initializaiton
Stun.utils.pjaxReloadHeader()
Stun.utils.pjaxReloadScrollIcon()
})
$(document).ready(function () {
var isHeaderEnable = CONFIG.header && CONFIG.header.enable
var isShowHeaderOnPost = isHeaderEnable && CONFIG.header.showOnPost
// The previous distance from the page to the top.
var prevScrollTop = 0
var isNavFix = false
var isAnimation = true
function headerNavScroll () {
var isPostPage = !!$('#is-post').length
var isNoHeader = !isHeaderEnable || (isPostPage && !isShowHeaderOnPost)
var $headerNav = $('.header-nav')
var scrollTop = Math.floor($(window).scrollTop())
var delta = Math.floor(scrollTop - prevScrollTop)
if (scrollTop === 0) {
if (isNoHeader) {
setTimeout(function () {
$headerNav.addClass('slider--clear')
isAnimation = false
}, 200)
}
$headerNav.removeClass('header-nav--sticky')
$headerNav.removeClass('slider--up')
$headerNav.addClass('slider--down')
} else {
if (isNoHeader && scrollTop < $headerNav.height()) {
return false
}
var MIN_SCROLL_TO_CHANGE_NAV = 5
// Make the state of nav bar not change due to tiny scrolling.
if (Math.abs(delta) > MIN_SCROLL_TO_CHANGE_NAV) {
if (isNoHeader) {
if (!isAnimation) {
isAnimation = true
} else {
$headerNav.removeClass('slider--clear')
}
}
if (!isNavFix) {
isNavFix = true
} else {
$headerNav.addClass('header-nav--sticky')
}
if (delta > 0) {
$headerNav.removeClass('slider--down')
$headerNav.addClass('slider--up')
} else {
$headerNav.removeClass('slider--up')
$headerNav.addClass('slider--down')
}
} else {
$headerNav.addClass('header-nav--sticky')
}
}
prevScrollTop = scrollTop
}
var isBack2topEnable = CONFIG.back2top && CONFIG.back2top.enable
var isBack2topShow = false
// Back the page to top.
function back2top () {
var $back2top = $('#back2top')
var scrollTop = $(window).scrollTop()
if (scrollTop !== 0) {
if (!isBack2topShow) {
$back2top.addClass('back2top--show')
$back2top.removeClass('back2top--hide')
isBack2topShow = true
}
} else {
$back2top.addClass('back2top--hide')
$back2top.removeClass('back2top--show')
isBack2topShow = false
}
}
if (isBack2topEnable) {
// Initializaiton
back2top()
$('#back2top').on('click', function () {
$('body')
.velocity('stop')
.velocity('scroll')
})
}
// Initializaiton
headerNavScroll()
$(window).on(
'scroll',
Stun.utils.throttle(function () {
headerNavScroll()
if (isBack2topEnable) {
back2top()
}
}, 100)
)
})
$(document).ready(function () {
var tocDepth = (CONFIG.sidebar && CONFIG.sidebar.tocMaxDepth) || 4
// Optimize selector by theme config.
var HEADING_SELECTOR = 'h1,h2,h3,h4,h5,h6,'
.slice(0, tocDepth * 3)
.slice(0, -1)
function initTocDisplay () {
if ($('.post-body, .custompage').find(HEADING_SELECTOR)[0]) {
return
}
$('.sidebar-nav').addClass('hide')
$('.sidebar-toc').addClass('hide')
$('.sidebar-ov').removeClass('hide')
}
// The heading that reached the top currently.
var currHeading = null
// The heading that reached the top last time.
var lastHeading = null
var isRemovedTocClass = false
// Automatically expand items in the article directory
// based on the scrolling of heading in the article.
function autoSpreadToc () {
var $postBody = $('.post-body, .custompage')
var $allTocItem = $('.sidebar-toc li')
var $headings = $postBody.find(HEADING_SELECTOR)
var $firsetChild = $headings.first()
$headings.each(function () {
var headingTop = this.getBoundingClientRect().top
// The minimum distance from the top of the browser
// when heading is marked as active in toc.
var MIN_HEIGHT_TO_TOP = 5
if (headingTop <= MIN_HEIGHT_TO_TOP) {
currHeading = window.encodeURIComponent(this.getAttribute('id'))
}
})
// All heading are not to the top.
if (
$postBody[0] &&
$firsetChild[0] &&
$firsetChild[0].getBoundingClientRect().top > 0 &&
$firsetChild.offset().top - $(window).scrollTop() > 0
) {
if (!isRemovedTocClass) {
$allTocItem.removeClass('active current')
isRemovedTocClass = true
}
return
}
if (currHeading !== lastHeading) {
var $targetLink = $('.sidebar-toc a[href="#' + currHeading + '"]')
// In order to be compatible with Hexo under v5.0.0
if (!$targetLink.length) {
var anchorDecode = window.decodeURIComponent(currHeading)
$targetLink = $('.sidebar-toc a[href="#' + anchorDecode + '"]')
}
$allTocItem.removeClass('active current')
$targetLink.parents('li').addClass('active')
$targetLink.parent().addClass('current')
lastHeading = currHeading
isRemovedTocClass = false
}
}
// Whether toc needs scrolling.
var isTocScroll = false
// Scroll the post toc to the middle.
function scrollTocToMiddle () {
var $tocWrapHeight = $('.sidebar-toc').height()
var $tocHeight = $('.sidebar-toc > div').height()
if ($tocHeight <= $tocWrapHeight) {
return
}
var $tocWrap = $('.sidebar-toc')
var $currTocItem = $('.sidebar-toc .current a')
if ($currTocItem[0] && $tocWrap[0]) {
var tocTop = $currTocItem.offset().top - $tocWrap.offset().top
isTocScroll = tocTop > $tocWrapHeight || tocTop < 0
}
if (isTocScroll) {
$currTocItem.velocity('stop').velocity('scroll', {
container: $tocWrap,
offset: -$tocWrapHeight / 2,
duration: 500,
easing: 'easeOutQuart'
})
}
}
// Distance from sidebar to top.
var sidebarToTop = 0
if (CONFIG.sidebar && CONFIG.sidebar.offsetTop) {
sidebarToTop = parseInt(CONFIG.sidebar.offsetTop)
}
// Sticky the sidebar when it arrived the top.
function sidebarSticky () {
var $sidebar = $('#sidebar')
var targetY = document
.getElementById('content-wrap')
.getBoundingClientRect().top
if (targetY < sidebarToTop) {
$sidebar.addClass('sidebar--sticky')
} else {
$sidebar.removeClass('sidebar--sticky')
}
}
// Update the reading progress lines of post.
function readProgress () {
// Not on post page.
if ($('#is-post').length === 0) {
return
}
var $post = $('.content')
var postTop = $post.offset().top
var postEndTop = 0
var postEndHeight = 0
var postReadingHeight = 0
var isEnablePostEnd = false
var percent = 0
if (CONFIG.postWidget && CONFIG.postWidget.endText) {
isEnablePostEnd = true
}
if (isEnablePostEnd) {
postEndTop = $('.post-ending').offset().top
postEndHeight = $('.post-ending').outerHeight()
postReadingHeight = postEndTop - postTop + postEndHeight
} else {
postEndTop = $('.post-footer').offset().top
postReadingHeight = postEndTop - postTop
}
var windowHeight = $(window).height()
var postScrollTop = 0
if ($post.length !== 0) {
postScrollTop =
parseInt($post[0].getBoundingClientRect().top * -1) + windowHeight
}
var percentNum = Number($('.sidebar-reading-info__num').text())
postReadingHeight = parseInt(Math.abs(postReadingHeight))
percent = parseInt((postScrollTop / postReadingHeight) * 100)
percent = percent > 100 ? 100 : percent < 0 ? 0 : percent
// Has reached the maximum or minimum
if (
(percent === 0 && percentNum === 0) ||
(percent === 100 && percentNum === 100)
) {
return
}
$('.sidebar-reading-info__num').text(percent)
$('.sidebar-reading-line').css(
'transform',
'translateX(' + (percent - 100) + '%)'
)
}
// Initial run
autoSpreadToc()
sidebarSticky()
scrollTocToMiddle()
readProgress()
$(window).on('scroll', function () {
sidebarSticky()
})
$(window).on(
'scroll',
Stun.utils.throttle(function () {
autoSpreadToc()
scrollTocToMiddle()
readProgress()
}, 150)
)
Stun.utils.pjaxReloadSidebar = function () {
var $navToc = $('.sidebar-nav-toc')
var $navOv = $('.sidebar-nav-ov')
var $tocWrap = $('.sidebar-toc')
var $overview = $('.sidebar-ov')
$navToc.on('click', function (e) {
e.stopPropagation()
if ($(this).hasClass('current')) {
return
}
$navToc.addClass('current')
$navOv.removeClass('current')
$tocWrap.css('display', 'block')
$tocWrap.velocity('stop').velocity('fadeIn')
$overview.css('display', 'none')
$overview.velocity('stop').velocity('fadeOut')
})
$navOv.on('click', function (e) {
e.stopPropagation()
if ($(this).hasClass('current')) {
return
}
$navOv.addClass('current')
$navToc.removeClass('current')
$tocWrap.css('display', 'none')
$tocWrap.velocity('stop').velocity('fadeOut')
$overview.css('display', 'block')
$overview.velocity('stop').velocity('fadeIn')
})
initTocDisplay()
}
// Initialization
Stun.utils.pjaxReloadSidebar()
})
$(document).ready(function () {
Stun.utils.showThemeInConsole()
if (CONFIG.shortcuts && CONFIG.shortcuts.switchPost) {
Stun.utils.registerSwitchPost()
}
// Not reload this, because it's changeless.
if (CONFIG.externalLink) {
Stun.utils.addIconToExternalLink('#footer')
}
Stun.utils.pjaxReloadBoot = function () {
if (CONFIG.codeblock) {
var codeStyle = CONFIG.codeblock.style
if (codeStyle === 'default') {
this.addCodeHeader()
this.addCopyButton()
} else if (codeStyle === 'carbon') {
this.addCodeHeader('carbon')
this.addCopyButton('carbon')
} else if (codeStyle === 'simple') {
this.addCopyButton('simple')
}
this.registerCopyEvent()
}
if (CONFIG.reward) {
this.registerShowReward()
}
if (CONFIG.lazyload) {
this.lazyLoadImage()
}
if (CONFIG.galleryWaterfall) {
this.showImageToWaterfall()
}
if (CONFIG.externalLink) {
var CONTAINER = '.archive, .post-title'
this.addIconToExternalLink(CONTAINER)
}
if (CONFIG.fancybox) {
this.wrapImageWithFancyBox()
} else if (CONFIG.zoomImage) {
this.registerZoomImage()
}
}
// Initializaiton
Stun.utils.pjaxReloadBoot()
})
Stun.utils = Stun.$u = {
/**
* Debounce
* @param {Object} func Callback function
* @param {Number} wait Waiting time
* @param {Boolean} immediate Run immediately
*/
debounce: function (func, wait, immediate) {
var timeout
return function () {
var context = this
var args = arguments
if (timeout) clearTimeout(timeout)
if (immediate) {
var callNow = !timeout
timeout = setTimeout(function () {
timeout = null
}, wait)
if (callNow) func.apply(context, args)
} else {
timeout = setTimeout(function () {
func.apply(context, args)
}, wait)
}
}
},
/**
* Throttle
* @param {Object} func Callback function
* @param {Number} wait Waiting time
* @param {Object} options leading: Boolean, trailing: Boolean
*/
throttle: function (func, wait, options) {
var timeout, context, args
var previous = 0
if (!options) options = {}
var later = function () {
previous = options.leading === false ? 0 : new Date().getTime()
timeout = null
func.apply(context, args)
if (!timeout) context = args = null
}
var throttled = function () {
var now = new Date().getTime()
if (!previous && options.leading === false) previous = now
var remaining = wait - (now - previous)
context = this
args = arguments
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout)
timeout = null
}
previous = now
func.apply(context, args)
if (!timeout) context = args = null
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining)
}
}
return throttled
},
hasMobileUA: function () {
var nav = window.navigator
var ua = nav.userAgent
var pa = /iPad|iPhone|Android|Opera Mini|BlackBerry|webOS|UCWEB|Blazer|PSP|IEMobile|Symbian/g
return pa.test(ua)
},
isTablet: function () {
return (
window.screen.width > 767 &&
window.screen.width < 992 &&
this.hasMobileUA()
)
},
isMobile: function () {
return window.screen.width < 767 && this.hasMobileUA()
},
isDesktop: function () {
return !this.isTablet() && !this.isMobile()
},
Cookies: function () {
function extend () {
var i = 0
var result = {}
for (; i < arguments.length; i++) {
var attributes = arguments[i]
for (var key in attributes) {
result[key] = attributes[key]
}
}
return result
}
function init (converter) {
function api (key, value, attributes) {
var result
if (typeof document === 'undefined') {
return
}
// Write
if (arguments.length > 1) {
attributes = extend({ path: '/' }, api.defaults, attributes)
if (typeof attributes.expires === 'number') {
var expires = new Date()
expires.setMilliseconds(
expires.getMilliseconds() + attributes.expires * 864e5
)
attributes.expires = expires
}
// We're using "expires" because "max-age" is not supported by IE
attributes.expires = attributes.expires
? attributes.expires.toUTCString()
: ''
try {
result = JSON.stringify(value)
if (/^[{[]/.test(result)) {
value = result
}
} catch (e) {
/* empty */
}
if (!converter.write) {
value = encodeURIComponent(String(value)).replace(
/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,
decodeURIComponent
)
} else {
value = converter.write(value, key)
}
key = encodeURIComponent(String(key))
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
key = key.replace(/[()]/g, escape)
var stringifiedAttributes = ''
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
continue
}
stringifiedAttributes += '; ' + attributeName
if (attributes[attributeName] === true) {
continue
}
stringifiedAttributes += '=' + attributes[attributeName]
}
return (document.cookie = key + '=' + value + stringifiedAttributes)
}
// Read
if (!key) {
result = {}
}
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling "get()"
var cookies = document.cookie ? document.cookie.split('; ') : []
var rdecode = /(%[0-9A-Z]{2})+/g
var i = 0
for (; i < cookies.length; i++) {
var parts = cookies[i].split('=')
var cookie = parts.slice(1).join('=')
if (cookie.charAt(0) === '"') {
cookie = cookie.slice(1, -1)
}
try {
var name = parts[0].replace(rdecode, decodeURIComponent)
cookie = converter.read
? converter.read(cookie, name)
: converter(cookie, name) ||
cookie.replace(rdecode, decodeURIComponent)
if (this.json) {
try {
cookie = JSON.parse(cookie)
} catch (e) {
/* empty */
}
}
if (key === name) {
result = cookie
break
}
if (!key) {
result[name] = cookie
}
} catch (e) {
/* empty */
}
}
return result
}
api.set = api
api.get = function (key) {
return api.call(api, key)
}
api.getJSON = function () {
return api.apply({ json: true }, [].slice.call(arguments))
}
api.defaults = {}
api.remove = function (key, attributes) {
api(key, '', extend(attributes, { expires: -1 }))
}
api.withConverter = init
return api
}
return init(function () {})
},
showThemeInConsole: function () {
var stunInfo = '主题不错?⭐star 支持一下 ->'
var stunURL = 'https://github.com/liuyib/hexo-theme-stun'
var stunNameStr =
'\n\n ___ ___ ___ ___ \n /\\ \\ /\\ \\ /\\__\\ /\\__\\ \n /::\\ \\ \\:\\ \\ /:/ / /::| | \n /:/\\ \\ \\ \\:\\ \\ /:/ / /:|:| | \n _\\:\\ \\ \\ \\ /::\\ \\ /:/ / ___ /:/|:| |__ \n /\\ \\:\\ \\ \\__\\ /:/\\:\\__\\ /:/__/ /\\__\\ /:/ |:| /\\__\\ \n \\:\\ \\:\\ \\/__/ /:/ \\/__/ \\:\\ \\ /:/ / \\/__|:|/:/ / \n \\:\\ \\:\\__\\ /:/ / \\:\\ /:/ / |:/:/ / \n \\:\\/:/ / \\/__/ \\:\\/:/ / |::/ / \n \\::/ / \\::/ / /:/ / \n \\/__/ \\/__/ \\/__/ \n \n'
var stunInfoStyle =
'background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;'
var stunURLStyle =
'background-color: #ffbca2; padding: 8px; font-size: 14px;'
var stunNameStyle = 'background-color: #eaf8ff;'
console.log(
'%c%s%c%s%c%s',
stunInfoStyle,
stunInfo,
stunURLStyle,
stunURL,
stunNameStyle,
stunNameStr
)
},
/**
* Change the event code to keyCode.
* @param {String} code Event code
*/
codeToKeyCode: function (code) {
var codes = {
ArrowLeft: 37,
ArrowRight: 39,
Escape: 27,
Enter: 13
}
return codes[code]
},
/**
* "Alert" component
* @param {String} status The Status of message. Values: success / info / warning / error.
* @param {String} text The text to show.
* @param {Number} delay Message stay time (unit is 's', default 5s).
*/
popAlert: function (status, text, delay) {
if ($('.stun-message').length !== 0) {
$('.stun-message').remove()
}
var $alert = $(
'<div class="stun-message">' +
`<div class="stun-alert stun-alert-${status}">` +
`<i class="stun-alert-icon ${CONFIG.fontIcon.prompt[status]}"></i>` +
`<span class="stun-alert-description">${text}</span>` +
'</div>' +
'</div>'
)
$('body').append($alert)
$(document).ready(function () {
$('.stun-alert')
.velocity('stop')
.velocity('transition.slideDownBigIn', {
duration: 300
})
.velocity('reverse', {
delay: delay * 1000 || 5000,
duration: 260,
complete: function () {
$('.stun-alert').css('display', 'none')
}
})
})
},
/**
* Copy any text.
* @param {HTMLElement} container Container of text.
*/
copyText: function (container) {
try {
var selection = window.getSelection()
var range = document.createRange()
// Select text by the content of node.
range.selectNodeContents(container)
selection.removeAllRanges()
selection.addRange(range)
var text = selection.toString()
var input = document.createElement('input')
// Create a temporary input to make the
// execCommand command take effect.
input.style.display = 'none'
input.setAttribute('readonly', 'readonly')
input.setAttribute('value', text)
document.body.appendChild(input)
input.setSelectionRange(0, -1)
if (document.execCommand('copy')) {
document.execCommand('copy')
document.body.removeChild(input)
return true
}
document.body.removeChild(input)
} catch (e) {
return false
}
},
// Wrap images with fancybox support.
wrapImageWithFancyBox: function () {
$('.content img')
.not(':hidden')
.each(function () {
var $img = $(this)
var imgTitle = $img.attr('title') || $img.attr('alt')
var $imgWrap = $img.parent('a')
var imgSource = ['data-src', 'data-original', 'src']
var imgSrc = ''
if (!$imgWrap[0]) {
for (var i = 0; i < imgSource.length; i++) {
if ($img.attr(imgSource[i])) {
imgSrc = $img.attr(imgSource[i])
break
}
}
$imgWrap = $img
.wrap(`<a class="fancybox" href="${imgSrc}"></a>`)
.parent('a')
if ($img.is('.gallery img')) {
$imgWrap.attr('data-fancybox', 'gallery')
} else {
$imgWrap.attr('data-fancybox', 'default')
}
}
if (imgTitle) {
$imgWrap.attr('title', imgTitle).attr('data-caption', imgTitle)
}
})
$().fancybox({
selector: '[data-fancybox]',
loop: true,
transitionEffect: 'slide',
hash: false,
buttons: [
'share',
'slideShow',
'fullScreen',
'download',
'thumbs',
'close'
]
})
},
// Display the image in the gallery as a waterfall.
showImageToWaterfall: function () {
var gConfig = CONFIG.galleryWaterfall
var colWidth = parseInt(gConfig.colWidth)
var colGapX = parseInt(gConfig.gapX)
var GALLERY_IMG_SELECTOR = '.gallery img'
this.waitAllImageLoad(GALLERY_IMG_SELECTOR, function () {
$('.gallery').masonry({
itemSelector: GALLERY_IMG_SELECTOR,
columnWidth: colWidth,
percentPosition: true,
gutter: colGapX,
transitionDuration: 0
})
})
},
// Lazy load the images of post.
lazyLoadImage: function () {
$('img.lazyload').lazyload()
},
// Add a mark icon to the link with `target="_blank"` attribute.
addIconToExternalLink: function (container) {
if (!$(container)[0]) {
return
}
var $wrapper = $('<span class="exturl"></span>')
var $icon = $(
'<span class="exturl__icon">' +
`<i class="${CONFIG.externalLink.icon.name}"></i>` +
'</span>'
)
$(container)
.find('a[target="_blank"]')
.addClass('exturl__link')
.wrap($wrapper)
.parent('.exturl')
.append($icon)
},
// Switch to the prev / next post by shortcuts.
registerSwitchPost: function () {
var keyLeft = this.codeToKeyCode('ArrowLeft')
var keyRight = this.codeToKeyCode('ArrowRight')
$(document).on('keydown', function (e) {
var isPrev = e.keyCode === keyLeft
var isNext = e.keyCode === keyRight
if (e.ctrlKey) {
if (isPrev) {
var prevElem = $('.paginator-prev a')[0]
prevElem && prevElem.click()
} else if (isNext) {
var nextElem = $('.paginator-next a')[0]
nextElem && nextElem.click()
}
}
})
},
// Show / Hide the reward QR.
registerShowReward: function () {
$('.reward-button').on('click', function () {
var $container = $('.reward-qrcode')
if ($container.is(':visible')) {
$container.css('display', 'none')
} else {
$container.velocity('stop').velocity('transition.slideDownIn', {
duration: 300
})
}
})
},
// Click to zoom in image, without fancybox.
registerZoomImage: function () {
$('#content-wrap img')
.not(':hidden')
.each(function () {
if ($(this).attr('data-zoom') === 'none') return
$(this).addClass('zoomimg')
})
var $imgMask = $('<div class="zoomimg-mask"></div>')
var $imgClone = null
var isZoom = false
$(window).on('scroll', closeZoom)
$(document).on('click', closeZoom)
$('.zoomimg').on('click', function (e) {
e.stopPropagation()
if (isZoom) {
closeZoom()
return
}
isZoom = true
$imgClone = $(this)
.clone()
.addClass('zoomimg-clone')
var SIDE_GAP = parseInt(CONFIG.zoomImage.gapAside || 20)
var imgRect = this.getBoundingClientRect()
var imgOuterW = $(this).outerWidth()
var imgOuterH = $(this).outerHeight()
var imgW = $(this).width()
var imgH = $(this).height()
var imgL = $(this).offset().left + (imgOuterW - imgW) / 2
var imgT = $(this).offset().top + (imgOuterH - imgH) / 2
var winW = $(window).width() - SIDE_GAP * 2
var winH = $(window).height() - SIDE_GAP * 2
var scaleX = winW / imgW
var scaleY = winH / imgH
var scale = (scaleX < scaleY ? scaleX : scaleY) || 1
var translateX = winW / 2 - (imgRect.x + imgOuterW / 2) + SIDE_GAP
var translateY = winH / 2 - (imgRect.y + imgOuterH / 2) + SIDE_GAP
$(this).addClass('zoomimg--hide')
$('body')
.append($imgMask)
.append($imgClone)
$imgMask.velocity({
opacity: 1
})
$imgClone.css({
left: imgL,
top: imgT,
width: imgW,
height: imgH
})
$imgClone.velocity(
{
translateX: translateX,
translateY: translateY,
scale: scale
},
{ duration: 300 }
)
})
function closeZoom () {
if (!isZoom) {
return
}
isZoom = false
$imgClone.velocity('reverse')
$imgMask.velocity('reverse', {
complete: function () {
$imgMask.remove()
$imgClone.remove()
$('.zoomimg').removeClass('zoomimg--hide')
}
})
}
},
/**
* Add the header to code block.
* @param {string} type The type of header. value: 'carbon' | null.
*/
addCodeHeader: function (type) {
$('figure.highlight').each(function () {
if (!$(this).find('figcaption')[0]) {
var content = ''
if (!type) {
var CODEBLOCK_CLASS_NAME = 'highlight'
var lang = $(this)
.attr('class')
.split(/\s/)
.filter(function (e) {
return e !== CODEBLOCK_CLASS_NAME
})
content += `<div class="custom-lang">${lang}</div>`
} else if (type === 'carbon') {
content += `
<div class="custom-carbon">
<div class="custom-carbon-dot custom-carbon-dot--red"></div>
<div class="custom-carbon-dot custom-carbon-dot--yellow"></div>
<div class="custom-carbon-dot custom-carbon-dot--green"></div>
</div>
`
}
$(`<figcaption class="custom">${content}</figcaption>`).insertBefore(
$(this)
.children()
.first()
)
}
})
},
addCopyButton: function (type) {
var btnContainer = '.post-copyright,'
var $copyIcon = $(
`<div class="copy-button" data-popover="${CONFIG.prompt.copyButton}" data-popover-pos="up">` +
`<i class="${CONFIG.fontIcon.copyBtn}"></i>` +
'</div>'
)
if (type === 'simple' || type === 'carbon') {
btnContainer += '.highlight figcaption:not(".custom")'
} else {
btnContainer += '.highlight figcaption'
}
// Add a copy button to the selected elements.
$(btnContainer).append($copyIcon)
},
registerCopyEvent: function () {
$('.copy-button').on('click', function () {
var container = null
// Select the container of code block.
var codeContainer = $(this)
.parents('figure.highlight')
.find('td.code')[0]
if (codeContainer) {
container = codeContainer
} else {
// Select the container of text.
container = $(this).parent()[0]
}
if (Stun.utils.copyText(container)) {
Stun.utils.popAlert('success', CONFIG.prompt.copySuccess)
} else {
Stun.utils.popAlert('error', CONFIG.prompt.copyError)
}
})
},
/**
* Wait for all images to load.
* @param {String} selector jQuery selector.
* @param {Function} callback Callback.
*/
waitAllImageLoad: function (selector, callback) {
var imgDefereds = []
$(selector).each(function () {
var dfd = $.Deferred()
$(this).bind('load', function () {
dfd.resolve()
})
if (this.complete) {
setTimeout(function () {
dfd.resolve()
}, 500)
}
imgDefereds.push(dfd)
})
$.when.apply(null, imgDefereds).then(callback)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment