# 1.创建目录存放博客源码 >> mkdir hexo-blog # 2.初始化hexo项目 >> cd hexo-blog && hexo init # 3.安装项目依赖 >> npm install # 4.降级hexo >> npm install hexo@6.3.0 --save # 5.本地预览 >> hexo clean && hexo generate && hexo server INFO Validating config INFO Validating config INFO Start processing INFO Files loaded in 126 ms INFO Generated: archives/index.html INFO Generated: index.html INFO Generated: archives/2026/01/index.html INFO Generated: js/script.js INFO Generated: fancybox/jquery.fancybox.min.css INFO Generated: css/style.css INFO Generated: archives/2026/index.html INFO Generated: fancybox/jquery.fancybox.min.js INFO Generated: js/jquery-3.6.4.min.js INFO Generated: 2026/01/07/hello-world/index.html INFO Generated: css/images/banner.jpg INFO 11 files generated in 188 ms INFO Validating config INFO Start processing INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
# Table of Contents in the Sidebar # Front-matter variable (nonsupport wrap expand_all). toc: enable:true # Automatically add list number to toc. number:false # If true, all words will placed on next lines if header width longer then sidebar width. wrap:false # If true, all level of TOC in a post will be displayed, rather than the activated part of it. expand_all:false # Maximum heading depth of generated toc. max_depth:3
# Sidebar Avatar avatar: # Replace the default image and set the url here. url:/images/avatar.png # If true, the avatar will be displayed in circle. rounded:true # If true, the avatar will be rotated with the cursor. rotated:false
# 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/MirrorYuChen||fabfa-github E-Mail:2458006366@qq.com||fafa-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
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. # Applicable to Muse | Mist and mobile of Pisces | Gemini. # 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# post 改为always
# Sidebar padding in pixels. padding:18 # Sidebar offset from top menubar in pixels (only for Pisces | Gemini). offset:12
# Local Search # Dependencies: https://github.com/next-theme/hexo-generator-searchdb local_search: enable:true # 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