Permalink
Browse files

Added config.ru and website.rb

  • Loading branch information...
1 parent 4e575a1 commit 60b8f7c04698ce152d86e4ba1933724676a27baa @benschwarz committed Apr 29, 2010
View
@@ -0,0 +1,3 @@
+require 'website'
+
+run Bonsai::Server
@@ -6,7 +6,8 @@
Bonsai has a built in web server, so you won't need to fiddle about with any other software.
Once installed typing `bonsai --help` will display a list of available options.
- > bonsai --help
+
+ $ bonsai --help
盆栽
bonsai, tiny and beautiful
@@ -18,7 +18,7 @@
:body: |
A bonsai is very difficult care for...
You will need to obtain the agilty of
- a cat and the mind strenth of a bear
+ a cat and the strength of a bear
:skills:
-
View
@@ -47,7 +47,7 @@ body {
}
section#wrapper {
margin: 0 auto;
- width: 700px;
+ width: 580px;
}
header { margin-top: 5em; }
header span { display: block; }
@@ -133,6 +133,7 @@ section#content pre {
background-color: #eeeeee;
padding: 1em;
width: 100%;
+ overflow: hidden;
}
section#content p > code {
background-color: #eeeeee;
@@ -68,7 +68,7 @@ section#content {
h4 { font-size: 1.2em; margin: 2em 0 1em 0; .small-caps; font-style: italic; }
p { font-size: 0.9em; line-height: 1.5em; margin-bottom: 1em; }
- pre { background-color: #eee; padding: 1em; width: 100%; }
+ pre { background-color: #eee; padding: 1em; width: 100%; overflow: hidden; }
p>code { background-color: #eee; padding: 0.25 0.5; }
a { color: inherit; .small-caps; }
}
@@ -4,7 +4,7 @@
<meta name="keywords" content="ruby, static, website, web, site, generator, portfolio, free, open source, oss, simple, elegant, software, cms, content management, humane, flexible, easy-to-use, dynamic">
<meta name="description" content="Build sites that run anywhere">
<meta name="google-site-verification" content="dUUTNejHlDOk3LhVnN58eNChhRdfLbCgskXT2ICnvzY">
- <meta content="width=600" name="viewport">
+ <meta content="width=615" name="viewport">
<link rel="stylesheet" href="/docs/css/base.css" type="text/css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
View
@@ -0,0 +1,30 @@
+require 'sinatra'
+require 'bonsai'
+
+Bonsai.root_dir = Dir.pwd
+
+module Bonsai
+ class Server < Sinatra::Base
+ enable :static
+ disable :logging
+ set :public, File.join(File.dirname(__FILE__), "output")
+
+ get '/' do
+ begin
+ Page.find("index").render
+ rescue Exception => e
+ @error = e
+ erb :error
+ end
+ end
+
+ get '/*' do
+ begin
+ Page.find(params[:splat].join).render
+ rescue Exception => e
+ @error = e
+ erb :error
+ end
+ end
+ end
+end

0 comments on commit 60b8f7c

Please sign in to comment.