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 #404页面
选择需要的菜单后,需要在/blog目录下执行以下命令(以about界面为例)
1
hexo new page about
然后就可以在/blog/ource/about/index.md 里面编辑内容了
修改底部网站建立时间
把since后面改成建立网站的年份
1 2 3
footer: # Specify the year when the site was setup. If not defined, current year will be used. since: 2024
自定义网站底部的♥️
找到以下代码
1 2 3 4 5 6 7 8
# Icon between year and copyright info. icon: # Icon name in Font Awesome. See: https://fontawesome.com/icons name: fa fa-heart ##fontawesome图标可自定义 # If you want to animate the icon, set it to true. animated: true ##是否开启动态图标 # Change the color of icon, using Hex Code. color: "#ff0000" ##颜色
sidebar: # Sidebar position. Available values: left | right #侧栏的位置 position: left
# Sidebar width. #侧栏的宽度,注意修改对应的主题 # Applicable to Muse | Mist and mobile of Pisces | Gemini. width_expanded: 320 # Applicable to desktop of Pisces | Gemini. width_dual_column: 240
# Sidebar display. #侧栏显示何时展示(只对Muse | Mist两种风格有效) # Applicable to Muse | Mist and mobile of Pisces | Gemini. # Available values: # - post 在文章页面(拥有目录列表)时显示,默认方式 # - always 在所有页面中都显示 # - hide 在所有页面中都隐藏(可以手动展开) # - remove 完全移除侧边栏,包括侧边栏切换按钮。 display: post
# Sidebar padding in pixels. #边栏填充像素 padding: 18 # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). # 侧边栏与顶部菜单栏的偏移量,单位为像素(仅适用于 Pisces | Gemini)。 offset: 12
边栏头像
1 2 3 4 5 6 7 8
# Sidebar Avatar avatar: # Replace the default image and set the url here. url: #/images/avatar.gif #如要启用,请取消注释并且填入头像的路径 # If true, the avatar will be displayed in circle. rounded: false #是否开启圆角 # If true, the avatar will be rotated with the cursor. rotated: false #光标移到头像上后头像是否旋转
添加联系方式
找到下面的代码,把自己需要添加的联系方式给取消注释,改成自己的链接,图标也可以自定义
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# 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/yourname || fab fa-github #E-Mail: mailto:[email protected] || fa fa-envelope #Weibo: https://weibo.com/yourname || fab fa-weibo #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 social_icons: #图标设置 enable: true icons_only: false transition: false
reading_progress: enable: true # Available values: left | right start_at: left # Available values: top | bottom position: top reversed: false color: "#2ab1ff" height: 2px
back2top 也有这样的功能
网页加载进度条
1 2 3 4 5 6 7 8 9
pace: enable: true # All available colors: # black | blue | green | orange | pink | purple | red | silver | white | yellow color: blue # All available themes: # big-counter | bounce | barber-shop | center-atom | center-circle | center-radar | center-simple # corner-indicator | fill-left | flat-top | flash | loading-bar | mac-osx | material | minimal theme: minimal
返回顶部
添加返回顶部的小按钮
1 2 3 4 5 6
back2top: enable: true # Back to top in sidebar. sidebar: false # Scroll percent label in b2t button. scrollpercent: false
# Uri of fonts host, e.g. https://fonts.googleapis.com (Default). host:
# Font options: # `external: true` will load this font family from `host` above. # `family: Times New Roman`. Without any quotes. # `size: x.x`. Use `em` as unit. Default: 1 (16px)
# Global font settings used for all elements inside <body>. global: external: true family: Noto Serif SC size:
# Font settings for site title (.site-title). title: external: true family: Fira Code size:
# Font settings for headlines (<h1> to <h6>). headings: external: true family: size:
# Font settings for posts (.post-body). posts: external: true family:
# Font settings for <code> and code blocks. codes: external: true family: Fira Code, Noto Serif SC
添加CC协议
防君子不防小人
1 2 3 4 5 6 7 8 9 10 11 12
# Creative Commons 4.0 International License. # See: https://creativecommons.org/about/cclicenses/ creative_commons: # Available values: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | cc-zero license: by-nc-sa # Available values: big | small size: small sidebar: false post: true # 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 language: zh-CN
search: path: search.xml field: post content: true format: html
主题配置
1 2 3 4 5 6 7 8 9 10 11
# Local Search # Dependencies: https://github.com/next-theme/hexo-generator-searchdb local_search: enable: true trigger: auto #若为manual, 通过按下enter键或者点击搜索按钮触发搜索 # 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
不蒜子网站统计
本地预览时,访问量不正常,部署后才可用
1 2 3 4 5 6 7 8
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: far fa-eye
# Automatically insert whitespace between CJK and half-width characters. # For more information: https://github.com/vinta/pangu.js # Server-side plugin: https://github.com/next-theme/hexo-pangu pangu: true
在 hexo 生成后删除不必要的文件
1 2
# Remove unnecessary files after hexo generate. minify: true
网站优化加速
1 2 3
# Easily enable fast Ajax navigation on your website. # For more information: https://github.com/next-theme/pjax pjax: true