利用 github + hexo 搭建个人博客

自从接触编程以来,看到大神都拥有自己的博客,我这个小菜鸡也希望向大神看齐

这是我利用 github + hexo 搭建的一个个人博客,主题使用了theme: butterfly

具体的教程,网上都有,我就不一一写了(好吧,就是懒 😁)

书写博客

  • 创建 -> 在文件根目录->source/_post目录下执行hexo n 文件名
  • 发布:
    • hexo cl && hexo g && hexo s
    • 发布到远程博客hexo d

搭建过程中遇到的问题

  • 网站配置

名称一定要是 github 用户名.github.io .github.io 是固定写法

博客的根目录下的_config.yml 中 需要修改 deploy

1
2
3
4
5
6
deploy:
type: git
repository: https://github.com/old-gang/old-gang.github.io.git
branch: main

由于github更新了,默认分支改为了main,记得修改一下
  • 博客标签切换为中文

博客的根目录下的_config.yml 中修改 #Site

1
2
# Site
language: zh-CN
  • 主题配置

各种配置项,建议查看官网 (新手误入 😅)
https://butterfly.js.org/

推荐一位大神的配置 😎

海拥\Butterfly 主题美化:http://haiyong.site/post/22e1d5da.html