Total Pageviews

Monday, 9 December 2013

on linux vps,install static blog app-tinkerer based on python

pip install tinkerer
mkdir tinkerer-site
cd tinkerer-site
tinker --setup


as3:~# mkdir tinkerer-site
as3:~# cd tinkerer-site
as3:~/tinkerer-site# tinker --setup
Your new blog is almost ready!
You just need to edit a couple of lines in conf.py
as3:~/tinkerer-site#
as3:~/tinkerer-site# ls
conf.py  drafts  index.html  master.rst  _static  _templates
(thus,we know ~/tinkerer-site is the root dir of the static site.)
as3:~/tinkerer-site# nohup Rwebserver 3417 > /dev/null &
as3:~/tinkerer-site# nano conf.py
(change the website's value from 'http://127.0.0.1/blog/html/'to
'http://urdomain.com/blog/html/')
as3:~/tinkerer-site# tinker --post 'Hello World!' (this is the command for creating a new post)
显示:
New post created as '/root/tinkerer-site/2013/12/09/hello_world_.rst'
as3:~/tinkerer-site# tinker --page 'About'
as3:~/tinkerer-site# nano /root/tinkerer-site/2013/12/09/hello_world_.rst
as3:~/tinkerer-site# tinker --build (this is the command for generating/updating static site)

demo site: http://as3.brite.biz:3417,http://tkr.brite.biz
project url: http://github.com/vladris/tinkerer
guide: http://tinkerer.me/pages/documentation.html

注意: 插入html代码的方法-
编辑这步所新建的帖子:tinker --post 'xxx' ,比如编辑sd.rst:
灵魂舞蹈
========



.. author:: default
.. categories:: none
.. tags:: none
.. comments::

.. raw:: html
   :file: sd.html


在.. comments:: 下,空一行,然后输入:
.. raw:: html
   :file: sd.html

其中sd.html为稍后要新建的文件,它对应于sd.rst,sd.html文件的内容就是你要插入的html 代码,比如:
<embed src="http://player.youku.com/player.php/sid/XMjEzODIwODY0/v.swf" quality="high" width="500" height="400" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" />

该html文件里不能放入普通的文字内容,无论中英文。
sd.html保存在跟sd.rst所在的同一个目录下。然后:
as3:~/tinkerer-site# tinker --build

参考http://docutils.sourceforge.net/docs/ref/rst/directives.html#raw-data-pass-through