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 {
|
} else {
|
||||||
|
|
||||||
input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => {
|
input = input.replace(/\{!\{([\s\S]*?)\}!\}/mg, (match, contents) => {
|
||||||
try {
|
const result = hbs(contents, data);
|
||||||
const result = hbs(contents, data);
|
return 'æææ' + result + 'æææ';
|
||||||
return 'æææ' + result + 'æææ';
|
|
||||||
} catch (e) {
|
|
||||||
log.error(e);
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
input = input.replace(/<!--[[\]]-->/g, '');
|
input = input.replace(/<!--[[\]]-->/g, '');
|
||||||
@ -114,14 +109,14 @@ module.exports = exports = async function (prod) {
|
|||||||
const contents = await readFile(file);
|
const contents = await readFile(file);
|
||||||
templates[name] = handybars(contents.toString('utf8'), env);
|
templates[name] = handybars(contents.toString('utf8'), env);
|
||||||
} catch (e) {
|
} 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 hbs = (source, data) => handybars(source, env)(data);
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
[TYPE.HANDYBARS]: hbs,
|
[TYPE.HANDYBARS]: hbs,
|
||||||
[TYPE.MARKDOWN]: (source, data) => markdown('full', source, data, hbs),
|
[TYPE.MARKDOWN]: (source, data) => markdown('full', source, data, hbs),
|
||||||
[TYPE.OTHER]: (source) => source,
|
[TYPE.OTHER]: (source) => source,
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ const normalizedExt = exports.normalizedExt = (ext) => {
|
|||||||
|
|
||||||
const isVideo = exports.isVideo = is(MP4, M4V);
|
const isVideo = exports.isVideo = is(MP4, M4V);
|
||||||
const isImage = exports.isImage = is(JPG, JPEG, PNG, GIF);
|
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 isMarkdown = exports.isMarkdown = is(MD);
|
||||||
const isPage = exports.isPage = is(isHandybars, isMarkdown);
|
const isPage = exports.isPage = is(isHandybars, isMarkdown);
|
||||||
const isAsset = exports.isAsset = is(isImage, isVideo);
|
const isAsset = exports.isAsset = is(isImage, isVideo);
|
||||||
@ -83,7 +83,7 @@ exports.isCleanUrl = is(HBS, MD);
|
|||||||
const TYPE = exports.TYPE = {
|
const TYPE = exports.TYPE = {
|
||||||
IMAGE: 'TYPE_IMAGE',
|
IMAGE: 'TYPE_IMAGE',
|
||||||
VIDEO: 'TYPE_VIDEO',
|
VIDEO: 'TYPE_VIDEO',
|
||||||
HANDYBARS: 'TYPE_HANDYBARS',
|
HANDYBARS: 'TYPE_HANDYBARS',
|
||||||
MARKDOWN: 'TYPE_MARKDOWN',
|
MARKDOWN: 'TYPE_MARKDOWN',
|
||||||
SCRIPT: 'TYPE_SCRIPT',
|
SCRIPT: 'TYPE_SCRIPT',
|
||||||
STYLE: 'TYPE_STYLE',
|
STYLE: 'TYPE_STYLE',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user