-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathliteroflight.rb
49 lines (39 loc) · 1.23 KB
/
literoflight.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# literoflight.rb
require 'sinatra'
require 'haml'
require 'kramdown'
# configure
set :haml, :format => :html5, :layout => true, :escape_html => false
# n.b. :layout => true renders haml docs through layout.haml if it exists
# and can be redirected to another symbol for a different layout
# or "false" for none
# set up basic caching
#set :static_cache_control, [:public, :max_age => 300]
#before do
# cache_control :public, :must_revalidate, :max_age => 300
#end
get '/' do
haml :main, :escape_html => false, :locals => { :text => markdown(:main), :title => "" }
end
get '/why' do
haml :why, :locals => { :title => "why | " }
end
get '/gallery' do
haml :gallery, :locals => { :title => "on location | "}
end
get '/colophon' do
haml :colophon, :locals => { :title => "colophon | " }
end
get '/about' do
haml :about, :escape_html => false, :locals => { :title => "about | " }
end
# get '/bootstrap' do
# haml :bootstrap, :layout => :layout_bootstrap
# end
# get '/s3/*' do
# redirect 'https://(target server)/s3/' + params[:splat][0]
# end
# Redirect shared images to S3. Voila! Better clientside caching. Otherwise would choke on domain change.
# get '/images/:image' do |image|
# redirect '/s3/images/' + image
# end