mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 09:55:29 +00: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:
@@ -48,13 +48,19 @@ module JSON::Serializable
|
||||
end
|
||||
end
|
||||
|
||||
macro templated(filename, template = "template", navbar_search = true)
|
||||
macro templated(_filename, template = "template", navbar_search = true)
|
||||
navbar_search = {{navbar_search}}
|
||||
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/#{{{template}}}.ecr"
|
||||
|
||||
{{ filename = "src/invidious/views/" + _filename + ".ecr" }}
|
||||
{{ layout = "src/invidious/views/" + template + ".ecr" }}
|
||||
|
||||
__content_filename__ = {{filename}}
|
||||
content = Kilt.render({{filename}})
|
||||
Kilt.render({{layout}})
|
||||
end
|
||||
|
||||
macro rendered(filename)
|
||||
render "src/invidious/views/#{{{filename}}}.ecr"
|
||||
Kilt.render("src/invidious/views/#{{{filename}}}.ecr")
|
||||
end
|
||||
|
||||
# Similar to Kemals halt method but works in a
|
||||
|
||||
Reference in New Issue
Block a user