Total Pageviews

Monday 30 June 2014

在linux vps上搭建基于lein/clojure的静态博客程序-incise

git clone https://github.com/RyanMcG/ryanmcg.github.io ryanmcg.github.io-site
cd ryanmcg.github.io-site

root@as3:~/ryanmcg.github.io-site# ls
project.clj  README.md  resources  src 
root@as3:~/ryanmcg.github.io-site# cd resources
root@as3:~/ryanmcg.github.io-site/resources# ls
assets  content  incise.edn  public
root@as3:~/ryanmcg.github.io-site/resources# cd assets
root@as3:~/ryanmcg.github.io-site/resources/assets# ls
stylesheets  vm
root@as3:~/ryanmcg.github.io-site/resources/assets# git clone https://github.com/RyanMcG/vm-assets vm
root@as3:~/ryanmcg.github.io-site/resources/assets# cd ../..
root@as3:~/ryanmcg.github.io-site# nohup lein incise > /dev/null &
访问http://as3.brite.biz:5000/即可看到网站效果。

发贴方法:
root@as3:~/ryanmcg.github.io-site#
root@as3:~/ryanmcg.github.io-site# cd resources
root@as3:~/ryanmcg.github.io-site/resources# ls
assets  content  incise.edn 
root@as3:~/ryanmcg.github.io-site/resources# cd content
root@as3:~/ryanmcg.github.io-site/resources/content# ls
assets  attributions.md  bio.md  CNAME  index.clj  posts  reading.md
root@as3:~/ryanmcg.github.io-site/resources/content# cd posts
root@as3:~/ryanmcg.github.io-site/resources/content/posts# ls
2013  2014
root@as3:~/ryanmcg.github.io-site/resources/content/posts# cd 2014
root@as3:~/ryanmcg.github.io-site/resources/content/posts/2014# ls
incise.md  manners.md   
root@as3:~/ryanmcg.github.io-site/resources/content/posts/2014# nano test1.md
格式为:
{:title "test1"
 :date "2014-7-1"
 :category :misc
 :publish true
 :tags [:code :clojure :incise :projects]}

## 测试1

这是测试1.

(不要用中文标题,否则易出问题)

root@as3:~/ryanmcg.github.io-site/resources/content/posts/2014# cd ~/ryanmcg.github.io-site
root@as3:~/ryanmcg.github.io-site# lein incise -m once (这个就是生成/更新静态网站的命令)
root@as3:~/ryanmcg.github.io-site# cd resources
root@as3:~/ryanmcg.github.io-site/resources# ls
assets  content  incise.edn  public
(新出现了public目录)
root@as3:~/ryanmcg.github.io-site/resources# cd public
root@as3:~/ryanmcg.github.io-site/resources/public# ls
2013  assets        bio    index.html     reading
2014  attributions  CNAME  manifest.json
root@as3:~/ryanmcg.github.io-site/resources/public#
(可见~/ryanmcg.github.io-site/resources/public/就是静态网站的根目录)
root@as3:~/ryanmcg.github.io-site/resources/public# nohup Rwebserver 25410 > /dev/null &
访问http://as3.brite.biz:25410/即可看到网站效果。

在访问http://as3.brite.biz:25410/2014/1/13/static-website-generation-with-incise/和
http://as3.brite.biz:25410/2013/12/13/swap-numbers-plugin-for-vim/时,可能显示not found.那么访问http://as3.brite.biz:25410/2014/1/13/static-website-generation-with-incise/index.html 和http://as3.brite.biz:25410/2013/12/13/swap-numbers-plugin-for-vim/index.html即可打开之。以后再访问它们时,就不用再加上index.html即可打开。

演示站点:http://as3.brite.biz:25410/,http://as3.brite.biz:5000/,http://incise.brite.biz.st
http://www.ryanmcg.com/ (程序作者用此程序搭建的网站)
项目地址:https://github.com/RyanMcG/ryanmcg.github.io
https://github.com/RyanMcG/vm-assets
https://github.com/RyanMcG/incise
官方教程:http://www.ryanmcg.com/incise/

相关帖子:http://briteming.blogspot.co.uk/2014/06/linux-vpsstasisblog-genaugustl.html
http://briteming.blogspot.co.uk/2014/06/linux-vpsleinmadness.html