Fix error.ftt, Adopt best effort strategy to convert ftl values into JS

This commit is contained in:
Joseph Garrone
2021-04-01 16:51:28 +02:00
parent 990a24fab2
commit 0858fe6319
6 changed files with 140 additions and 137 deletions

View File

@ -19,7 +19,7 @@ function loadAdjacentFile(fileBasename: string) {
.toString("utf8");
};
function loadFtlFile(ftlFileBasename: PageId | "template.ftl") {
function loadFtlFile(ftlFileBasename: PageId | "common.ftl") {
try {
return loadAdjacentFile(ftlFileBasename)
@ -91,7 +91,7 @@ export function generateFtlFilesCodeFactory(
//FTL is no valid html, we can't insert with cheerio, we put placeholder for injecting later.
const ftlCommonPlaceholders = {
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': loadFtlFile("template.ftl"),
'{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': loadFtlFile("common.ftl"),
'<!-- xIdLqMeOedErIdLsPdNdI9dSlxI -->':
[
'<#if scripts??>',