Pages

Tuesday, 27 May 2014

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

npm install -g techy
(techy的执行文件会被安装在此:/root/npm/bin/techy)
git clone https://github.com/krasimir/techy-simple-blog
cd techy-simple-blog

as3:~/techy-simple-blog# ls
all.html index.md  LICENSE   README.html  themes
all.md   partials  README.md public      
articles  index.html  lib    tags     
as3:~/techy-simple-blog# cd articles
as3:~/techy-simple-blog/articles# nano test1.md
格式为:
---
date: 27-05-2014 13:30
title: test1
preface: 这是测试1.
tags:
  - misc1
  - misc2
---

# 测试1

这是测试1. 看看如何呢?

然后,
as3:~/techy-simple-blog/articles# cd ..
as3:~/techy-simple-blog# /root/npm/bin/techy (这个就是生成/更新静态网站的命令)
会显示:
+ CSS compiled
+ JavaScript compiled
+ Pages compiled
Techy is listening for changes!
按ctrl+c退出控制台。
as3:~/techy-simple-blog# ls
all.html  _css        index.md  LICENSE   README.html  themes
all.md    dist        _js       partials  README.md    _tpl
articles  index.html  lib       public    tags
(新出现了好些东西,其中有dist目录)
as3:~/techy-simple-blog# cd dist
as3:~/techy-simple-blog/dist# ls
all.html  index.html  partials  README.html  themes
articles  lib         public    tags
(可见~/techy-simple-blog/dist/就是静态网站的根目录)
as3:~/techy-simple-blog/dist# nohup Rwebserver 42951 > /dev/null &
访问http://as3.brite.biz:42951/,http://as3.brite.biz:42951/all.html即可看到网站效果。

as3:~/techy-simple-blog/dist# cd ../articles
as3:~/techy-simple-blog/articles# ls
A.html  chinese-economy.md  D.md    F.md    H.md    J.md              test1.md
A.md    C.html              E.html  G.html  I.html  K.html            test2.md
B.html  C.md                E.md    G.md    I.md    K.md
B.md    D.html              F.html  H.html  J.html  mother-s-kiss.md
as3:~/techy-simple-blog/articles# rm A.html A.md B.html B.md C.html C.md D.html  D.md

E.html E.md F.html F.md G.html G.md  H.html H.md  I.html I.md J.html  J.md K.html

K.md
as3:~/techy-simple-blog/articles# ls
chinese-economy.md  mother-s-kiss.md  test1.md  test2.md
as3:~/techy-simple-blog/articles# cd ..
as3:~/techy-simple-blog# /root/npm/bin/techy (这个就是生成/更新静态网站的命令)
按ctrl+c退出控制台。

as3:~/techy-simple-blog/dist# ls
all.html  index.html  partials  README.html  themes
articles  lib         public    tags
as3:~/techy-simple-blog/dist#
as3:~/techy-simple-blog/dist# mv index.html index.html.old
as3:~/techy-simple-blog/dist# ls
all.html  index.html.old  partials  README.html  themes
articles  lib             public    tags
as3:~/techy-simple-blog/dist# mv all.html index.html
as3:~/techy-simple-blog/dist# ls
articles    index.html.old  partials  README.html  themes
index.html  lib             public    tags
as3:~/techy-simple-blog/dist#


演示站点:http://as3.brite.biz:42951/,
http://techy.brite.biz.st,
项目地址:https://github.com/krasimir/techy,http://krasimir.github.io/techy/
https://github.com/krasimir/techy-simple-blog
https://github.com/zalun/zalun.github.io (某人的fork)
可惜不能分页!