Merge pull request #99 from jeromegn/kilt

use new Kilt >= 0.2 syntax, add mention in readme for clarity
This commit is contained in:
Serdar Dogruyol 2016-02-15 20:34:35 +02:00
commit 711eff12e9
2 changed files with 5 additions and 6 deletions

View file

@ -54,7 +54,7 @@ These results were achieved with ```wrk``` on a Macbook Pro Late 2013. (**2Ghz i
- Middlewares
- Built-in JSON support
- Built-in static file serving
- Built-in view templating via ecr
- Built-in view templating via ECR (using [Kilt](https://github.com/jeromegn/kilt))
# Documentation

View file

@ -5,17 +5,16 @@ require "kilt"
# get '/' do
# render 'hello.ecr'
# end
macro render(filename)
__view__ = String::Builder.new
Kilt.embed({{filename}}, "__view__")
__view__.to_s
end
macro render(filename, layout)
content = render {{filename}}
render {{layout}}
end
macro render(filename, *args)
Kilt.render({{filename}}, {{*args}})
end
def add_handler(handler)
Kemal.config.add_handler handler
end