阅读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常用命令