这篇文章记录博客的日常维护方式,方便以后快速修改配置、写文章和发布。
常用位置#
- 站点信息:
_config.yml - 主题配置:
_config.butterfly.yml - 自定义样式:
source/css/custom.css - 文章目录:
source/_posts/ - 图片目录:
source/img/ - 页面目录:
source/about/、source/photos/、source/resources/、source/thoughts/ - GitHub Pages 部署:
.github/workflows/pages.yml
新建文章#
npx hexo new post "文章标题"bash文章开头建议保留这些字段:
---
title: 文章标题
date: 2026-05-31 00:00:00
categories: Technical
tags:
- 标签
description: 一句话说明这篇文章解决什么问题。
cover: /img/default-cover.webp
---yaml本地预览#
npm run clean
npm run serverbash浏览器打开:
http://localhost:4000text发布#
git add .
git commit -m "update blog content"
git push origin mainbash推送后 GitHub Actions 会自动构建并发布到 GitHub Pages。