mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Code Alignment
This commit is contained in:
parent
2fd59fd334
commit
5e625ce381
@ -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,
|
||||
|
||||
|
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user