Mastodon

极速部署Hexo及其Stellar主题

极速部署Hexo及其Stellar主题
  1. 安装Volta管理Node版本
curl https://get.volta.sh | bash && source ~/.bashrc
  1. 安装 Node.js (LTS)
volta install node@24
  1. 安装hexo & 初始化项目
npm install -g hexo-cli
mkdir blog/hexo
cd blog && hexo init hexo && cd hexo
npm install
  1. 拉取Stellar主题源码
git clone https://github.com/xaoxuu/hexo-theme-stellar.git themes/stellar
  1. 补齐Stellar主题所需插件
npm install probe-image-size hexo-renderer-ejs hexo-renderer-stylus hexo-renderer-pug hexo-renderer-sass hexo-generator-search --save
  1. 修改_config.yml,将theme 设置为 stellar
  2. 修改_config.yml 基本内容,否则Stellar会报错
  3. 修改themes/stellar/layout/_partial/head.ejs
nano themes/stellar/layout/_partial/head.ejs
Ctrl + W:json_ld
Ctrl + K
<%# json_ld() %>
  1. 日常运行与维护
cd ~/blog/hexo
hexo clean && hexo g && hexo s -p 8097