Total Pageviews

Sunday 10 July 2016

一个基于php的静态博客程序-comanche

首先在你的linux vps上,安装php环境。
然后
git clone https://github.com/travisred/comanche
cd comanche
mv comanche /usr/share/
cd /usr/share/comanche

root@AR:/usr/share/comanche# ls
autoload.php  config.txt  LICENSE  README.md site  templates
comanche.php  lib   md   screen-comanche.png src   tests

root@AR:/usr/share/comanche# ls site
index.html    rss.xml
archive how-to-use-comanche    
img       sitemap.txt 
root@AR:/usr/share/comanche#

/usr/share/comanche/site/里面有index.html文件,所以/usr/share/comanche/site/就是静态网站的根目录。

root@AR:/usr/share/comanche# cd md
root@AR:/usr/share/comanche/md# ls
how-to-use-comanche
root@AR:/usr/share/comanche/md# nano test1
(按how-to-use-comanche文件的格式,新建test1文件如下:
测试1
2016-07-10
brite
published

这是测试1.看看怎么样呢?)

root@AR:/usr/share/comanche/md# cd ..
root@AR:/usr/share/comanche# ls
autoload.php  config.txt  LICENSE  README.md site  templates
comanche.php  lib   md   screen-comanche.png src   tests
root@AR:/usr/share/comanche# nano config.txt
(编辑config.txt如下:
site_title: Comanche blog of brite
site_description: a static site builder
site_root: http://cmc.smt.biz.st
front_page_count: 5

以上site_root的值改为http://yourdomain.com)
root@AR:/usr/share/comanche# php comanche.php
(这个就是生成/更新静态网站的命令)
root@AR:/usr/share/comanche# 

演示站点: http://cmc.smt.biz.st/, http://magnatecha.com(程序作者基于comanche搭建的博客)
项目地址:https://github.com/travisred/comanche
可惜这个程序不能分页。