use new Kilt 0.3 syntax, add mention in readme for clarity
This commit is contained in:
parent
d6c9684d5e
commit
69b836a98a
2 changed files with 5 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue