Total Pageviews

Tuesday, 4 February 2014

在linux vps上搭建基于python的静态博客程序-engineer(这个不错)

pip install engineer
mkdir engineer-site
cd engineer-site
engineer init (此命令对当前目录engineer-site进行初始化,生成程序的初始目录结构,即在当前目录engineer-site里生成一些东西)

as3:~/engineer-site# ls
archives  config.yaml  logs    templates
debug.yaml   oleb.yaml  posts
as3:~/engineer-site# nano config.yaml
把config.yaml文件中的此行POST_TIMEZONE: 'America/Los_Angeles'注释掉。
as3:~/engineer-site# engineer build (这个就是生成静态网站的命令,会在当前目录下生成output目录)
as3:~/engineer-site# ls
archives  config.yaml  logs       output  templates
_cache    debug.yaml   oleb.yaml  posts
as3:~/engineer-site#
(新出现了output目录)
as3:~/engineer-site# cd output
as3:~/engineer-site/output# ls
2011  about     feeds       page            static  themes
2012  archives  index.html  sitemap.xml.gz  tag
as3:~/engineer-site/output#
(可见~/engineer-site/output/就是静态网站的根目录)
as3:~/engineer-site/output# nohup Rwebserver 32850 > /dev/null &
访问http://as3.brite.biz:32850/就可看到网站效果。


发贴方法:
as3:~/engineer-site/output# cd ../posts
as3:~/engineer-site/posts# nano 2014-02-05-test2.md
格式如下:
title: 测试2
status: draft
slug: test2
url: /2014/02/05/test2/

---

这是测试2.


然后,
as3:~/engineer-site/posts# cd ..
as3:~/engineer-site# engineer build (这个就是生成/更新静态网站的命令)

演示站点:http://as3.brite.biz:32850/,http://egn.brite.biz.st
项目地址:https://github.com/tylerbutler/engineer
使用指南:http://engineer.readthedocs.org/en/latest/
http://engineer.readthedocs.org/en/latest/bundled_plugins.html#post-breaks-excerpts-teasers
支持插入<!--more-->到文章中,以生成文章的摘要。