diff --git a/lib/src/unit/ViewEngine.ts b/lib/src/unit/ViewEngine.ts index 5107447..a38ba6a 100644 --- a/lib/src/unit/ViewEngine.ts +++ b/lib/src/unit/ViewEngine.ts @@ -186,10 +186,14 @@ console.log('template path resolved 1', resolved_path) protected async init_engine_handlebars() { const partials_dir: unknown = this.config.get('app.views.partials_dir') if ( String(partials_dir) ) { - const partials_path = this.template_path(String(partials_dir)) + let partials_path = this.template_path(String(partials_dir)) console.log({ partials_path, partials_dir }) this.logger.info(`Registering Handlebars partials from: ${partials_path}`) + if ( partials_path.startsWith('file://') ) { + partials_path = partials_path.slice(7) + } + for await ( const entry of fs.walk(partials_path) ) { if ( !entry.isFile || !entry.path.endsWith(this.get_file_extension()) ) { if ( entry.isFile ) this.logger.debug(`Skipping file in Handlebars partials path with invalid suffix: ${entry.path}`)