diff --git a/services/web/app/src/infrastructure/Views.js b/services/web/app/src/infrastructure/Views.js index b6f61b4cdb..5b7e431812 100644 --- a/services/web/app/src/infrastructure/Views.js +++ b/services/web/app/src/infrastructure/Views.js @@ -2,6 +2,7 @@ const logger = require('logger-sharelatex') const pug = require('pug') const globby = require('globby') const Settings = require('settings-sharelatex') +const path = require('path') // Generate list of view names from app/views @@ -31,16 +32,16 @@ module.exports = { let success = 0 let failures = 0 viewList.forEach(view => { + let filename = path.resolve(view + '.pug') // express views are cached using the absolute path try { - let filename = view + '.pug' pug.compileFile(filename, { cache: true, compileDebug: Settings.debugPugTemplates }) - logger.log({ view }, 'compiled') + logger.log({ filename }, 'compiled') success++ } catch (err) { - logger.error({ view, err: err.message }, 'error compiling') + logger.error({ filename, err: err.message }, 'error compiling') failures++ } })