首先安装nodejs环境。
cd /usr/local
git clone https://github.com/punkave/habit habit-site
cd habit-site
root@AR:/usr/local/habit-site# ls
app.js bin package.json README.md test
root@AR:/usr/local/habit-site# npm install
root@AR:/usr/local/habit-site# cd test
root@AR:/usr/local/habit-site/test#
root@AR:/usr/local/habit-site/test# ls
advanced index.md
basics _layouts stylesheets
root@AR:/usr/local/habit-site/test# node ../app.js
root@AR:/usr/local/habit-site/test# ls
advanced index.md _site
basics _layouts stylesheets
(生成了_site目录)
root@AR:/usr/local/habit-site/test# cd _site
root@AR:/usr/local/habit-site/test/_site#
root@AR:/usr/local/habit-site/test/_site# ls
advanced index.html
basics stylesheets
root@AR:/usr/local/habit-site/test/_site#
(可见/usr/local/habit-site/test/_site就是静态网站的根目录)
新建源帖:
root@AR:/usr/local/habit-site/test/_site# cd ..
root@AR:/usr/local/habit-site/test# ls
advanced index.md _site
basics _layouts stylesheets
root@AR:/usr/local/habit-site/test# mkdir test-1
root@AR:/usr/local/habit-site/test# cd test-1
root@AR:/usr/local/habit-site/test/test-1# nano index.md
root@AR:/usr/local/habit-site/test/test-1# cat index.md
---
title: 测试1
---
这是测试1.
看看如何?
root@AR:/usr/local/habit-site/test/test-1# cd ..
root@AR:/usr/local/habit-site/test# nano index.md
root@AR:/usr/local/habit-site/test# cat index.md
---
layout: alternate
title: "Welcome"
children:
- test-1
- basics
- advanced
---
点击上面的各个标题,看全文
root@AR:/usr/local/habit-site/test#
(在每新建一个目录,比如test-1之后,就需要修改/usr/local/habit-site/test/index.md文件,
在- basics的上一行加上- test-1)
root@AR:/usr/local/habit-site/test# node ../app.js
演示网站:http://habit.bright.biz.st
项目地址:https://github.com/punkave/habit
cd /usr/local
git clone https://github.com/punkave/habit habit-site
cd habit-site
root@AR:/usr/local/habit-site# ls
app.js bin package.json README.md test
root@AR:/usr/local/habit-site# npm install
root@AR:/usr/local/habit-site# cd test
root@AR:/usr/local/habit-site/test#
root@AR:/usr/local/habit-site/test# ls
advanced index.md
basics _layouts stylesheets
root@AR:/usr/local/habit-site/test# node ../app.js
root@AR:/usr/local/habit-site/test# ls
advanced index.md _site
basics _layouts stylesheets
(生成了_site目录)
root@AR:/usr/local/habit-site/test# cd _site
root@AR:/usr/local/habit-site/test/_site#
root@AR:/usr/local/habit-site/test/_site# ls
advanced index.html
basics stylesheets
root@AR:/usr/local/habit-site/test/_site#
(可见/usr/local/habit-site/test/_site就是静态网站的根目录)
新建源帖:
root@AR:/usr/local/habit-site/test/_site# cd ..
root@AR:/usr/local/habit-site/test# ls
advanced index.md _site
basics _layouts stylesheets
root@AR:/usr/local/habit-site/test# mkdir test-1
root@AR:/usr/local/habit-site/test# cd test-1
root@AR:/usr/local/habit-site/test/test-1# nano index.md
root@AR:/usr/local/habit-site/test/test-1# cat index.md
---
title: 测试1
---
这是测试1.
看看如何?
root@AR:/usr/local/habit-site/test/test-1# cd ..
root@AR:/usr/local/habit-site/test# nano index.md
root@AR:/usr/local/habit-site/test# cat index.md
---
layout: alternate
title: "Welcome"
children:
- test-1
- basics
- advanced
---
点击上面的各个标题,看全文
root@AR:/usr/local/habit-site/test#
(在每新建一个目录,比如test-1之后,就需要修改/usr/local/habit-site/test/index.md文件,
在- basics的上一行加上- test-1)
root@AR:/usr/local/habit-site/test# node ../app.js
演示网站:http://habit.bright.biz.st
项目地址:https://github.com/punkave/habit