# Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: next
URL配置
1 2 3 4 5 6 7 8 9
# URL ## If your site is put in a subdirectory, set url as 'http://example.com/child' and root as '/child/' url: https://shaogui.life/ root: / permalink: :year/:month/:day/:title/ permalink_defaults: pretty_urls: trailing_index: true# Set to false to remove trailing 'index.html' from permalinks trailing_html: true# Set to false to remove trailing '.html' from permalinks
翻页配置
1 2 3 4
# Pagination ## Set per_page to 0 to disable pagination per_page: 8 pagination_dir: page
配置主题_config.yml
根据 Hexo 官方的推荐,不要直接修改主题的配置文件
The file should be placed in your site folder, both yml and json are supported. theme inside _config.yml must be configured for Hexo to read _config.[theme].yml
# Social Links # Usage: `Key: permalink || icon` # Key is the link label showing to end users. # Value before `||` delimiter is the target permalink, value after `||` delimiter is the name of Font Awesome icon. social: GitHub: https://github.com/WuShaogui || fab fa-github E-Mail: wshglearn@163.com || fa fa-envelope #Weibo: https://weibo.com/yourname || fab fa-weibo #Google: https://plus.google.com/yourname || fab fa-google #Twitter: https://twitter.com/yourname || fab fa-twitter #FB Page: https://www.facebook.com/yourname || fab fa-facebook #StackOverflow: https://stackoverflow.com/yourname || fab fa-stack-overflow #YouTube: https://youtube.com/yourname || fab fa-youtube #Instagram: https://instagram.com/yourname || fab fa-instagram #Skype: skype:yourname?call|chat || fab fa-skype
# Reward (Donate) # Front-matter variable (unsupport animation). reward_settings: # If true, reward will be displayed in every article by default. enable: true animation: true comment: 坚持原创技术分享,您的支持将鼓励我继续创作!.
follow_me: #Twitter: https://twitter.com/username || fab fa-twitter #Telegram: https://t.me/channel_name || fab fa-telegram #WeChat: /images/wechat_channel.jpg || fab fa-weixin RSS: /atom.xml || fa fa-rss
Github角标
1 2 3 4 5
# `Follow me on GitHub` banner in the top-right corner. github_banner: enable: true permalink: https://github.com/WuShaogui title: Follow me on GitHub
搜索功能
搜索功能需要安装插件实现,使用npm管理器安装以下插件
1
npm install hexo-generator-searchdb --save
在主题配置文件配置以下信息
1 2 3 4 5 6 7 8 9 10 11 12 13
# Local Search # Dependencies: https://github.com/theme-next/hexo-generator-searchdb local_search: enable: true # If auto, trigger search by changing input. # If manual, trigger search by pressing enter key or search button. trigger: auto # Show top n results per article, show all results by setting to -1 top_n_per_article: 1 # Unescape html strings to the readable one. unescape: false # Preload the search data when the page loads. preload: false
# Show Views / Visitors of the website / page with busuanzi. # Get more information on http://ibruce.info/2015/04/04/busuanzi busuanzi_count: enable: true total_visitors: true total_visitors_icon: fa fa-user total_views: true total_views_icon: fa fa-eye post_views: true post_views_icon: fa fa-eye
# Valine # For more information: https://valine.js.org, https://github.com/xCss/Valine valine: enable: true appid: xxxxxxxxxxxxxxxxx # Your leancloud application appid appkey: xxxxxxxxxxxxxxxxx # Your leancloud application appkey notify: false# Mail notifier verify: false# Verification code placeholder: 留下你的评论吧 # Comment box placeholder avatar: mm # Gravatar style guest_info: nick,mail,link# Custom comment header pageSize: 10 # Pagination size language: # Language, available values: en, zh-cn visitor: true# Article reading statistic comment_count: true# If false, comment count will only be displayed in post page, not in home page recordIP: true# Whether to record the commenter IP serverURLs: # When the custom domain name is enabled, fill it in here (it will be detected automatically by default, no need to fill in) #post_meta_order: 0
版权声明
1 2 3 4 5 6 7 8 9 10
# Creative Commons 4.0 International License. # See: https://creativecommons.org/share-your-work/licensing-types-examples # Available values of license: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero # You can set a language value if you prefer a translated version of CC license, e.g. deed.zh # CC licenses are available in 39 languages, you can find the specific and correct abbreviation you need on https://creativecommons.org creative_commons: license: by-nc-sa sidebar: true post: true language:
sidebar: # Sidebar Position. position: left # position: right
# Manual define the sidebar width. If commented, will be default for: # Muse | Mist: 320 # Pisces | Gemini: 240 width: 240
# Sidebar Display (only for Muse | Mist), available values: # - post expand on posts automatically. Default. # - always expand for all pages automatically. # - hide expand only when click on the sidebar toggle icon. # - remove totally remove sidebar including sidebar toggle. display: post
# Sidebar padding in pixels. padding: 18 # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). offset: 12 # Enable sidebar on narrow view (only for Muse | Mist). onmobile: false # Sidebar Avatar avatar: # Replace the default image and set the url here. url: /images/avatar.gif # If true, the avatar will be dispalyed in circle. rounded: true # If true, the avatar will be rotated with the cursor. rotated: true
<script type="text/javascript"> var alltags = document.getElementsByClassName('tag-cloud-tags'); var tags = alltags[0].getElementsByTagName('a'); for (var i = tags.length - 1; i >= 0; i--) { var golden_ratio = 0.618033988749895; var s = 0.5; var v = 0.999; var h = golden_ratio + Math.random()*0.8 - 0.5; var h_i = parseInt(h * 6); var f = h * 6 - h_i; var p = v * (1 - s); var q = v * (1 - f * s); var t = v * (1 - (1 - f) * s); var r, g, b; switch (h_i) { case 0: r = v; g = t; b = p; break; case 1: r = q; g = v; b = p; break; case 2: r = p; g = v; b = t; break; case 3 : r = p; g = q; b = v; break; case 4: r = t; g = p; b = v; break; case 5: r = v; g = p; b = q; break; default: r = 1; g = 1; b = 1; } tags[i].style.background = "rgba("+parseInt(r*255)+","+parseInt(g*255)+","+parseInt(b*255)+","+0.5+")"; } </script>