Pages

Wednesday, 23 October 2013

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

gem install serve
serve create serve-site
cd serve-site
# serve
as3:~/serve-site# bundle install
as3:~/serve-site# serve (然后就可访问http://as3.brite.biz:4000
按ctrl+c,然后:
as3:~/serve-site# nohup serve > /dev/null &
[1] 30006
as3:~/serve-site# nohup: ignoring input and redirecting stderr to stdout
as3:~/serve-site#

as3:~/serve-site# serve export ~/serve-site output
    compiled  sass files
     created  output/layouts
    compiled  output/layouts/default.html
    compiled  output/welcome.html
    compiled  output/index.html
      copied  output/.htaccess
     created  output/images
      copied  output/images/serve-logo.png
     created  output/stylesheets
      copied  output/stylesheets/screen.css
(在当前目录~/serve-site/下,会生成output目录。output目录就是静态网站的根目录)
as3:~/serve-site# ls
compass.config  Gemfile       output  README.md    tmp
config.ru       Gemfile.lock  public  stylesheets  views
as3:~/serve-site# cd output
as3:~/serve-site/output# ls
images  index.html  layouts  stylesheets  welcome.html
as3:~/serve-site/output#

demo site: http://as3.brite.biz:4000
(这也只是个初步框架,还需自己设计模板)

项目地址:https://github.com/jlong/serve