Total Pageviews

Saturday 23 November 2013

在linux vps上搭建基于php的静态博客程序-purepress

as3:~# mkdir purepress
as3:~# cd purepress
as3:~/purepress# git clone https://github.com/megakote/purepress.git ./_/
Cloning into ./_...
remote: Counting objects: 29, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 29 (delta 8), reused 24 (delta 3)
Unpacking objects: 100% (29/29), done.
as3:~/purepress# cd _/
as3:~/purepress/_# ls
build.php  example  README.md
as3:~/purepress/_# ls example
data  files  template
as3:~/purepress/_# mv example/* .
as3:~/purepress/_# ls
build.php  data  example  files  README.md  template
as3:~/purepress/_# ls example
as3:~/purepress/_# rm -rf example
as3:~/purepress/_# ls
build.php  data  files  README.md  template
as3:~/purepress/_# php build.php (这个就是生成/更新静态网站的命令)
Start
PHP Notice:  Undefined offset: 1 in /root/purepress/_/build.php on line 32
PHP Notice:  Undefined offset: 2 in /root/purepress/_/build.php on line 33
Directory '/root/purepress/ is exist, clean it, except '_' && '.git'? Type 'yes' or 'y' to continue: y (注意:不要输yes,要输y)
Done
as3:~/purepress/_# cd ..
as3:~/purepress# ls
_  2013-01-04-HTML_ipsum_presents.html  index.html  stylesheets
as3:~/purepress#
可见~/purepress/就是静态网站的根目录。
2013-01-04-HTML_ipsum_presents.html,index.html和stylesheets是运行了命令php build.php后,从~/purepress/_/推送到~/purepress/下的.

发贴方法:
as3:~/purepress# cd _
as3:~/purepress/_# ls
build.php  data  files  README.md  template
as3:~/purepress/_# cd data
as3:~/purepress/_/data# ls
2013-01-04-HTML_ipsum_presents.html
按 2013-01-04-HTML_ipsum_presents.html的格式,新建帖子2013-11-23-test1.html,
格式如下:
<!--DATE:2013-11-23 -->
<!--TITLE:test1 -->

这是测试1.


然后:
as3:~/purepress/_/data# cd ..
as3:~/purepress/_# php build.php

演示站点:http://pp.brite.biz (网页中的帖子是按字母顺序排列的)
项目地址:https://github.com/megakote/purepress

2014-04-15注:程序作者已删除该repo,但是我把以前下载的repo上传到此:
https://app.box.com/s/y4h0rq1fe78wsgqymzjx