Pages

Friday, 18 October 2013

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

# git clone git://github.com/EnigmaCurry/blogofile.git
git clone git://github.com/EnigmaCurry/blogofile_blog.git
cd blogofile
python setup.py install
cd ../blogofile_blog
python setup.py install
# cd ~
# blogofile init blogofile-site blog
# blogofile build -s blogofile-site (此即为生成静态网站的命令,每次新建帖子后,都必须运行该命令。在~/blogofile-site/里面就会生成_site目录,这个
_site目录即为静态网站的根目录。你可绑定一个域名到该目录。演示:http://as3.brite.biz:2299, http://bf.brite.biz          )


as3:~# blogofile init blogofile-site blog
blog plugin site_src files written to blogofile-site
as3:~# ls blogofile-site
404.html     crossdomain.xml  _htaccess        js          _templates
_config.py   css              img              _posts      themes
_config.pyc  favicon.ico      index.html.mako  robots.txt
as3:~# blogofile build -s blogofile-site
as3:~# ls blogofile-site
404.html     crossdomain.xml  _htaccess        js          _site
_config.py   css              img              _posts      _templates
_config.pyc  favicon.ico      index.html.mako  robots.txt  themes
as3:~#
as3:~# cd ~/blogofile-site/_site
as3:~/blogofile-site/_site# ls
404.html  crossdomain.xml  favicon.ico  index.html  robots.txt
blog      css              img          js          themes
as3:~/blogofile-site/_site#
as3:~/blogofile-site# cd _posts
as3:~/blogofile-site/_posts# ls
000 - filler1.markdown  002 - post 2.markdown
000 - filler2.markdown  003 - unpublished draft.markdown
000 - filler3.markdown  007 - unicode test.markdown
000 - filler4.markdown  008 - post 8 - syntax highlight.markdown
001 - post 1.markdown

依据上面的markdown文件的格式依样画葫芦,新建帖子:take-a-test.md,内容如下:
---
title: take a test (标题建议用英文)
date: 2013/10/18 17:20:00 (日期必须是此格式,几时:几分:几秒部分不可省略)
categories: misc
---
这是一次测试


保存更改。然后:
as3:~/blogofile-site/_posts# cd ~
as3:~# blogofile build -s blogofile-site

参考: http://docs.blogofile.com/en/latest/quick_setup.html
http://docs.blogofile.com/en/latest/