建立virtualenv:
$ mkvirtualenv pelican
从github克隆最新代码安装Pelican
$ git clone git://github.com/getpelican/pelican.git
$ cd pelican
$ python setup.py install
建立博客目录:
$ mkdir pelican_blog
$ cd pelican_blog
$ pelican-quickstart
回答一系列问题:(后续也可以修改)
> Where do you want to create your new web site? [.]
> What will be the title of this web site? Jia Xiaolei
> Who will be the author of this web site? jiaxiaolei
> What will be the default language of this web site? [en]
> Do you want to specify a URL prefix? e.g., http://example.com (Y/n) Y
> What is your URL prefix? (see above example; no trailing slash) http://jiaxiaolei.com
> Do you want to enable article pagination? (Y/n) Y
> How many articles per page do you want? [10]
> What is your time zone? [Europe/Paris] Asia/Shanghai
> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) Y
> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) Y
> Do you want to upload your website using FTP? (y/N) N
> Do you want to upload your website using SSH? (y/N) N
> Do you want to upload your website using Dropbox? (y/N) N
> Do you want to upload your website using S3? (y/N)
> Do you want to upload your website using Rackspace Cloud Files? (y/N)
> Do you want to upload your website using GitHub Pages? (y/N) N
NOTE: 时区列表:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
查看目录结构:
$ tree
.
├── content
├── develop_server.sh
├── fabfile.py
├── Makefile
├── output
├── pelicanconf.py
└── publishconf.py
写一篇文章
在 content 目录新建一个 test.md文件, 填入一下内容:
Title: 文章标题
Date: 2013-04-18
Category: 文章类别
Tag: 标签1, 标签2
这里是内容
安装markdown
$ pip install markdown
编写 .md 生成html, 需要安装 markdown
然后执行:
生成html
$ make html
启动服务:
./develop_server.sh start
开启一个测试服务器, 这会在本地 8000 端口建立一个测试web服务器, 可以使用浏览器打开:http://localhost:8000来访问这个测试服务器, 然后就可以欣赏到你的博客了
一个效果图:
扩张阅读:
使用Pelican打造静态博客
http://www.linuxzen.com/shi-yong-pelicanda-zao-jing-tai-bo-ke.html
简介:
使用 pelican 搭建博客。
pelican创建博客常见问题汇总
http://www.geekcome.com/content-10-3737-1.html
Github上搭博客
http://wbowam.github.io/githubshang-da-bo-ke.html
简介:
github, pelican。介绍了github管理,主题切换。
pelican搭建属于自已的博客...
http://www.yanyulin.info/pages/2013/11/pelican.html