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

master
Garrett Mills 4 years ago
parent c482216565
commit d88a5353ae
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

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

Loading…
Cancel
Save