mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	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 | ||||
| - 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue