# 创建转载许可证明 # 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: false post: true #开启状态,注意要将站点配置文件中的url改为自己的网址 language:
网站底部的爱心设置
1 2 3 4 5 6 7 8 9
# 网站底部的爱心设置 # Icon between year and copyright info. icon: # Icon name in Font Awesome. See: https://fontawesome.com/icons name: fa fa-heart # 设置图案为爱心 # If you want to animate the icon, set it to true. animated: true # 爱心跳动动画 # Change the color of icon, using Hex Code. color: "#ff0000" # 颜色设置
建站时间设置
1 2
# Specify the date when the site was setup. If not defined, current year will be used. since: 2022 # 建站时间设置
# 菜单设置,“fa fa-home”样式为图案,需要更改的话可以访问:http://www.fontawesome.com.cn/icons/street-view/ # Usage: `Key: /link/ || icon` # Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-senstive. # Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon. # When running the site in a subdirectory (e.g. yoursite.com/blog), remove the leading slash from link value (/archives -> archives). # External url should start with http:// or https:// menu: home: / || fa fa-home #about: /about/ || fa fa-user tags: /tags/ || fa fa-tags categories: /categories/ || fa fa-th archives: /archives/ || fa fa-archive #schedule: /schedule/ || fa fa-calendar sitemap: /sitemap.xml || fa fa-sitemap #commonweal: /404/ || fa fa-heartbeat
添加了新的菜单后,需要到打开git bush输入如下命令:
1 2
cd /d/blog hexo new page "categories" #新的菜单名,以键值为准
然后打开blog/source/categories/index.md,然后添加如下代码:
1
type: "categories"
侧边栏显示设置
1 2 3 4 5 6 7
# 侧边栏显示设置。“always”则为一直显示 # 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: always
# 社交联系方式设置,“fab fa-github”为显示的图案,也可以不显示图案,但“||”不能去掉,否则会报错 # 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/tiansztiansz || CSDN: https://blog.csdn.net/tiantianzs || Gitee: https://gitee.com/a1866 || bilibili: https://space.bilibili.com/28606893 || #E-Mail: mailto:yourname@gmail.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
# 聊天工具 # A button to open designated chat widget in sidebar. # Firstly, you need enable the chat service you want to activate its sidebar button. chat: enable: false #service: chatra #service: tidio icon: fa fa-comment # Icon name in Font Awesome, set false to disable icon. text: Chat # Button text, change it as you wish.
捐献设置
1 2 3 4 5 6 7 8 9 10 11 12 13
# 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: 原创技术分享,您的支持将鼓励我继续创作
# If true, site-subtitle will be added to index page. # Remember to set up your site-subtitle in Hexo `_config.yml` (e.g. subtitle: Subtitle) # 站点地图设置 index_with_subtitle: true
var int = setInterval(fixCount, 50); // 50ms周期检测函数 var countOffset = 20000; // 初始化首次数据
function fixCount() { if (document.getElementById("busuanzi_container_site_pv").style.display != "none") { $("#busuanzi_value_site_pv").html(parseInt($("#busuanzi_value_site_pv").html()) + countOffset); clearInterval(int); } if ($("#busuanzi_container_site_pv").css("display") != "none") { $("#busuanzi_value_site_uv").html(parseInt($("#busuanzi_value_site_uv").html()) + countOffset); // 加上初始数据 clearInterval(int); // 停止检测 } }
}); </script> {%- endif %}
<!-- 在上面插入代码 --> {{- next_inject('footer') }}
显示上方菜单中的内容数
1 2 3 4 5 6
# Table of Contents in the Sidebar # Front-matter variable (unsupport wrap expand_all). toc: enable: true # Automatically add list number to toc. number: true #显示上方菜单中的内容数
添加网易云音乐歌单
先在网易云音乐中创建 blog 专属歌单,注意歌曲要支持生成外链。然后用手机将歌单转发到电脑,用电脑的浏览器打开,即可看到生成外链按钮,注意选择310×90的大小,取消勾选自动播放,否则加载网页会比较卡。复制 HTML 代码,添加到blog\themes\next\layout\_macro\sidebar.swig
cd /d/blog npm install hexo-generator-searchdb --save
然后在blog/_config.yml文件中加入如下代码:
1 2 3 4 5
search: path: search.xml field: post format: html limit: 10000
最后在blog\themes\next\_config.yml文件中修改如下代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# HEXO文章搜索 # 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:true # Preload the search data when the page loads. preload:true