0

I want to do essentially the same thing: How do I automatically generate static HTML from HAML with Sinatra or Padrino?

This answer didn't quite go far enough for me. After I have caching setup, how would I send a particular haml file to the client?

E.g.

get '/foo', :cache => true do
    expires 30
    haml '/templates/foo.haml'
end
Community
  • 1
  • 1
ironicaldiction
  • 1,200
  • 4
  • 12
  • 27

1 Answers1

0

If you want to serve any file in templates you could do something like:

get '/*', :cache => true do |name|
    expires 30
    haml "/templates/#{name}.haml"
end

and they will all be cached.

froderik
  • 4,642
  • 3
  • 33
  • 43