Total Pageviews

Sunday 2 October 2016

搭建基于nodejs和gulp的静态博客程序silent

cd /usr/local
git clone https://github.com/fritx/silent
cd silent

root@AR:/usr/local/silent# ls
blog  CHANGELOG.md  gulpfile.js  package.json  pic  README.md

root@AR:/usr/local/silent# npm install (会在当前目录下,生成node_modules目录)
root@AR:/usr/local/silent# npm install -g gulp
root@AR:/usr/local/silent# ls
blog  CHANGELOG.md  gulpfile.js  node_modules  package.json  pic  README.md
root@AR:/usr/local/silent# find . -name index.html
./blog/index.html
./node_modules/doctrine/coverage/lcov-report/index.html
./node_modules/cli-width/coverage/lcov-report/index.html
./node_modules/cli-width/coverage/lcov-report/cli-width/index.html
root@AR:/usr/local/silent# 
(可见/usr/local/silent/blog/就是静态网站的根目录。它是原来就存在的。你可绑定你的域名到此目录)
root@AR:/usr/local/silent# cd node_modules/.bin/
root@AR:/usr/local/silent/node_modules/.bin# ls
dateformat  esparse gulp mkdirp  strip-indent       user-home
eslint     esvalidate js-yaml  semver  strip-json-comments  which
root@AR:/usr/local/silent/node_modules/.bin# cd /usr/local/silent
root@AR:/usr/local/silent# ./node_modules/.bin/gulp

新建源贴:
root@AR:/usr/local/silent# ls
blog  CHANGELOG.md  gulpfile.js  node_modules  package.json  pic  README.md
root@AR:/usr/local/silent# cd blog
root@AR:/usr/local/silent/blog# ls
favicon.ico  index.html  p  vendor
root@AR:/usr/local/silent/blog# cd p
root@AR:/usr/local/silent/blog/p# ls
aboutme.md  avatar.jpg projects  sidebar.md
root@AR:/usr/local/silent/blog/p# cd projects
root@AR:/usr/local/silent/blog/p/projects# ls
great.md  kid.js.md  
index.md  silent
root@AR:/usr/local/silent/blog/p/projects# nano test-1.md
root@AR:/usr/local/silent/blog/p/projects# cat test-1.md
# 测试

这是测试1.
root@AR:/usr/local/silent/blog/p/projects# nano index.md
(在下面这一段
## [silent](silent/index.md)

> Be a silent, static blog
的上方,空一行,加上:
## [测试1](test-1.md)

> 点击标题,看全文

保存文件。
以后,每新建一个源贴,都要修改index.md,在index.md文件的最上方,加上:
## [这是测试](this-is-test.md)

> 点击标题,看全文

保存文件。刷新一下绑定的域名网址,网站就更新了。不过这种每次都要修改index.md的搞法,网站是不可能分页的。

演示网站:http://sl.bright.biz.st/
项目地址:https://github.com/fritx/silent
----------

他人的克隆版:
https://github.com/Jayin/jayin.github.io/tree/master/blog/p/,
其演示网站:http://jayinton.com/