Total Pageviews

Thursday 16 March 2017

搭建基于python的静态博客程序poole

cd /usr/local
git clone https://github.com/obensonne/poole poole-site
cd poole-site

root@AR:/usr/local/poole-site# ls
README.md  poole.py  tests  themes
(poole.py是可执行文件)
root@AR:/usr/local/poole-site# export $PATH=PATH:/usr/local/poole-site
root@AR:/usr/local/poole-site# echo 'export $PATH=PATH:/usr/local/poole-site' >> /etc/profile
root@AR:/usr/local/poole-site# mkdir poole-blog
root@AR:/usr/local/poole-site# cd poole-blog
root@AR:/usr/local/poole-site/poole-blog# poole.py --init --theme=bootstrap
(此命令的意思是初识化博客项目,并选择bootstrap这个theme)
root@AR:/usr/local/poole-site/poole-blog# ls
input  output  page.html
(此时的output是空目录)
root@AR:/usr/local/poole-site/poole-blog# poole.py --build
(此即生成/更新静态网站的根目录的命令)
root@AR:/usr/local/poole-site/poole-blog# cd output
root@AR:/usr/local/poole-site/poole-blog/output# ls
blog.2013-04-01.Holy_Grail.html   blog.html  index.html  layout.html
blog.2013-04-08.Lorem_Ipsum.html  css         js         logic.html
root@AR:/usr/local/poole-site/poole-blog/output#

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

新建源帖:
root@AR:/usr/local/poole-site/poole-blog/output# cd ../input
root@AR:/usr/local/poole-site/poole-blog/input# nano blog.2017-03-16.测试_1.md 

root@AR:/usr/local/poole-site/poole-blog/input# cat 
blog.2017-03-16.测试_1.md
## {{ page["post"] }}

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

这是测试1.

root@AR:/usr/local/poole-site/poole-blog/input# cd ..

root@AR:/usr/local/poole-site/poole-blog# poole.py --build

演示网站:http://pl.bright.biz.st/,http://pl.bright.biz.st/blog.html
(同一天里发表的帖子不是发表的时间顺序排列的。)
项目地址:https://github.com/obensonne/poole,
https://bitbucket.org/obensonne/poole



No comments:

Post a Comment