remove file:// from template dir on view render context

This commit is contained in:
Garrett Mills 2020-09-05 10:48:06 -05:00
parent c482216565
commit d88a5353ae
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -163,11 +163,13 @@ console.log('template path resolved 1', resolved_path)
*/
public get_render_context() {
if ( !this.template_dir ) throw new MissingTemplateDirectoryError()
let template_dir = this.template_dir
if ( template_dir.startsWith('file://') ) template_dir = template_dir.slice(7)
return {
viewExt: this.get_file_extension(),
viewEngine: this.get_engine(),
viewRoot: this.template_dir,
viewRoot: template_dir,
useCache: false, // TODO better value here
cache: undefined,
}