Split helpers.cr into multiple files

This commit is contained in:
Omar Roth
2018-08-04 15:30:44 -05:00
parent 0685d3c7c2
commit 90d661e4a7
12 changed files with 2798 additions and 2779 deletions

View File

@@ -0,0 +1,18 @@
macro add_mapping(mapping)
def initialize({{*mapping.keys.map { |id| "@#{id}".id }}})
end
def to_a
return [{{*mapping.keys.map { |id| "@#{id}".id }}}]
end
DB.mapping({{mapping}})
end
macro templated(filename)
render "src/invidious/views/#{{{filename}}}.ecr", "src/invidious/views/layout.ecr"
end
macro rendered(filename)
render "src/invidious/views/#{{{filename}}}.ecr"
end