Total Pageviews

Monday 21 October 2013

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

wget http://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-4.3.tar.gz
tar zxvf SimpleTAL-4.3.tar.gz
cd SimpleTAL-4.3
python setup.py install

cd ..
wget http://www.owlfish.com/software/PubTal/downloads/PubTal-3.5.tar.gz
tar zxvf PubTal-3.5.tar.gz
cd PubTal-3.5
python setup.py install

cd ~/PubTal-3.5/examples/homepage/
updateSite.py site.config (本行就是生成静态网站/更新静态网站的命令)

as3:~/SimpleTAL-4.3# cd ~/PubTal-3.5/examples/homepage
as3:~/PubTal-3.5/examples/homepage# updateSite.py site.config
Support for content types: Binary, Weblog, Raw, HTMLText, OpenOffice, Catalogue
Building whole site.
(0 %) Publishing index.txt
(50 %) Publishing second/index.txt
as3:~/PubTal-3.5/examples/homepage# ls
content  dest  PubTalData  site.config  template
as3:~/PubTal-3.5/examples/homepage# ls content
index.txt  second
as3:~/PubTal-3.5/examples/homepage# ls dest
index.html  second  style (可见~/PubTal-3.5/examples/homepage/dest/就是静态网站的根目录。你可绑定一个域名到该目录.)
as3:~/PubTal-3.5/examples/homepage# cd dest
as3:~/PubTal-3.5/examples/homepage/dest# nohup Rwebserver 9076 > /dev/null &
[2] 10782
as3:~/PubTal-3.5/examples/homepage/dest# nohup: ignoring input and redirecting stderr to stdout
as3:~/PubTal-3.5/examples/homepage/dest#

演示站点: http://pt.brite.biz

发贴方法:
as3:~/PubTal-3.5/examples/homepage/content# ls
index.txt  second
as3:~/PubTal-3.5/examples/homepage/content# mkdir third
as3:~/PubTal-3.5/examples/homepage/content# cd third
as3:~/PubTal-3.5/examples/homepage/content/third# ls
as3:~/PubTal-3.5/examples/homepage/content/third# nano index.txt
(index.txt的格式如下:
title: The 3rd page

这是第三页。)
as3:~/PubTal-3.5/examples/homepage/content/third# cd ~/PubTal-3.5/examples/homepage/
as3:~/PubTal-3.5/examples/homepage# updateSite.py site.config

参考:
http://www.owlfish.com/software/PubTal/
http://www.owlfish.com/software/PubTal/manual/index.html
http://www.owlfish.com/software/PubTal/manual/installation.html