Skip to content

Instantly share code, notes, and snippets.

@swanson
Created February 1, 2011 01:48
Show Gist options
  • Select an option

  • Save swanson/805258 to your computer and use it in GitHub Desktop.

Select an option

Save swanson/805258 to your computer and use it in GitHub Desktop.
Deploying Sintra+Jekyll to Heroku using Rack
pygments: true
source: ./_posts
destination: ./blog
require 'myapp'
#Rack will serve URLs starting with blog from /blog
use Rack::Static, :urls => ["/blog"]
#Anything else falls through to Sinatra app
run MyApp
--LOCAL--
#Renders static pages in /_posts and throws them in /blog
$ jekyll
$ rackup config.ru -p 4567
--PROD--
#Need a git hook to run jekyll and git add/commit /blog before push...
$ git push heroku master
require 'sinatra/base'
require 'erb'
class MyApp < Sinatra::Base
set :static, true
set :public, 'public'
get '/' do
erb :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment