mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 10:23:04 -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 module in @modules
|
||||||
for view, partial of module.viewIncludes or {}
|
for view, partial of module.viewIncludes or {}
|
||||||
@viewIncludes[view] ||= []
|
@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) ->
|
moduleIncludes: (view, locals) ->
|
||||||
partials = Modules.viewIncludes[view] or []
|
compiledPartials = Modules.viewIncludes[view] or []
|
||||||
html = ""
|
html = ""
|
||||||
for partial in partials
|
for compiledPartial in compiledPartials
|
||||||
compiler = jade.compile(partial, doctype: "html")
|
d = new Date()
|
||||||
html += compiler(locals)
|
html += compiledPartial(locals)
|
||||||
return html
|
return html
|
||||||
|
|
||||||
moduleIncludesAvailable: (view) ->
|
moduleIncludesAvailable: (view) ->
|
||||||
|
|
Loading…
Reference in a new issue