跳转至

基于 mkdocs-material 的个人博客搭建

author: Haohahahaha (Haorui Zhang)

mail: 1259203802@qq.com

date: 2023-12-12

本文章含仓库适配

仓库地址:initializer-material-blog

安装流程

注册 Github 账号

STFW.

建立个人资料仓库与博客仓库

STFW.

获取 SSH key 并上传到 Github

Ubuntu 22.04 虚拟机自动化安装 - 获取 SSH key 中已获取到 SSH Key

复制 ~/.ssh/id_rsa.pub 内所有内容

在 Github 个人设置中,SSH and GPG keys 点击 New SSH key 添加刚才获取到的 SSH key 即可。

设置与配置本地仓库文件夹

mkdir [YOUR_folder]
cd [YOUR_folder]
git init
git config --global user.name "YOUR_NAME"
git config --global user.email "YOUR_EMAIL"
git remote add REMOTE_NAME GITHUB_REMOTE

设置远程仓库 Github Actions 的权限

  • 在 Settings-Actions-General 中 Workflow Perimissions 选择 Read and Write permissions

初始化仓库内容并上传到远程

auto-update-this-repo.sh
mkdocs.yml
README.md
docs/index.md
docs/CNAME # 个人自定义网址

设置 Github Deploy 分支与自定义网址

  • Settings-Pages 中 Build and Deployment-Branch 选择 gh-pages,点击 Save 保存

    • Custom domain 下可设置自己的网址

markdown语法与博客排版+选题+维护

markdown-it demo

如何看待程序员持续写技术博客 - Raven 的回答