mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 10:32:19 -05:00
precompile the jade partial views
This commit is contained in:
parent
130fece0f6
commit
d3ebdb64b2
1 changed files with 5 additions and 5 deletions
|
@ -25,14 +25,14 @@ module.exports = Modules =
|
|||
for module in @modules
|
||||
for view, partial of module.viewIncludes or {}
|
||||
@viewIncludes[view] ||= []
|
||||
@viewIncludes[view].push fs.readFileSync(Path.join(MODULE_BASE_PATH, module.name, "app/views", partial + ".jade"))
|
||||
@viewIncludes[view].push jade.compile(fs.readFileSync(Path.join(MODULE_BASE_PATH, module.name, "app/views", partial + ".jade")), doctype: "html")
|
||||
|
||||
moduleIncludes: (view, locals) ->
|
||||
partials = Modules.viewIncludes[view] or []
|
||||
compiledPartials = Modules.viewIncludes[view] or []
|
||||
html = ""
|
||||
for partial in partials
|
||||
compiler = jade.compile(partial, doctype: "html")
|
||||
html += compiler(locals)
|
||||
for compiledPartial in compiledPartials
|
||||
d = new Date()
|
||||
html += compiledPartial(locals)
|
||||
return html
|
||||
|
||||
moduleIncludesAvailable: (view) ->
|
||||
|
|
Loading…
Reference in a new issue