語法
https://macplay.github.io/posts/cong-markdown-dao-restructuredtext/
http://www.bary.com/doc/a/228277572381775842/#d46f82fd
工具
sphinx:文檔系統(tǒng)
http://www.sphinx-doc.org/en/master/contents.html
nikola:靜太博客系統(tǒng)
https://www.getnikola.com/
netlify: 站點(diǎn)布置
https://www.netlify.com/
使用markdown的靜態(tài)博客系統(tǒng)
mkdocks
hexo
sphinx & github & readthedoc 搭建靜態(tài)博客寫作平臺
sphinx
在wsl中安裝好的python環(huán)境,使用pip 安裝 sphinx,沒什么問題。
按教程的命令新建一個項(xiàng)目。應(yīng)該要先新建一個文件夾。
github
在GITHUB新建一個庫,準(zhǔn)備用來接收SPHINX的項(xiàng)目。
在本地把github上新建立的庫clone下來
這樣,本地的庫就和遠(yuǎn)程庫連接起來了。
進(jìn)入到本地庫目錄,開始創(chuàng)建文檔
sphinx-quickstart
上述命令會在目錄中創(chuàng)建一些文件,包括配置文件和一個make文件。
把內(nèi)容組織好以后,可以直接用make命令得出想要的格式。這里我我用的是
make html
把項(xiàng)目同步到github
前面還還包括設(shè)置git環(huán)境,設(shè)置公鑰等。
# 如果是先在本地建庫,連接到github遠(yuǎn)程庫的話,如下操作
git init
git add .
git commit -m
git remote add origin git@github.com:xxxxx/mybooks
git push -u origin master
# 如果是從遠(yuǎn)程庫克隆回來的庫
git add .
git commit -m 'something'
git push
在github遠(yuǎn)程庫中設(shè)置webhook
我推送上去后,就自動生成了,不知道為什么。試過兩次好象確實(shí)都是自己設(shè)置好了的。
登錄readthedoc
- 用github賬號登錄readthedoc
- 在項(xiàng)目中選擇github中的庫
然后會自動deploy
我在前面幾次失敗了,后來看了這個成功了。https://stackoverflow.com/questions/56336234/build-fail-sphinx-error-contents-rst-not-found
If you have your own conf.py file, it overrides Read the Doc's default conf.py. By default, Sphinx expects the master doc to be contents. Read the Docs will set master doc to index instead (or whatever it is you have specified in your settings). Try adding this to your conf.py:
master_doc = 'index'
后續(xù)操作
- 用vscode編輯文件
- 在項(xiàng)目文件根目錄下,git三連推。
- 在readthedoc項(xiàng)目頁面上,重新構(gòu)建。
目前第三步還沒有成功,不知道為什么。也許要多等一段時間。
readthedoc上應(yīng)該就會自動渲染更新了。