Pages

Sunday, 20 October 2013

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

as3:~# gem install machined
as3:~# machined new machined-site(在当前目录下会生成machined-site目录)
as3:~# cd machined-site
as3:~/machined-site#
as3:~/machined-site# bundle install
as3:~/machined-site# ls
assets  config.ru  Gemfile  Gemfile.lock  machined.rb  pages views
as3:~/machined-site# bundle exec machined compile (在当前目录下会生成public目录,这个~/machined-site/public/就是静态网站的根目录。可绑定一个域名到该目录。              )
as3:~/machined-site# ls
assets  config.ru  Gemfile  Gemfile.lock  machined.rb  pages  public  views
as3:~/machined-site# cd pages
as3:~/machined-site/pages# ls
index.html.erb
as3:~/machined-site/pages# nano index.html.erb
(改为如下内容:
---
title: My Blog
---
<h1><%= title %></h1>
<ul>
  <li><%= link_to "First Post", "/first-post" %></li>
</ul> )


as3:~/machined-site/pages# cd ..
as3:~/machined-site# machined compile (这个就是生成静态网站的命令)
示例:http://as3.brite.biz:3415
from https://github.com/petebrowne/machined
https://github.com/petebrowne/machined/wiki/Usage
这个有些简陋。还需自己设计模板