Created
January 16, 2011 15:14
-
-
Save deplorableword/781871 to your computer and use it in GitHub Desktop.
How to run a Jeykll site on Heroku with Sinatra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'devart' | |
| run Sinatra::Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'sinatra' | |
| set :public, Proc.new { File.join(root, "_site") } | |
| # Added headers for Varnish | |
| before do | |
| response.headers['Cache-Control'] = 'public, max-age=36000' | |
| end | |
| get '/*' do | |
| File.read("_site/#{params[:title]}/index.html") | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment