feat: give precedence to template

This commit is contained in:
Shivam Mishra 2020-05-28 19:24:31 +05:30
parent 11ec3442a3
commit 892149af99

View file

@ -214,14 +214,13 @@ def build_page(path):
context = get_context(path)
if context.source:
html = frappe.render_template(context.source, context)
elif context.template:
if context.template:
if path.endswith('min.js'):
html = frappe.get_jloader().get_source(frappe.get_jenv(), context.template)[0]
else:
html = frappe.get_template(context.template).render(context)
elif context.source:
html = frappe.render_template(context.source, context)
if '{index}' in html:
html = html.replace('{index}', get_toc(context.route))