mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-01 12:44:39 -04:00
Keep using kilt for rendering
Directly using Crystal's ECR seems to be causing issues, so don't use kemal's 'render' macro and patch 'content_for' to have the same behavior as before Kemal v1.1.1
This commit is contained in:
parent
84b6429ca6
commit
1f66d7ef74
5 changed files with 37 additions and 3 deletions
16
src/ext/kemal_content_for.cr
Normal file
16
src/ext/kemal_content_for.cr
Normal file
|
@ -0,0 +1,16 @@
|
|||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue