安装pelican
$ pip3 install pelican markdown ghp-import...$ pelican --version4.0.0
快速开始一个博客项目
$ pelican-quickstartWelcome to pelican-quickstart v4.0.0.This script will help you create a new Pelican-based website.Please answer the following questions so this script can generate the filesneeded by Pelican.> Where do you want to create your new web site? [.]> What will be the title of this web site? my blog> Who will be the author of this web site? atyang> What will be the default language of this web site? [zh]> Do you want to specify a URL prefix? e.g., https://example.com (Y/n) n> 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 tasks.py/Makefile to automate generation and publishing? (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) n> Do you want to upload your website using Rackspace Cloud Files? (y/N) n> Do you want to upload your website using GitHub Pages? (y/N) y> Is this your personal page (username.github.io)? (y/N) yDone. Your new project is available at /Users/xxx/projs/python/pelican/helloworld$ lsMakefile output publishconf.pycontent pelicanconf.py tasks.py
时间区域,参考
查看生成的文件
$ tree.├── Makefile├── content├── output├── pelicanconf.py├── publishconf.py└── tasks.py2 directories, 4 files
添加markdown文件,并生成html
到content目录下,添加first.md文件,并加入内容:
$ cd content$ vim first.mdTitle: My first postDate: 2014-12-23 17:49Modified: 2014-12-23 17:49Category: miscTags: first, miscSlug: My-first-postAuthors: Adrien LegerSummary: Short version of my first blog postThis is my **first blog post with pelican**
保存后,生成html文件
$ make html
启动服务
$ make serve
浏览器访问