diff --git a/conf/full.yaml b/conf/full.yaml index 25b8f8b32..9185ac891 100644 --- a/conf/full.yaml +++ b/conf/full.yaml @@ -19,6 +19,7 @@ web: title: Sinopia # logo: logo.png + # template: custom.hbs auth: htpasswd: diff --git a/lib/index-web.js b/lib/index-web.js index 2038d1c68..df698edb0 100644 --- a/lib/index-web.js +++ b/lib/index-web.js @@ -33,9 +33,13 @@ module.exports = function(config, auth, storage) { Search.configureStorage(storage) - Handlebars.registerPartial('entry', fs.readFileSync(require.resolve('./GUI/entry.hbs'), 'utf8')) - var template = Handlebars.compile(fs.readFileSync(require.resolve('./GUI/index.hbs'), 'utf8')) - + if(config.web && config.web.template) { + var template = Handlebars.compile(fs.readFileSync(config.web.template, 'utf8')); + } + else { + Handlebars.registerPartial('entry', fs.readFileSync(require.resolve('./GUI/entry.hbs'), 'utf8')) + var template = Handlebars.compile(fs.readFileSync(require.resolve('./GUI/index.hbs'), 'utf8')) + } app.get('/', function(req, res, next) { var base = config.url_prefix || req.protocol + '://' + req.get('host') res.setHeader('Content-Type', 'text/html')