Welcome to MkDocs¶
For full documentation visit mkdocs.org.
Commands¶
mkdocs new [dir-name]
- Create a new project.mkdocs serve
- Start the live-reloading docs server.mkdocs build
- Build the documentation site.mkdocs -h
- Print help message and exit.
Project layout¶
1 2 3 4 |
|
Instructions for creating a new blog¶
1.先要在github上创建一个仓库,例如 https://github.com/username/你自己喜欢的一个后缀名
例如https://github.com/username/username.io
2.在本地创建一个mkdocs项目,可以成功运行 mkdocs serve 查看站点
3.初始化github 仓库
cd path/to/your/mkdocs/project
git init
git add .
git commit -m “Initial commit”
git branch -M main
这一步是初始化、加入全部数据、上传、创建分支
git remote add origin https://github.com/username/username.io
git push -u origin main
这里是连接到远程仓库并将仓库命名为origin,之后就git push -u origin(仓库名) main(分支) 可以了。
这是把东西给你放到仓库里去,想要进行部署(即将东西放置到博客内,还需要 mkdocs gh-deploy
)
mkdocs gh-deploy
如果出现形如因为本地里的东西和仓库内的东西不一致导致无法部署的问题,可以尝试 git pull
之后你每次更新博客(本地内容)都只要mkdocs gh-deploy 就可以了。
对于error:No module named ‘mdx_math’的解决方案是pip install python-markdown-math
每次部署完不会迅速更新,要等待几分钟,有延时
github还是要开clash才能稳定的传东西,有些时候突然error(在你连上外网的时候)可能是端口有问题,去你的clash上找一下代理端口,网上搜下指令就可以了。