Total Pageviews

Thursday, 5 June 2014

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

pip install embellish
git clone https://github.com/boscoh/embellish embellish-site
cd embellish-site

as3:~/embellish-site# ls
bin  embellish  examples  LICENSE  MANIFEST.in  readme.md  setup.py
as3:~/embellish-site# cd examples
as3:~/embellish-site/examples# ls
archive.mkd  index.mkd  post.haml  styles.sass
index.haml   post3.mkd  post.mkd   vampire.mkd
as3:~/embellish-site/examples# embellish -f -r . (这个就是生成/更新静态网站的命令)
显示:
INFO:embellish:>>> Scanning pages
INFO:embellish:>>> Processing template rendering
INFO:embellish:compiled .html: "index.mkd" -> "index.html"
INFO:embellish:compiled .html: "post.mkd" -> "post.html"
INFO:embellish:compiled .html: "post3.mkd" -> "post3.html"
INFO:embellish:compiled .html: "archive.mkd" -> "archive.html"
INFO:embellish:compiled .html: "vampire.mkd" -> "vampire.html"
INFO:embellish:>>> Processing media files
INFO:embellish:compiled .sass file: "styles.sass" -> "./styles.css"
INFO:embellish:>>> Caching pages
as3:~/embellish-site/examples#
as3:~/embellish-site/examples# ls
archive.html  index.html  post3.mkd  post.mkd    styles.sass
archive.mkd   index.mkd   post.haml  site.cache  vampire.html
index.haml    post3.html  post.html  styles.css  vampire.mkd
(出现了index.html,可见~/embellish-site/examples/就是静态网站的根目录)
as3:~/embellish-site/examples# nohup Rwebserver 28394 > /dev/null &
访问http://as3.brite.biz:28394/即可看到网站效果。

发贴方法:
as3:~/embellish-site/examples# nano test1.mkd
按post.mkd的格式,新建帖子test1.mkd,格式如下:
title: test1
template: post.haml
---
点击标题看全文
---

这是测试1.


然后,
as3:~/embellish-site/examples# embellish -f -r . (这个就是生成/更新静态网站的命令)
注意:此程序无pagination功能。 编辑~/embellish-site/examples/index.mkd,把max_subpages的值设大一点,比如10000.That will show you all the pages.

演示站点:http://as3.brite.biz:28394/,http://ebl.brite.biz.st
项目地址:https://github.com/boscoh/embellish
可能有乱码,浏览器的编码需设为unicode