Merge pull request #99 from jeromegn/kilt
use new Kilt >= 0.2 syntax, add mention in readme for clarity
This commit is contained in:
commit
711eff12e9
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
|
- Middlewares
|
||||||
- Built-in JSON support
|
- Built-in JSON support
|
||||||
- Built-in static file serving
|
- 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
|
# Documentation
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,16 @@ require "kilt"
|
||||||
# get '/' do
|
# get '/' do
|
||||||
# render 'hello.ecr'
|
# render 'hello.ecr'
|
||||||
# end
|
# end
|
||||||
macro render(filename)
|
|
||||||
__view__ = String::Builder.new
|
|
||||||
Kilt.embed({{filename}}, "__view__")
|
|
||||||
__view__.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
macro render(filename, layout)
|
macro render(filename, layout)
|
||||||
content = render {{filename}}
|
content = render {{filename}}
|
||||||
render {{layout}}
|
render {{layout}}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
macro render(filename, *args)
|
||||||
|
Kilt.render({{filename}}, {{*args}})
|
||||||
|
end
|
||||||
|
|
||||||
def add_handler(handler)
|
def add_handler(handler)
|
||||||
Kemal.config.add_handler handler
|
Kemal.config.add_handler handler
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue