diff --git a/build/engines.js b/build/engines.js index 8267900..2ab0462 100644 --- a/build/engines.js +++ b/build/engines.js @@ -51,13 +51,8 @@ function markdown (mode, input, data, hbs) { } else { input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => { - try { - const result = hbs(contents, data); - return 'æææ' + result + 'æææ'; - } catch (e) { - log.error(e); - return ''; - } + const result = hbs(contents, data); + return 'æææ' + result + 'æææ'; }); input = input.replace(//g, ''); @@ -114,14 +109,14 @@ module.exports = exports = async function (prod) { const contents = await readFile(file); templates[name] = handybars(contents.toString('utf8'), env); } catch (e) { - log.error('Could not load partial ' + file, e); + log.error('Could not load template ' + file, e); } } const hbs = (source, data) => handybars(source, env)(data); const result = { - [TYPE.HANDYBARS]: hbs, + [TYPE.HANDYBARS]: hbs, [TYPE.MARKDOWN]: (source, data) => markdown('full', source, data, hbs), [TYPE.OTHER]: (source) => source, diff --git a/build/resolve.js b/build/resolve.js index 4998827..34cfb18 100644 --- a/build/resolve.js +++ b/build/resolve.js @@ -71,7 +71,7 @@ const normalizedExt = exports.normalizedExt = (ext) => { const isVideo = exports.isVideo = is(MP4, M4V); const isImage = exports.isImage = is(JPG, JPEG, PNG, GIF); -const isHandybars = exports.isHandybars = is(XML, HBS, HTML); +const isHandybars = exports.isHandybars = is(XML, HBS, HTML); const isMarkdown = exports.isMarkdown = is(MD); const isPage = exports.isPage = is(isHandybars, isMarkdown); const isAsset = exports.isAsset = is(isImage, isVideo); @@ -83,7 +83,7 @@ exports.isCleanUrl = is(HBS, MD); const TYPE = exports.TYPE = { IMAGE: 'TYPE_IMAGE', VIDEO: 'TYPE_VIDEO', - HANDYBARS: 'TYPE_HANDYBARS', + HANDYBARS: 'TYPE_HANDYBARS', MARKDOWN: 'TYPE_MARKDOWN', SCRIPT: 'TYPE_SCRIPT', STYLE: 'TYPE_STYLE',