Total Pageviews

Wednesday 20 November 2013

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


git clone https://github.com/piranha/cyrax.git
cd cyrax
python setup.py install

cd content
as3:~/cyrax/content# ls
~           index.html    somepage.html  year_archive.html
2009        _empty.html  _post.html    static
_base.html  feed.atom    settings.cfg  _taglist.html
as3:~/cyrax/content# cyrax --webserve --port=6730 &
这样,在~/cyrax/content/下就会生成_build目录。
as3:~/cyrax/content# cd _build
as3:~/cyrax/content/_build# ls
cyrax
as3:~/cyrax/content/_build# cd cyrax
as3:~/cyrax/content/_build/cyrax# ls
~  2009  feed.atom  index.html  somepage  static  tag  year_archive
as3:~/cyrax/content/_build/cyrax#
可见~/cyrax/content/_build/cyrax/就是静态网站的根目录。
演示站点:http://cr.brite.biz/
http://cr.brite.biz/2009/03/12/just-test/
http://cr.brite.biz/2009/04/01/extensible-types/
http://cr.brite.biz/2009/08/25/test1/
 http://cr.brite.biz/2013/11/21/test2/
http://cr.brite.biz/2013/11/21/chinese-economy/

发贴方法:
as3:~/cyrax/content# cd 2009
as3:~/cyrax/content/2009# ls
03-12-just-test.html  03-13-making-cyrax.html  04-01-extensible-types.html
按03-12-just-test.html的格式,新建帖子08-25-test1.html,格式如下:
{% meta %}
  title: test1
{% endmeta %}

{% mark body %}
{% filter markdown %}
这是测试1.
{% endfilter %}{% endmark %}

然后:
as3:~/cyrax/content/2009# cd ..
as3:~/cyrax/content# killall cyrax
as3:~/cyrax/content# cyrax --webserve --port=6730 & (重新启动预览服务器,这样,网站就得以更新)

http://cr.brite.biz里面的链接还需设置一下。
项目地址:https://github.com/piranha/cyrax