Total Pageviews

Saturday, 12 October 2013

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

# npm install wintersmith -g
# wintersmith new wintersmith-site
# cd  wintersmith-site
# wintersmith build (这个就是生成静态网站的命令。该命令在当前目录下,会生成build目录,这个build目录就是网站的根目录,你可绑定一个域名到该目录。)

发帖子的方法:
as3:~/wintersmith-site# cd contents
as3:~/wintersmith-site/contents# ls
about.md  archive.json  articles  authors  css  feed.json
as3:~/wintersmith-site/contents# cd articles
as3:~/wintersmith-site/contents/articles# ls
another-test   hello-world         markdown-syntax
bamboo-cutter  let-me-have-a-test  red-herring
as3:~/wintersmith-site/contents/articles# mkdir test2 (在
~/wintersmith-site/contents/articles/下面新建一个以标题名为名称的目录。)
as3:~/wintersmith-site/contents/articles# cd test2 (进入新建的目录)
as3:~/wintersmith-site/contents/articles/test2# nano index.md (在这个新建的目录里创建index.md文件,index.md的格式如下:

---
title: title name
date: 2013-10-13
template: article.jade
---
这里写正文。 然后
as3:~/wintersmith-site/contents/articles/test2# cd ~/wintersmith-site
as3:~/wintersmith-site# wintersmith build (每次新建帖子后,都要运行一次这条

生成静态网站的命令
。)

示例: http://as3.brite.biz:1133/ ,http://ws.brite.biz
项目地址: https://github.com/jnordberg/wintersmith
(https://github.com/davidtucker/davidtucker-blog,某人的修改版。其示例:
http://davidtucker.net/) 
官网:http://wintersmith.io/