Pages

Sunday, 22 December 2013

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

npm install -g marlboro
mkdir marlboro-site
cd marlboro-site
marlboro (此命令会在当前目录下生成博客的目录结构)
cd content
mkdir test
cd test
nano test1.md
格式为:
======
title: test1
date: 1970-01-01
tags: blog, test, misc
======

这是测试1.

(文章里好像不能嵌入html code)
as3:~/marlboro-site/content/test# cd ~/marlboro-site
as3:~/marlboro-site# marlboro
as3:~/marlboro-site# ls
config.json  content  deploy
as3:~/marlboro-site# nano config.json
as3:~/marlboro-site# cat config.json
{
  "app_config": {
    "config_file": "config.json",
    "content_path": "./content",
    "deploy_path": "./deploy",
    "theme": "default"
  },

  "site_config": {
    "site_name": "ym's marlboro site",
    "site_url": "http://marlboro.brite.biz/", (这里设为你自己的域名地址.需加上斜杠
    "author": "ym"
  }
}
as3:~/marlboro-site#
as3:~/marlboro-site# cd deploy
as3:~/marlboro-site/deploy# ls
index.html  static  tags  test
as3:~/marlboro-site/deploy#
可见~/marlboro-site/deploy/就是静态网站的根目录,绑定你的域名(我的为marlboro.brite.biz)到该目录。

demo site: http://marlboro.brite.biz

项目地址:https://github.com/ibigbug/marlboro
https://github.com/luckypoem/marlboro