diff options
Diffstat (limited to '')
| -rw-r--r-- | src/ext/kemal_content_for.cr | 16 | ||||
| -rw-r--r-- | src/ext/kemal_static_file_handler.cr (renamed from src/invidious/helpers/static_file_handler.cr) | 0 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/ext/kemal_content_for.cr b/src/ext/kemal_content_for.cr new file mode 100644 index 00000000..a4f3fd96 --- /dev/null +++ b/src/ext/kemal_content_for.cr @@ -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 diff --git a/src/invidious/helpers/static_file_handler.cr b/src/ext/kemal_static_file_handler.cr index 6ef2d74c..6ef2d74c 100644 --- a/src/invidious/helpers/static_file_handler.cr +++ b/src/ext/kemal_static_file_handler.cr |
