Total Pageviews

Monday, 21 October 2013

在linux vps上,搭建基于PYTHON的静态博客程序-poole

# apt-get install mercurial
# hg clone http://bitbucket.org/obensonne/poole/ /root/poole/
# cd /root/poole/
# export PATH=$PATH:/root/poole/  (把这行命令添加到/etc/profile的末尾)
# mkdir poole-site
# cd poole-site
# poole.py --init --theme minimal
# poole.py --build (本行就是生成静态网站/更新静态网站的命令)
as3:~/poole/poole-site# ls
input  output  page.html
as3:~/poole/poole-site# ls output
blog.2013-04-01.Holy_Grail.html   blog.html   layout.html
blog.2013-04-08.Lorem_Ipsum.html  index.html  logic.html
as3:~/poole/poole-site# cd output
as3:~/poole/poole-site/output# ls
blog.2013-04-01.Holy_Grail.html   blog.html   layout.html
blog.2013-04-08.Lorem_Ipsum.html  index.html  logic.html (可见~/poole/poole-site/output/就是静态网站的根目录,你可绑定一个域名到该目录.)
as3:~/poole/poole-site/output# nohup Rwebserver 3419 > /dev/null &
[1] 8453
as3:~/poole/poole-site/output# nohup: ignoring input and redirecting stderr to stdout
as3:~/poole/poole-site/output#

demo site: http://as3.brite.biz:3419,http://as3.brite.biz:3419/blog.html
http://poole.brite.biz, http://poole.brite.biz/blog.html

To write your own pages, use the example pages in the input folder as a starting point:
as3:~/poole/poole-site/output# cd ~/poole/poole-site/input
as3:~/poole/poole-site/input# ls
blog.2013-04-01.Holy_Grail.md   blog.md   layout.md
blog.2013-04-08.Lorem_Ipsum.md  index.md  logic.md
as3:~/poole/poole-site/input# nano blog.2013-10-20.test1.md
(按~/poole/poole-site/input/里的blog.2013-04-01.Holy_Grail.md文件,依样画葫芦,新建帖子blog.2013-10-20.test1.md,文件的格式如下:
## {{ page["post"] }}

*Posted at <!--{ page["date"] }-->.*

这是测试1.

as3:~/poole/poole-site/input# cd ..
as3:~/poole/poole-site# poole.py --build

项目地址: https://bitbucket.org/obensonne/poole,https://bitbucket.org/obensonne/poole/wiki/Home
https://github.com/obensonne/poole