mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-25 16:00:58 +00:00
Merge pull request #304 from sharelatex/ho-jade-speedup
Ho jade speedup
This commit is contained in:
commit
8c18153d5c
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