• 主页
  • 架构
  • 编程语言
  • 数据存储
  • 网络
  • VMware
  • 服务器
  • 组网
  • AI
  • 算法系列
  • 设计模式
  • 读书笔记
  • 思考
  • 工具
  • 其它技术

  • 主页
  • 架构
  • 编程语言
  • 数据存储
  • 网络
  • VMware
  • 服务器
  • 组网
  • AI
  • 算法系列
  • 设计模式
  • 读书笔记
  • 思考
  • 工具
  • 其它技术

使用hexo搭建个人博客

2024-08-18

很早之前使用hexo和github建了个人博客。搭建的流程一直没有梳理,中间换过几次机器,每次都得重新配置一遍,需要重新学些。最近电脑坏了,原始的数据没有导出来,先把以前文章写个文件占个位置,后面慢慢补吧,如果大家要看内容的话可以去https://juejin.cn/user/870468942580749。

详细的配置大家可以参考使用hexo+github搭建免费个人博客详细教程

安装

先安装软件

1
2
3
4
brew install npm
brew install nodejs
npm install -g hexo
npm install hexo-deployer-git --save

然后创建文件夹,初始化hexo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//建hexo目录,必须是空的
hexo init

//更换主题,我使用的事yilia
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
//修改themes/yilia/_config.yml 配置分类

//生成
hexo g

//启服务,看效果 http://localhost:4000
hexo s

//如果没有生效,可以删除重新生成
hexo clean

查看图片的时候,发现图片没有显示,修改图片问题

1
2
3
4
5
6
7
8
9
//https://blog.csdn.net/Miracle_ps/article/details/114791335
npm install https://github.com/7ym0n/hexo-asset-image --sa


//themes/yilia/_config.yml中添加配置
post_asset_folder: true
marked:
prependRoot: true
postAsset: true

部署到github,在_config.yml中增加配置

1
2
3
4
deploy:
type: git
repository: git@github.com:shidawuhen/shidawuhen.github.io.git
branch: feature_pzq_newaritcle

常用命令

1
2
3
4
5
6
7
8
//分割线
<!-- more -->

//生成category
hexo new page "技术文章"

//生成新文章
hexo new pages 文章名

拷贝数据

1.将source拷贝到source中

2.将themes/yilia拷贝到themes/yilia中

3.将_config.yml拷贝到_config.yml

资料

1.https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html

2.https://www.jianshu.com/p/3db6a61d3782

3.https://blog.csdn.net/weixin_41829196/article/details/90574870

4.Hexo插入图片并解决图片的路径问题

扫一扫,分享到微信

微信分享二维码
如何进行技术方案设计
SLA服务可用性如何定义
© 2025 John Doe
Hexo Theme Yilia by Litten