Pelican+Github搭建博客

Github设置

注册后登录Github,点击“Creat a new repo”,版本库名使用'username.github.io'的格式,这里将username替换成自己的用户名即可。

安装Python、Pelican和Markdown

yum install python
pip install pelican
pip install markdown http://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","http://github.com"),("ITEM2",URL), ......)。

安装主题

安装主题:git clone https://github.com/getpelican/pelican-themes.git;cd pelican-themes;pelican-themes -i bootstrap2。
设置主题:THEME = 'bootstrap2'。
推荐主题:Elegant http://oncrashreboot.com/elegant-best-pelican-theme-features

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值