Skip to content

Instantly share code, notes, and snippets.

@airhorns
Created December 20, 2010 18:31
Show Gist options
  • Select an option

  • Save airhorns/748777 to your computer and use it in GitHub Desktop.

Select an option

Save airhorns/748777 to your computer and use it in GitHub Desktop.
toto = Toto::Server.new do
# ...
set :to_html, lambda {|path, page, ctx, blk|
Dir.glob("#{path}/#{page}.*").each do |filename|
return ::Tilt.new(filename).render(ctx, &blk)
end
raise Errno::ENOENT # Tell toto to 404 if no files can be found
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment