文章

博客升级到 chirpy theme

chirpy theme 确实很强大!

博客升级到 chirpy theme

修改模板

使用如下命令克隆 repo 到本地

1
git clone https://github.com/cotes2020/chirpy-starter.git

修改 _config.yml 文件内的配置信息,主要有

  • lang 修改为 zh-CN
  • url 修改为 https://<username>.github.io
  • title description tagline
  • avatar

本地预览

本地预览需先安装好 Docker DesktopVS Code

  • VS Code 安装 Dev Contaivers 插件
  • 打开目录,根据提示下载 Docker 镜像
  • 容器启动后,可以在 VS Code 终端执行
1
2
bundle install
bundle exec jekyll serve --force_polling

或者在 windows 终端执行

1
2
3
4
docker exec -it <container_name> bash
cd /workspaces/kode4fun.github.io
bundle install
bundle exec jekyll serve -force_polling

部署到 github

需要先删除默认的 .github/workflows/pages-deploy.yml 文件中 branchs 节多余的 main 分支

  • 建立名字为 <username>.github.io 的 repo
  • 进入 Settings->Pagessource 中选择 Github Actions
  • push 到 github

参考资料

本文由作者按照 CC BY 4.0 进行授权