Invidious is an alternative front-end to YouTube
Update Kemal to 1.6.0 and remove Kilt
syeopite05c5448bc137
diff --git a/shard.lock b/shard.lockindex a097b081..1265eda6 100644--- a/shard.lock+++ b/shard.lock@@ -18,7 +18,7 @@ shards:exception_page:git: https://github.com/crystal-loot/exception_page.git- version: 0.2.2+ version: 0.4.1http_proxy:git: https://github.com/mamantoha/http_proxy.git@@ -26,11 +26,7 @@ shards:kemal:git: https://github.com/kemalcr/kemal.git- version: 1.1.2-- kilt:- git: https://github.com/jeromegn/kilt.git- version: 0.6.1+ version: 1.6.0pg:git: https://github.com/will/crystal-pg.gitdiff --git a/shard.yml b/shard.ymlindex af7e4186..154e44fc 100644--- a/shard.yml+++ b/shard.yml@@ -17,10 +17,7 @@ dependencies:version: ~> 0.21.0kemal:github: kemalcr/kemal- version: ~> 1.1.2- kilt:- github: jeromegn/kilt- version: ~> 0.6.1+ version: ~> 1.6.0protodec:github: iv-org/protodecversion: ~> 0.1.5diff --git a/src/ext/kemal_content_for.cr b/src/ext/kemal_content_for.crdeleted file mode 100644index a4f3fd96..00000000--- a/src/ext/kemal_content_for.cr+++ /dev/null@@ -1,16 +0,0 @@-# 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-enddiff --git a/src/ext/kemal_static_file_handler.cr b/src/ext/kemal_static_file_handler.crindex eb068aeb..a5f42261 100644--- a/src/ext/kemal_static_file_handler.cr+++ b/src/ext/kemal_static_file_handler.cr@@ -71,7 +71,7 @@ def send_file(env : HTTP::Server::Context, file_path : String, data : Slice(UIntfilesize = data.bytesizeattachment(env, filename, disposition)- Kemal.config.static_headers.try(&.call(env.response, file_path, filestat))+ Kemal.config.static_headers.try(&.call(env, file_path, filestat))file = IO::Memory.new(data)if env.request.method == "GET" && env.request.headers.has_key?("Range")diff --git a/src/invidious.cr b/src/invidious.crindex b422dcbb..629e6e59 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -17,10 +17,8 @@require "digest/md5"require "file_utils"-# Require kemal, kilt, then our own overrides+# Require kemal, then our own overridesrequire "kemal"-require "kilt"-require "./ext/kemal_content_for.cr"require "./ext/kemal_static_file_handler.cr"require "http_proxy"@@ -221,8 +219,8 @@ error 500 do |env, ex|error_template(500, ex)end-static_headers do |response|- response.headers.add("Cache-Control", "max-age=2629800")+static_headers do |env|+ env.response.headers.add("Cache-Control", "max-age=2629800")end# Init Kemaldiff --git a/src/invidious/helpers/macros.cr b/src/invidious/helpers/macros.crindex 43e7171b..84847321 100644--- a/src/invidious/helpers/macros.cr+++ b/src/invidious/helpers/macros.cr@@ -55,12 +55,11 @@ macro templated(_filename, template = "template", navbar_search = true){{ layout = "src/invidious/views/" + template + ".ecr" }}__content_filename__ = {{filename}}- content = Kilt.render({{filename}})- Kilt.render({{layout}})+ render {{filename}}, {{layout}}endmacro rendered(filename)- Kilt.render("src/invidious/views/#{{{filename}}}.ecr")+ render("src/invidious/views/#{{{filename}}}.ecr")end# Similar to Kemals halt method but works in a