Remove all code references to Kilt

This commit is contained in:
Serdar Dogruyol 2021-09-08 16:21:25 +03:00 committed by Serdar Dogruyol - Sedo セド
parent a251ede5bd
commit 0ab0ecb7c6
1 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,3 @@
require "kilt"
CONTENT_FOR_BLOCKS = Hash(String, Tuple(String, Proc(String))).new
# `content_for` is a set of helpers that allows you to capture
@ -37,9 +35,9 @@ CONTENT_FOR_BLOCKS = Hash(String, Tuple(String, Proc(String))).new
# setting the appropriate set of tags that should be added to the layout.
macro content_for(key, file = __FILE__)
%proc = ->() {
__kilt_io__ = IO::Memory.new
__view_io__ = IO::Memory.new
{{ yield }}
__kilt_io__.to_s
__view_io__.to_s
}
CONTENT_FOR_BLOCKS[{{key}}] = Tuple.new {{file}}, %proc
@ -60,17 +58,17 @@ end
# ```
# render "src/views/index.ecr", "src/views/layout.ecr"
# ```
@[Deprecated("Use `ECR#render` instead")]
macro render(filename, layout)
__content_filename__ = {{filename}}
content = render {{filename}}
render {{layout}}
io = IO::Memory.new
content = ECR.embed {{filename}}, io
ECR.embed {{layout}}, io
io.to_s
end
# Render view with the given filename.
@[Deprecated("Use `ECR#render` instead")]
macro render(filename)
Kilt.render({{filename}})
ECR.render({{filename}})
end
# Halt execution with the current context.