閱讀72 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Pelican+Github搭建博客

Github設置

注冊後登錄Github,點擊“Creat a new repo”,版本庫名使用'username.github.io'的格式,這裏將username替換成自己的用戶名即可。

安裝Python、Pelican和Markdown

yum install python
pip install pelican
pip install markdown https://wowubuntu.com/markdown/

創建博客骨架

搭建博客目錄:mkdir blog; cd blog; pelican-quickstart。
進入output文件夾,把username.github.io版本庫clone下來:cd output; git clone https://github.com/username/username.github.io.git。
設置上傳部署到Github,修改根目錄下的Makefile文件:
OUTPUTDIR=$(BASEDIR)/output/username.github.io
publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
github: publish
cd OUTPUTDIR ; git add . ; git commit -am 'your comments' ; git push

定製博客

設置pelicanconf.py。

導航目錄項

MENUITEMS = (("ITEM1","https://github.com"),("ITEM2",URL), ......)。

安裝主題

安裝主題:git clone https://github.com/getpelican/pelican-themes.git;cd pelican-themes;pelican-themes -i bootstrap2。
設置主題:THEME = 'bootstrap2'。
推薦主題:Elegant https://oncrashreboot.com/elegant-best-pelican-theme-features。

最後更新:2017-10-04 22:33:04

  上一篇:go  雲盾WAF實現虛擬補丁——記一起Web漏洞應急響應
  下一篇:go  gcc常用命令