Turn your sinatra app into a static website
= sinatra-static
export your sinatra app to a directory of static files. requires "sinatra-advanced-routes". get requests and response-status 200 only (no redirects). you also have to copy the public-dir yourself (if you're using it).
== usage
require 'sinatra_static'
builder = SinatraStatic.new(MySinatraApp) builder.build!('/Users/paul/my_static_site')
= example
this simple app:
require 'sinatra' require "sinatra/advanced_routes" require 'sinatra_static'
class MyApp::App "my homepage" ~/my_static_site/blog/index.html -> "blog index" ~/my_static_site/blog/ajax.html -> "blog index w/o layout" ~/my_static_site/blog/page1/index.html -> "blog page: page1" ~/my_static_site/blog/page2/index.html -> "blog page: page2" ~/my_static_site/blog/page3/index.html -> "blog page: page3" ~/my_static_site/dynamic.js -> "my generated javascript" ~/my_static_site/data.json -> "my generated json"
= installation
gem install sinatra-static
or in your Gemfile
gem 'sinatra-static', '>= 0.1.1'
No open issues yet, or sync has not completed.