You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
354 B
Crystal
17 lines
354 B
Crystal
3 years ago
|
# Overrides for Kemal's `content_for` macro in order to keep using
|
||
|
# kilt as it was before Kemal v1.1.1 (Kemal PR #618).
|
||
|
|
||
|
require "kemal"
|
||
|
require "kilt"
|
||
|
|
||
|
macro content_for(key, file = __FILE__)
|
||
|
%proc = ->() {
|
||
|
__kilt_io__ = IO::Memory.new
|
||
|
{{ yield }}
|
||
|
__kilt_io__.to_s
|
||
|
}
|
||
|
|
||
|
CONTENT_FOR_BLOCKS[{{key}}] = Tuple.new {{file}}, %proc
|
||
|
nil
|
||
|
end
|