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