Pages

Wednesday, 22 March 2017

搭建基于python3的静态博客程序piecrust2

首先搭建python3环境。

git clone https://github.com/ludovicchabant/PieCrust2 piecrust2-site
cd piecrust2-site



root@AR:/usr/local/piecrust2-site# pip3 install -r requirements.txt
root@AR:/usr/local/piecrust2-site# python3 setup.py install
it shows:
...
Using /usr/local/python-3.5.2/lib/python3.5/site-packages
Finished processing dependencies for PieCrust==0.0
root@AR:/usr/local/piecrust2-site# which chef
/usr/local/python-3.5.2/bin/chef
root@AR:/usr/local/piecrust2-site# chef init piecrust2-blog (此命令会在当前目录下,生成piecrust2-blog目录)
root@AR:/usr/local/piecrust2-site# ls piecrust2-blog
config.yml
root@AR:/usr/local/piecrust2-site# cd piecrust2-blog

root@AR:/usr/local/piecrust2-site/piecrust2-blog# chef prepare post test-1
(这个是建立空帖子的命令。)
Creating page: posts/2017-03-21_test-1.md
root@AR:/usr/local/piecrust2-site/piecrust2-blog# nano posts/2017-03-21_test-1.md

root@AR:/usr/local/piecrust2-site/piecrust2-blog# chef bake -f 
(这个就是生成/更新静态网站的命令)
root@AR:/usr/local/piecrust2-site/piecrust2-blog# ls
_cache    _counter  config.yml  posts

(生成了_counter目录)
root@AR:/usr/local/piecrust2-site/piecrust2-blog# cd
_counter

root@AR:/usr/local/piecrust2-site/piecrust2-blog/_counter# ls
2017  index.html
root@AR:/usr/local/piecrust2-site/piecrust2-blog/_counter#

(可见/usr/local/piecrust2-site/piecrust2-blog/_counter就是静态网站的根目录)

演示站点:http://pcp.bright.biz.st
项目地址:https://github.com/ludovicchabant/PieCrust2

https://github.com/ludovicchabant/PieCrust2/issues/46
https://bolt80.com/piecrust/en/latest/getting-started/
https://bolt80.com/piecrust/en/latest/docs/tutorial/


相关帖子:http://briteming.blogspot.com/2013/11/linux-vpsphp-piecrust.html

No comments:

Post a Comment