Total Pageviews

Saturday, 1 February 2014

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

git clone https://github.com/aromanovich/carcade
cd carcade
pip install nose
pip install coverage
python setup.py install

as3:~/carcade# ls
build    Carcade.egg-info  docs     MANIFEST.in  requirements-dev.txt  tests
carcade  dist              LICENSE  README.rst   setup.py              test.sh
as3:~/carcade# git clone https://github.com/aromanovich/carcade-examples
as3:~/carcade# cd carcade-examples
as3:~/carcade/carcade-examples# ls
README.md  simple-blog
as3:~/carcade/carcade-examples# cd simple-blog
as3:~/carcade/carcade-examples/simple-blog# ls
layouts  pages  settings.py  static  translations
as3:~/carcade/carcade-examples/simple-blog# carcade build
(carcade build就是生成/更新静态网站的命令)
Build...
Done.
as3:~/carcade/carcade-examples/simple-blog# ls
layouts  pages  settings.py  settings.pyc  static  translations  www
(新出现了www目录)
as3:~/carcade/carcade-examples/simple-blog# ls www
css  four  gen  img  index.html  less  ru  three  two
as3:~/carcade/carcade-examples/simple-blog# cd www
as3:~/carcade/carcade-examples/simple-blog/www# ls
css  four  gen  img  index.html  less  ru  three  two
as3:~/carcade/carcade-examples/simple-blog/www# nohup Rwebserver 47283 > /dev/null &
(可见~/carcade/carcade-examples/simple-blog/www/就是静态网站的根目录。)
访问http://as3.brite.biz:47283/就可看到网站效果。

发贴方法:
as3:~/carcade/carcade-examples/simple-blog/www# cd ..
as3:~/carcade/carcade-examples/simple-blog# ls
layouts  pages  settings.py  settings.pyc  static  translations  www
as3:~/carcade/carcade-examples/simple-blog# ls pages
four  one  three  two
as3:~/carcade/carcade-examples/simple-blog# cd pages/two
as3:~/carcade/carcade-examples/simple-blog/pages/two# ls
a  b  c  content.md  d  e  f  g
as3:~/carcade/carcade-examples/simple-blog/pages/two# cat content.md
as3:~/carcade/carcade-examples/simple-blog/pages/two# cd a
as3:~/carcade/carcade-examples/simple-blog/pages/two/a# ls
content.en.md  content.ru.md  data.yaml
as3:~/carcade/carcade-examples/simple-blog/pages/two/a# cat content.en.md
Page A
as3:~/carcade/carcade-examples/simple-blog/pages/two/a# cat data.yaml
datetime: 2013-01-11 2:59:43
as3:~/carcade/carcade-examples/simple-blog/pages/two/a# mkdir ~/carcade/carcade-examples/simple-blog/pages/two/h
as3:~/carcade/carcade-examples/simple-blog/pages/two/a# cd ~/carcade/carcade-examples/simple-blog/pages/two/h
as3:~/carcade/carcade-examples/simple-blog/pages/two/h# ls
as3:~/carcade/carcade-examples/simple-blog/pages/two/h# nano content.en.md
格式为:
## 测试1

这是测试1.
as3:~/carcade/carcade-examples/simple-blog/pages/two/h# nano data.yaml
格式为:
datetime: 2014-02-01 16:29:43
as3:~/carcade/carcade-examples/simple-blog/pages/two/h# ls
content.en.md  data.yaml
as3:~/carcade/carcade-examples/simple-blog/pages/two/h# cd ~/carcade/carcade-examples/simple-blog/
as3:~/carcade/carcade-examples/simple-blog# carcade build
Build...
Done.
as3:~/carcade/carcade-examples/simple-blog#

这里http://as3.brite.biz:47283/two/h/
http://as3.brite.biz:47283/two/test2/
http://as3.brite.biz:47283/two/fengyuwuzu/
http://as3.brite.biz:47283/two/chinese-economy/
就是新发的帖子。

demo site: http://as3.brite.biz:47283
http://cc.brite.biz,
项目地址: https://github.com/aromanovich/carcade