@11ty/client 4.0.0-alpha.3 → 4.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eleventy.core.js +698 -591
- package/dist/eleventy.js +7885 -8011
- package/dist/formats/eleventy-liquid.js +81 -51
- package/dist/formats/eleventy-markdown.js +1 -1
- package/dist/formats/eleventy-nunjucks.js +94 -82
- package/dist/plugins/eleventy-plugin-i18n.js +2 -2
- package/package.json +6 -5
package/dist/eleventy.core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.5 (@11ty/client Bundle) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -745,8 +745,8 @@ var require_path = __commonJS({
|
|
|
745
745
|
var result2 = splitTailRe.exec(tail), dir = result2[1], basename = result2[2], ext = result2[3];
|
|
746
746
|
return [device, dir, basename, ext];
|
|
747
747
|
}
|
|
748
|
-
function win32StatPath(
|
|
749
|
-
var result = splitDeviceRe.exec(
|
|
748
|
+
function win32StatPath(path9) {
|
|
749
|
+
var result = splitDeviceRe.exec(path9), device = result[1] || "", isUnc = !!device && device[1] !== ":";
|
|
750
750
|
return {
|
|
751
751
|
device,
|
|
752
752
|
isUnc,
|
|
@@ -761,23 +761,23 @@ var require_path = __commonJS({
|
|
|
761
761
|
win32.resolve = function() {
|
|
762
762
|
var resolvedDevice = "", resolvedTail = "", resolvedAbsolute = false;
|
|
763
763
|
for (var i = arguments.length - 1; i >= -1; i--) {
|
|
764
|
-
var
|
|
764
|
+
var path9;
|
|
765
765
|
if (i >= 0) {
|
|
766
|
-
|
|
766
|
+
path9 = arguments[i];
|
|
767
767
|
} else if (!resolvedDevice) {
|
|
768
|
-
|
|
768
|
+
path9 = process.cwd();
|
|
769
769
|
} else {
|
|
770
|
-
|
|
771
|
-
if (!
|
|
772
|
-
|
|
770
|
+
path9 = process.env["=" + resolvedDevice];
|
|
771
|
+
if (!path9 || path9.substr(0, 3).toLowerCase() !== resolvedDevice.toLowerCase() + "\\") {
|
|
772
|
+
path9 = resolvedDevice + "\\";
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
|
-
if (!util.isString(
|
|
775
|
+
if (!util.isString(path9)) {
|
|
776
776
|
throw new TypeError("Arguments to path.resolve must be strings");
|
|
777
|
-
} else if (!
|
|
777
|
+
} else if (!path9) {
|
|
778
778
|
continue;
|
|
779
779
|
}
|
|
780
|
-
var result = win32StatPath(
|
|
780
|
+
var result = win32StatPath(path9), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail;
|
|
781
781
|
if (device && resolvedDevice && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
|
|
782
782
|
continue;
|
|
783
783
|
}
|
|
@@ -801,8 +801,8 @@ var require_path = __commonJS({
|
|
|
801
801
|
).join("\\");
|
|
802
802
|
return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
|
|
803
803
|
};
|
|
804
|
-
win32.normalize = function(
|
|
805
|
-
var result = win32StatPath(
|
|
804
|
+
win32.normalize = function(path9) {
|
|
805
|
+
var result = win32StatPath(path9), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail, trailingSlash = /[\\\/]$/.test(tail);
|
|
806
806
|
tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join("\\");
|
|
807
807
|
if (!tail && !isAbsolute) {
|
|
808
808
|
tail = ".";
|
|
@@ -815,8 +815,8 @@ var require_path = __commonJS({
|
|
|
815
815
|
}
|
|
816
816
|
return device + (isAbsolute ? "\\" : "") + tail;
|
|
817
817
|
};
|
|
818
|
-
win32.isAbsolute = function(
|
|
819
|
-
return win32StatPath(
|
|
818
|
+
win32.isAbsolute = function(path9) {
|
|
819
|
+
return win32StatPath(path9).isAbsolute;
|
|
820
820
|
};
|
|
821
821
|
win32.join = function() {
|
|
822
822
|
var paths = [];
|
|
@@ -861,22 +861,22 @@ var require_path = __commonJS({
|
|
|
861
861
|
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
862
862
|
return outputParts.join("\\");
|
|
863
863
|
};
|
|
864
|
-
win32._makeLong = function(
|
|
865
|
-
if (!util.isString(
|
|
866
|
-
return
|
|
867
|
-
if (!
|
|
864
|
+
win32._makeLong = function(path9) {
|
|
865
|
+
if (!util.isString(path9))
|
|
866
|
+
return path9;
|
|
867
|
+
if (!path9) {
|
|
868
868
|
return "";
|
|
869
869
|
}
|
|
870
|
-
var resolvedPath = win32.resolve(
|
|
870
|
+
var resolvedPath = win32.resolve(path9);
|
|
871
871
|
if (/^[a-zA-Z]\:\\/.test(resolvedPath)) {
|
|
872
872
|
return "\\\\?\\" + resolvedPath;
|
|
873
873
|
} else if (/^\\\\[^?.]/.test(resolvedPath)) {
|
|
874
874
|
return "\\\\?\\UNC\\" + resolvedPath.substring(2);
|
|
875
875
|
}
|
|
876
|
-
return
|
|
876
|
+
return path9;
|
|
877
877
|
};
|
|
878
|
-
win32.dirname = function(
|
|
879
|
-
var result = win32SplitPath(
|
|
878
|
+
win32.dirname = function(path9) {
|
|
879
|
+
var result = win32SplitPath(path9), root = result[0], dir = result[1];
|
|
880
880
|
if (!root && !dir) {
|
|
881
881
|
return ".";
|
|
882
882
|
}
|
|
@@ -885,15 +885,15 @@ var require_path = __commonJS({
|
|
|
885
885
|
}
|
|
886
886
|
return root + dir;
|
|
887
887
|
};
|
|
888
|
-
win32.basename = function(
|
|
889
|
-
var f = win32SplitPath(
|
|
888
|
+
win32.basename = function(path9, ext) {
|
|
889
|
+
var f = win32SplitPath(path9)[2];
|
|
890
890
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
891
891
|
f = f.substr(0, f.length - ext.length);
|
|
892
892
|
}
|
|
893
893
|
return f;
|
|
894
894
|
};
|
|
895
|
-
win32.extname = function(
|
|
896
|
-
return win32SplitPath(
|
|
895
|
+
win32.extname = function(path9) {
|
|
896
|
+
return win32SplitPath(path9)[3];
|
|
897
897
|
};
|
|
898
898
|
win32.format = function(pathObject) {
|
|
899
899
|
if (!util.isObject(pathObject)) {
|
|
@@ -945,14 +945,14 @@ var require_path = __commonJS({
|
|
|
945
945
|
posix.resolve = function() {
|
|
946
946
|
var resolvedPath = "", resolvedAbsolute = false;
|
|
947
947
|
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
|
948
|
-
var
|
|
949
|
-
if (!util.isString(
|
|
948
|
+
var path9 = i >= 0 ? arguments[i] : process.cwd();
|
|
949
|
+
if (!util.isString(path9)) {
|
|
950
950
|
throw new TypeError("Arguments to path.resolve must be strings");
|
|
951
|
-
} else if (!
|
|
951
|
+
} else if (!path9) {
|
|
952
952
|
continue;
|
|
953
953
|
}
|
|
954
|
-
resolvedPath =
|
|
955
|
-
resolvedAbsolute =
|
|
954
|
+
resolvedPath = path9 + "/" + resolvedPath;
|
|
955
|
+
resolvedAbsolute = path9[0] === "/";
|
|
956
956
|
}
|
|
957
957
|
resolvedPath = normalizeArray(
|
|
958
958
|
resolvedPath.split("/"),
|
|
@@ -960,36 +960,36 @@ var require_path = __commonJS({
|
|
|
960
960
|
).join("/");
|
|
961
961
|
return (resolvedAbsolute ? "/" : "") + resolvedPath || ".";
|
|
962
962
|
};
|
|
963
|
-
posix.normalize = function(
|
|
964
|
-
var isAbsolute = posix.isAbsolute(
|
|
965
|
-
|
|
966
|
-
if (!
|
|
967
|
-
|
|
963
|
+
posix.normalize = function(path9) {
|
|
964
|
+
var isAbsolute = posix.isAbsolute(path9), trailingSlash = path9 && path9[path9.length - 1] === "/";
|
|
965
|
+
path9 = normalizeArray(path9.split("/"), !isAbsolute).join("/");
|
|
966
|
+
if (!path9 && !isAbsolute) {
|
|
967
|
+
path9 = ".";
|
|
968
968
|
}
|
|
969
|
-
if (
|
|
970
|
-
|
|
969
|
+
if (path9 && trailingSlash) {
|
|
970
|
+
path9 += "/";
|
|
971
971
|
}
|
|
972
|
-
return (isAbsolute ? "/" : "") +
|
|
972
|
+
return (isAbsolute ? "/" : "") + path9;
|
|
973
973
|
};
|
|
974
|
-
posix.isAbsolute = function(
|
|
975
|
-
return
|
|
974
|
+
posix.isAbsolute = function(path9) {
|
|
975
|
+
return path9.charAt(0) === "/";
|
|
976
976
|
};
|
|
977
977
|
posix.join = function() {
|
|
978
|
-
var
|
|
978
|
+
var path9 = "";
|
|
979
979
|
for (var i = 0; i < arguments.length; i++) {
|
|
980
980
|
var segment = arguments[i];
|
|
981
981
|
if (!util.isString(segment)) {
|
|
982
982
|
throw new TypeError("Arguments to path.join must be strings");
|
|
983
983
|
}
|
|
984
984
|
if (segment) {
|
|
985
|
-
if (!
|
|
986
|
-
|
|
985
|
+
if (!path9) {
|
|
986
|
+
path9 += segment;
|
|
987
987
|
} else {
|
|
988
|
-
|
|
988
|
+
path9 += "/" + segment;
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
return posix.normalize(
|
|
992
|
+
return posix.normalize(path9);
|
|
993
993
|
};
|
|
994
994
|
posix.relative = function(from, to) {
|
|
995
995
|
from = posix.resolve(from).substr(1);
|
|
@@ -1011,11 +1011,11 @@ var require_path = __commonJS({
|
|
|
1011
1011
|
outputParts = outputParts.concat(toParts.slice(samePartsLength));
|
|
1012
1012
|
return outputParts.join("/");
|
|
1013
1013
|
};
|
|
1014
|
-
posix._makeLong = function(
|
|
1015
|
-
return
|
|
1014
|
+
posix._makeLong = function(path9) {
|
|
1015
|
+
return path9;
|
|
1016
1016
|
};
|
|
1017
|
-
posix.dirname = function(
|
|
1018
|
-
var result = posixSplitPath(
|
|
1017
|
+
posix.dirname = function(path9) {
|
|
1018
|
+
var result = posixSplitPath(path9), root = result[0], dir = result[1];
|
|
1019
1019
|
if (!root && !dir) {
|
|
1020
1020
|
return ".";
|
|
1021
1021
|
}
|
|
@@ -1024,15 +1024,15 @@ var require_path = __commonJS({
|
|
|
1024
1024
|
}
|
|
1025
1025
|
return root + dir;
|
|
1026
1026
|
};
|
|
1027
|
-
posix.basename = function(
|
|
1028
|
-
var f = posixSplitPath(
|
|
1027
|
+
posix.basename = function(path9, ext) {
|
|
1028
|
+
var f = posixSplitPath(path9)[2];
|
|
1029
1029
|
if (ext && f.substr(-1 * ext.length) === ext) {
|
|
1030
1030
|
f = f.substr(0, f.length - ext.length);
|
|
1031
1031
|
}
|
|
1032
1032
|
return f;
|
|
1033
1033
|
};
|
|
1034
|
-
posix.extname = function(
|
|
1035
|
-
return posixSplitPath(
|
|
1034
|
+
posix.extname = function(path9) {
|
|
1035
|
+
return posixSplitPath(path9)[3];
|
|
1036
1036
|
};
|
|
1037
1037
|
posix.format = function(pathObject) {
|
|
1038
1038
|
if (!util.isObject(pathObject)) {
|
|
@@ -1102,7 +1102,7 @@ var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, wr
|
|
|
1102
1102
|
var init_shim_consume_fs = __esm({
|
|
1103
1103
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
1104
1104
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
1105
|
-
fs = window[GLOBAL_FS_NAME] || globalThis[GLOBAL_FS_NAME];
|
|
1105
|
+
fs = typeof window !== "undefined" && window[GLOBAL_FS_NAME] || typeof globalThis !== "undefined" && globalThis[GLOBAL_FS_NAME];
|
|
1106
1106
|
if (!fs) {
|
|
1107
1107
|
let noopError = function() {
|
|
1108
1108
|
throw new Error("This function was not included in your Eleventy bundle. Make sure you load memfs.js before using the virtual file system.");
|
|
@@ -1140,54 +1140,54 @@ var init_shim_consume_fs = __esm({
|
|
|
1140
1140
|
// ../../node_modules/@11ty/eleventy-utils/src/TemplatePath.js
|
|
1141
1141
|
var require_TemplatePath = __commonJS({
|
|
1142
1142
|
"../../node_modules/@11ty/eleventy-utils/src/TemplatePath.js"(exports, module) {
|
|
1143
|
-
var
|
|
1143
|
+
var path9 = require_path();
|
|
1144
1144
|
var fs2 = (init_shim_consume_fs(), __toCommonJS(shim_consume_fs_exports));
|
|
1145
1145
|
function TemplatePath24() {
|
|
1146
1146
|
}
|
|
1147
1147
|
TemplatePath24.getWorkingDir = function() {
|
|
1148
|
-
return TemplatePath24.normalize(
|
|
1148
|
+
return TemplatePath24.normalize(path9.resolve("."));
|
|
1149
1149
|
};
|
|
1150
|
-
TemplatePath24.getDir = function(
|
|
1151
|
-
if (TemplatePath24.isDirectorySync(
|
|
1152
|
-
return
|
|
1150
|
+
TemplatePath24.getDir = function(path10) {
|
|
1151
|
+
if (TemplatePath24.isDirectorySync(path10)) {
|
|
1152
|
+
return path10;
|
|
1153
1153
|
}
|
|
1154
|
-
return TemplatePath24.getDirFromFilePath(
|
|
1154
|
+
return TemplatePath24.getDirFromFilePath(path10);
|
|
1155
1155
|
};
|
|
1156
1156
|
TemplatePath24.getDirFromFilePath = function(filePath) {
|
|
1157
|
-
return
|
|
1157
|
+
return path9.parse(filePath).dir || ".";
|
|
1158
1158
|
};
|
|
1159
|
-
TemplatePath24.getLastPathSegment = function(
|
|
1160
|
-
if (!
|
|
1161
|
-
return
|
|
1159
|
+
TemplatePath24.getLastPathSegment = function(path10) {
|
|
1160
|
+
if (!path10.includes("/")) {
|
|
1161
|
+
return path10;
|
|
1162
1162
|
}
|
|
1163
|
-
|
|
1164
|
-
return
|
|
1163
|
+
path10 = path10.replace(/\/$/, "");
|
|
1164
|
+
return path10.slice(path10.lastIndexOf("/") + 1);
|
|
1165
1165
|
};
|
|
1166
|
-
TemplatePath24.getAllDirs = function(
|
|
1167
|
-
|
|
1168
|
-
if (!
|
|
1169
|
-
return [
|
|
1166
|
+
TemplatePath24.getAllDirs = function(path10) {
|
|
1167
|
+
path10 = path10.replace(/\/$/, "");
|
|
1168
|
+
if (!path10.includes("/")) {
|
|
1169
|
+
return [path10];
|
|
1170
1170
|
}
|
|
1171
|
-
return
|
|
1171
|
+
return path10.split("/").map((segment, index, array) => array.slice(0, index + 1).join("/")).filter((path11) => path11 !== ".").reverse();
|
|
1172
1172
|
};
|
|
1173
1173
|
TemplatePath24.normalize = function(thePath) {
|
|
1174
|
-
let filePath =
|
|
1174
|
+
let filePath = path9.normalize(thePath).split(path9.sep).join("/");
|
|
1175
1175
|
if (filePath !== "/" && filePath.endsWith("/")) {
|
|
1176
1176
|
return filePath.slice(0, -1);
|
|
1177
1177
|
}
|
|
1178
1178
|
return filePath;
|
|
1179
1179
|
};
|
|
1180
1180
|
TemplatePath24.join = function(...paths) {
|
|
1181
|
-
return TemplatePath24.normalize(
|
|
1181
|
+
return TemplatePath24.normalize(path9.join(...paths));
|
|
1182
1182
|
};
|
|
1183
1183
|
TemplatePath24.normalizeUrlPath = function(...urlPaths) {
|
|
1184
|
-
const urlPath =
|
|
1184
|
+
const urlPath = path9.posix.join(...urlPaths);
|
|
1185
1185
|
return urlPath.replace(/\/+$/, "/");
|
|
1186
1186
|
};
|
|
1187
1187
|
TemplatePath24.absolutePath = function(...paths) {
|
|
1188
1188
|
let i = 0;
|
|
1189
1189
|
for (let p of paths) {
|
|
1190
|
-
if (
|
|
1190
|
+
if (path9.isAbsolute(p) && i > 0) {
|
|
1191
1191
|
throw new Error(
|
|
1192
1192
|
`Only the first parameter to Template.absolutePath can be an absolute path. Received: ${p} from ${paths}`
|
|
1193
1193
|
);
|
|
@@ -1196,7 +1196,7 @@ var require_TemplatePath = __commonJS({
|
|
|
1196
1196
|
}
|
|
1197
1197
|
let j = 0;
|
|
1198
1198
|
for (let p of paths) {
|
|
1199
|
-
if (j === 0 &&
|
|
1199
|
+
if (j === 0 && path9.isAbsolute(p)) {
|
|
1200
1200
|
return TemplatePath24.join(...paths);
|
|
1201
1201
|
}
|
|
1202
1202
|
j++;
|
|
@@ -1210,39 +1210,39 @@ var require_TemplatePath = __commonJS({
|
|
|
1210
1210
|
);
|
|
1211
1211
|
};
|
|
1212
1212
|
TemplatePath24.addLeadingDotSlashArray = function(paths) {
|
|
1213
|
-
return paths.map((
|
|
1213
|
+
return paths.map((path10) => TemplatePath24.addLeadingDotSlash(path10));
|
|
1214
1214
|
};
|
|
1215
1215
|
TemplatePath24.addLeadingDotSlash = function(pathArg) {
|
|
1216
1216
|
if (pathArg === "." || pathArg === "..") {
|
|
1217
1217
|
return pathArg + "/";
|
|
1218
1218
|
}
|
|
1219
|
-
if (
|
|
1219
|
+
if (path9.isAbsolute(pathArg) || pathArg.startsWith("./") || pathArg.startsWith("../")) {
|
|
1220
1220
|
return pathArg;
|
|
1221
1221
|
}
|
|
1222
1222
|
return "./" + pathArg;
|
|
1223
1223
|
};
|
|
1224
|
-
TemplatePath24.stripLeadingDotSlash = function(
|
|
1225
|
-
return typeof
|
|
1224
|
+
TemplatePath24.stripLeadingDotSlash = function(path10) {
|
|
1225
|
+
return typeof path10 === "string" ? path10.replace(/^\.\//, "") : path10;
|
|
1226
1226
|
};
|
|
1227
|
-
TemplatePath24.startsWithSubPath = function(
|
|
1228
|
-
|
|
1227
|
+
TemplatePath24.startsWithSubPath = function(path10, subPath) {
|
|
1228
|
+
path10 = TemplatePath24.normalize(path10);
|
|
1229
1229
|
subPath = TemplatePath24.normalize(subPath);
|
|
1230
|
-
return
|
|
1230
|
+
return path10.startsWith(subPath);
|
|
1231
1231
|
};
|
|
1232
|
-
TemplatePath24.stripLeadingSubPath = function(
|
|
1233
|
-
|
|
1232
|
+
TemplatePath24.stripLeadingSubPath = function(path10, subPath) {
|
|
1233
|
+
path10 = TemplatePath24.normalize(path10);
|
|
1234
1234
|
subPath = TemplatePath24.normalize(subPath);
|
|
1235
|
-
if (subPath !== "." &&
|
|
1236
|
-
return
|
|
1235
|
+
if (subPath !== "." && path10.startsWith(subPath)) {
|
|
1236
|
+
return path10.slice(subPath.length + 1);
|
|
1237
1237
|
}
|
|
1238
|
-
return
|
|
1238
|
+
return path10;
|
|
1239
1239
|
};
|
|
1240
|
-
TemplatePath24.isDirectorySync = function(
|
|
1241
|
-
return fs2.existsSync(
|
|
1240
|
+
TemplatePath24.isDirectorySync = function(path10) {
|
|
1241
|
+
return fs2.existsSync(path10) && fs2.statSync(path10).isDirectory();
|
|
1242
1242
|
};
|
|
1243
|
-
TemplatePath24.isDirectory = async function(
|
|
1243
|
+
TemplatePath24.isDirectory = async function(path10) {
|
|
1244
1244
|
return new Promise((resolve) => {
|
|
1245
|
-
fs2.stat(
|
|
1245
|
+
fs2.stat(path10, (err, stats) => {
|
|
1246
1246
|
if (stats) {
|
|
1247
1247
|
resolve(stats.isDirectory());
|
|
1248
1248
|
}
|
|
@@ -1250,44 +1250,44 @@ var require_TemplatePath = __commonJS({
|
|
|
1250
1250
|
});
|
|
1251
1251
|
});
|
|
1252
1252
|
};
|
|
1253
|
-
TemplatePath24.convertToRecursiveGlobSync = function(
|
|
1254
|
-
if (
|
|
1253
|
+
TemplatePath24.convertToRecursiveGlobSync = function(path10) {
|
|
1254
|
+
if (path10 === "") {
|
|
1255
1255
|
return "./**";
|
|
1256
1256
|
}
|
|
1257
|
-
|
|
1258
|
-
if (TemplatePath24.isDirectorySync(
|
|
1259
|
-
return
|
|
1257
|
+
path10 = TemplatePath24.addLeadingDotSlash(path10);
|
|
1258
|
+
if (TemplatePath24.isDirectorySync(path10)) {
|
|
1259
|
+
return path10 + (!path10.endsWith("/") ? "/" : "") + "**";
|
|
1260
1260
|
}
|
|
1261
|
-
return
|
|
1261
|
+
return path10;
|
|
1262
1262
|
};
|
|
1263
|
-
TemplatePath24.convertToRecursiveGlob = async function(
|
|
1264
|
-
if (
|
|
1263
|
+
TemplatePath24.convertToRecursiveGlob = async function(path10) {
|
|
1264
|
+
if (path10 === "") {
|
|
1265
1265
|
return "./**";
|
|
1266
1266
|
}
|
|
1267
|
-
|
|
1268
|
-
if (await TemplatePath24.isDirectory(
|
|
1269
|
-
return
|
|
1267
|
+
path10 = TemplatePath24.addLeadingDotSlash(path10);
|
|
1268
|
+
if (await TemplatePath24.isDirectory(path10)) {
|
|
1269
|
+
return path10 + (!path10.endsWith("/") ? "/" : "") + "**";
|
|
1270
1270
|
}
|
|
1271
|
-
return
|
|
1271
|
+
return path10;
|
|
1272
1272
|
};
|
|
1273
1273
|
TemplatePath24.getExtension = function(thePath) {
|
|
1274
|
-
return
|
|
1274
|
+
return path9.extname(thePath).replace(/^\./, "");
|
|
1275
1275
|
};
|
|
1276
|
-
TemplatePath24.removeExtension = function(
|
|
1276
|
+
TemplatePath24.removeExtension = function(path10, extension = void 0) {
|
|
1277
1277
|
if (extension === void 0) {
|
|
1278
|
-
return
|
|
1278
|
+
return path10;
|
|
1279
1279
|
}
|
|
1280
|
-
const pathExtension = TemplatePath24.getExtension(
|
|
1280
|
+
const pathExtension = TemplatePath24.getExtension(path10);
|
|
1281
1281
|
if (pathExtension !== "" && extension.endsWith(pathExtension)) {
|
|
1282
|
-
return
|
|
1282
|
+
return path10.substring(0, path10.lastIndexOf(pathExtension) - 1);
|
|
1283
1283
|
}
|
|
1284
|
-
return
|
|
1284
|
+
return path10;
|
|
1285
1285
|
};
|
|
1286
|
-
TemplatePath24.normalizeOperatingSystemFilePath = function(filePath,
|
|
1287
|
-
return filePath.split(
|
|
1286
|
+
TemplatePath24.normalizeOperatingSystemFilePath = function(filePath, sep2 = "/") {
|
|
1287
|
+
return filePath.split(sep2).join(path9.sep);
|
|
1288
1288
|
};
|
|
1289
|
-
TemplatePath24.standardizeFilePath = function(filePath,
|
|
1290
|
-
return TemplatePath24.addLeadingDotSlash(filePath.split(
|
|
1289
|
+
TemplatePath24.standardizeFilePath = function(filePath, sep2 = "/") {
|
|
1290
|
+
return TemplatePath24.addLeadingDotSlash(filePath.split(path9.sep).join(sep2));
|
|
1291
1291
|
};
|
|
1292
1292
|
module.exports = TemplatePath24;
|
|
1293
1293
|
}
|
|
@@ -1350,7 +1350,7 @@ var require_Merge = __commonJS({
|
|
|
1350
1350
|
}
|
|
1351
1351
|
return targetObject;
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function Merge5(target, ...sources) {
|
|
1354
1354
|
if (isPlainObject16(target)) {
|
|
1355
1355
|
for (let key in target) {
|
|
1356
1356
|
if (key.indexOf(OVERRIDE_PREFIX) === 0) {
|
|
@@ -1369,7 +1369,7 @@ var require_Merge = __commonJS({
|
|
|
1369
1369
|
}
|
|
1370
1370
|
return target;
|
|
1371
1371
|
}
|
|
1372
|
-
module.exports =
|
|
1372
|
+
module.exports = Merge5;
|
|
1373
1373
|
module.exports.DeepCopy = DeepCopy4;
|
|
1374
1374
|
}
|
|
1375
1375
|
});
|
|
@@ -1776,15 +1776,15 @@ var require_eleventy_utils = __commonJS({
|
|
|
1776
1776
|
"../../node_modules/@11ty/eleventy-utils/index.js"(exports, module) {
|
|
1777
1777
|
var TemplatePath24 = require_TemplatePath();
|
|
1778
1778
|
var isPlainObject16 = require_IsPlainObject();
|
|
1779
|
-
var
|
|
1779
|
+
var Merge5 = require_Merge();
|
|
1780
1780
|
var DateCompare = require_DateCompare();
|
|
1781
|
-
var { DeepCopy: DeepCopy4 } =
|
|
1781
|
+
var { DeepCopy: DeepCopy4 } = Merge5;
|
|
1782
1782
|
var { createHash, createHashHex, createHashSync, createHashHexSync } = require_CreateHash();
|
|
1783
1783
|
var Buffer3 = require_Buffer();
|
|
1784
1784
|
module.exports = {
|
|
1785
1785
|
TemplatePath: TemplatePath24,
|
|
1786
1786
|
isPlainObject: isPlainObject16,
|
|
1787
|
-
Merge:
|
|
1787
|
+
Merge: Merge5,
|
|
1788
1788
|
DeepCopy: DeepCopy4,
|
|
1789
1789
|
DateCompare,
|
|
1790
1790
|
createHash,
|
|
@@ -1846,23 +1846,23 @@ var require_lodash_custom = __commonJS({
|
|
|
1846
1846
|
var coreJsData = root["__core-js_shared__"];
|
|
1847
1847
|
var funcToString = funcProto.toString;
|
|
1848
1848
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1849
|
-
var maskSrcKey = function() {
|
|
1849
|
+
var maskSrcKey = (function() {
|
|
1850
1850
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
1851
1851
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
1852
|
-
}();
|
|
1852
|
+
})();
|
|
1853
1853
|
var nativeObjectToString = objectProto.toString;
|
|
1854
1854
|
var reIsNative = RegExp(
|
|
1855
1855
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1856
1856
|
);
|
|
1857
1857
|
var Symbol2 = root.Symbol, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
|
|
1858
|
-
var defineProperty = function() {
|
|
1858
|
+
var defineProperty = (function() {
|
|
1859
1859
|
try {
|
|
1860
1860
|
var func = getNative(Object, "defineProperty");
|
|
1861
1861
|
func({}, "", {});
|
|
1862
1862
|
return func;
|
|
1863
1863
|
} catch (e) {
|
|
1864
1864
|
}
|
|
1865
|
-
}();
|
|
1865
|
+
})();
|
|
1866
1866
|
var nativeCeil = Math.ceil, nativeMax = Math.max;
|
|
1867
1867
|
var Map2 = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
|
|
1868
1868
|
var realNames = {};
|
|
@@ -2022,11 +2022,11 @@ var require_lodash_custom = __commonJS({
|
|
|
2022
2022
|
object[key] = value;
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
function baseGet(object,
|
|
2026
|
-
|
|
2027
|
-
var index = 0, length =
|
|
2025
|
+
function baseGet(object, path9) {
|
|
2026
|
+
path9 = castPath(path9, object);
|
|
2027
|
+
var index = 0, length = path9.length;
|
|
2028
2028
|
while (object != null && index < length) {
|
|
2029
|
-
object = object[toKey(
|
|
2029
|
+
object = object[toKey(path9[index++])];
|
|
2030
2030
|
}
|
|
2031
2031
|
return index && index == length ? object : undefined2;
|
|
2032
2032
|
}
|
|
@@ -2043,14 +2043,14 @@ var require_lodash_custom = __commonJS({
|
|
|
2043
2043
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
2044
2044
|
return pattern.test(toSource(value));
|
|
2045
2045
|
}
|
|
2046
|
-
function baseSet(object,
|
|
2046
|
+
function baseSet(object, path9, value, customizer) {
|
|
2047
2047
|
if (!isObject(object)) {
|
|
2048
2048
|
return object;
|
|
2049
2049
|
}
|
|
2050
|
-
|
|
2051
|
-
var index = -1, length =
|
|
2050
|
+
path9 = castPath(path9, object);
|
|
2051
|
+
var index = -1, length = path9.length, lastIndex = length - 1, nested = object;
|
|
2052
2052
|
while (nested != null && ++index < length) {
|
|
2053
|
-
var key = toKey(
|
|
2053
|
+
var key = toKey(path9[index]), newValue = value;
|
|
2054
2054
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
2055
2055
|
return object;
|
|
2056
2056
|
}
|
|
@@ -2058,7 +2058,7 @@ var require_lodash_custom = __commonJS({
|
|
|
2058
2058
|
var objValue = nested[key];
|
|
2059
2059
|
newValue = customizer ? customizer(objValue, key, nested) : undefined2;
|
|
2060
2060
|
if (newValue === undefined2) {
|
|
2061
|
-
newValue = isObject(objValue) ? objValue : isIndex(
|
|
2061
|
+
newValue = isObject(objValue) ? objValue : isIndex(path9[index + 1]) ? [] : {};
|
|
2062
2062
|
}
|
|
2063
2063
|
}
|
|
2064
2064
|
assignValue(nested, key, newValue);
|
|
@@ -2298,12 +2298,12 @@ var require_lodash_custom = __commonJS({
|
|
|
2298
2298
|
function toString(value) {
|
|
2299
2299
|
return value == null ? "" : baseToString(value);
|
|
2300
2300
|
}
|
|
2301
|
-
function get(object,
|
|
2302
|
-
var result = object == null ? undefined2 : baseGet(object,
|
|
2301
|
+
function get(object, path9, defaultValue) {
|
|
2302
|
+
var result = object == null ? undefined2 : baseGet(object, path9);
|
|
2303
2303
|
return result === undefined2 ? defaultValue : result;
|
|
2304
2304
|
}
|
|
2305
|
-
function set(object,
|
|
2306
|
-
return object == null ? object : baseSet(object,
|
|
2305
|
+
function set(object, path9, value) {
|
|
2306
|
+
return object == null ? object : baseSet(object, path9, value);
|
|
2307
2307
|
}
|
|
2308
2308
|
lodash9.chunk = chunk;
|
|
2309
2309
|
lodash9.memoize = memoize;
|
|
@@ -2844,14 +2844,14 @@ var init_EventBus = __esm({
|
|
|
2844
2844
|
function getImportErrorMessage(filePath, type) {
|
|
2845
2845
|
return `There was a problem importing '${import_node_path.default.relative(".", filePath)}' via ${type}`;
|
|
2846
2846
|
}
|
|
2847
|
-
function loadContents(
|
|
2847
|
+
function loadContents(path9, options = {}) {
|
|
2848
2848
|
let rawInput;
|
|
2849
2849
|
let encoding = "utf8";
|
|
2850
2850
|
if (options?.encoding || options?.encoding === null) {
|
|
2851
2851
|
encoding = options.encoding;
|
|
2852
2852
|
}
|
|
2853
2853
|
try {
|
|
2854
|
-
rawInput = readFileSync(
|
|
2854
|
+
rawInput = readFileSync(path9, encoding);
|
|
2855
2855
|
} catch (error) {
|
|
2856
2856
|
if (error?.code === "ENOENT") {
|
|
2857
2857
|
return;
|
|
@@ -2985,7 +2985,7 @@ var init_package = __esm({
|
|
|
2985
2985
|
"../../package.json"() {
|
|
2986
2986
|
package_default = {
|
|
2987
2987
|
name: "@11ty/eleventy",
|
|
2988
|
-
version: "4.0.0-alpha.
|
|
2988
|
+
version: "4.0.0-alpha.5",
|
|
2989
2989
|
description: "A simpler static site generator.",
|
|
2990
2990
|
publishConfig: {
|
|
2991
2991
|
access: "public",
|
|
@@ -3000,14 +3000,15 @@ var init_package = __esm({
|
|
|
3000
3000
|
},
|
|
3001
3001
|
"./UserConfig": {
|
|
3002
3002
|
types: "./src/UserConfig.js"
|
|
3003
|
-
}
|
|
3003
|
+
},
|
|
3004
|
+
"./utils/git": "./src/Util/Git.js"
|
|
3004
3005
|
},
|
|
3005
3006
|
bin: {
|
|
3006
3007
|
eleventy: "cmd.cjs"
|
|
3007
3008
|
},
|
|
3008
3009
|
license: "MIT",
|
|
3009
3010
|
engines: {
|
|
3010
|
-
node: ">=20"
|
|
3011
|
+
node: ">=20.19"
|
|
3011
3012
|
},
|
|
3012
3013
|
workspaces: [
|
|
3013
3014
|
"packages/client"
|
|
@@ -3051,7 +3052,7 @@ var init_package = __esm({
|
|
|
3051
3052
|
author: "Zach Leatherman <zachleatherman@gmail.com> (https://zachleat.com/)",
|
|
3052
3053
|
repository: {
|
|
3053
3054
|
type: "git",
|
|
3054
|
-
url: "git://github.com/11ty/eleventy.git"
|
|
3055
|
+
url: "git+https://github.com/11ty/eleventy.git"
|
|
3055
3056
|
},
|
|
3056
3057
|
bugs: "https://github.com/11ty/eleventy/issues",
|
|
3057
3058
|
homepage: "https://www.11ty.dev/",
|
|
@@ -3082,61 +3083,61 @@ var init_package = __esm({
|
|
|
3082
3083
|
devDependencies: {
|
|
3083
3084
|
"@11ty/eleventy-img": "^6.0.4",
|
|
3084
3085
|
"@11ty/eleventy-plugin-rss": "^2.0.4",
|
|
3085
|
-
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.
|
|
3086
|
-
"@11ty/eleventy-plugin-webc": "^0.12.0-beta.
|
|
3087
|
-
"@eslint/js": "^9.
|
|
3086
|
+
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2",
|
|
3087
|
+
"@11ty/eleventy-plugin-webc": "^0.12.0-beta.7",
|
|
3088
|
+
"@eslint/js": "^9.39.1",
|
|
3088
3089
|
"@iarna/toml": "^2.2.5",
|
|
3089
|
-
"@mdx-js/node-loader": "^3.1.
|
|
3090
|
+
"@mdx-js/node-loader": "^3.1.1",
|
|
3090
3091
|
"@stylistic/eslint-plugin-js": "^4.4.1",
|
|
3091
|
-
"@types/node": "^22.
|
|
3092
|
-
"@vue/server-renderer": "^3.5.
|
|
3092
|
+
"@types/node": "^22.19.1",
|
|
3093
|
+
"@vue/server-renderer": "^3.5.25",
|
|
3093
3094
|
"@zachleat/noop": "^1.0.6",
|
|
3094
3095
|
ava: "^6.4.1",
|
|
3095
3096
|
c8: "^10.1.3",
|
|
3096
|
-
"cross-env": "^
|
|
3097
|
-
eslint: "^9.
|
|
3097
|
+
"cross-env": "^10.1.0",
|
|
3098
|
+
eslint: "^9.39.1",
|
|
3098
3099
|
"eslint-config-prettier": "^10.1.8",
|
|
3099
|
-
globals: "^16.
|
|
3100
|
-
"jsx-async-runtime": "^1.0.
|
|
3101
|
-
luxon: "^3.7.
|
|
3100
|
+
globals: "^16.5.0",
|
|
3101
|
+
"jsx-async-runtime": "^1.0.4",
|
|
3102
|
+
luxon: "^3.7.2",
|
|
3102
3103
|
"markdown-it-abbr": "^2.0.0",
|
|
3103
3104
|
"markdown-it-emoji": "^3.0.0",
|
|
3104
3105
|
marked: "^15.0.12",
|
|
3105
3106
|
"nano-staged": "^0.8.0",
|
|
3106
|
-
prettier: "^3.
|
|
3107
|
+
prettier: "^3.7.1",
|
|
3107
3108
|
pretty: "^2.0.0",
|
|
3108
|
-
react: "^19.
|
|
3109
|
-
"react-dom": "^19.
|
|
3110
|
-
rimraf: "^6.
|
|
3111
|
-
sass: "^1.
|
|
3112
|
-
"simple-git-hooks": "^2.13.
|
|
3113
|
-
tsx: "^4.20.
|
|
3114
|
-
typescript: "^5.
|
|
3115
|
-
vue: "^3.5.
|
|
3109
|
+
react: "^19.2.1",
|
|
3110
|
+
"react-dom": "^19.2.1",
|
|
3111
|
+
rimraf: "^6.1.2",
|
|
3112
|
+
sass: "^1.94.2",
|
|
3113
|
+
"simple-git-hooks": "^2.13.1",
|
|
3114
|
+
tsx: "^4.20.6",
|
|
3115
|
+
typescript: "^5.9.3",
|
|
3116
|
+
vue: "^3.5.25",
|
|
3116
3117
|
zod: "^3.25.76",
|
|
3117
|
-
"zod-validation-error": "^3.5.
|
|
3118
|
+
"zod-validation-error": "^3.5.4"
|
|
3118
3119
|
},
|
|
3119
3120
|
dependencies: {
|
|
3120
|
-
"@11ty/dependency-tree": "^4.0.
|
|
3121
|
-
"@11ty/dependency-tree-esm": "^2.0.
|
|
3122
|
-
"@11ty/eleventy-dev-server": "3.0.0-alpha.
|
|
3123
|
-
"@11ty/eleventy-plugin-bundle": "^3.0.
|
|
3121
|
+
"@11ty/dependency-tree": "^4.0.1",
|
|
3122
|
+
"@11ty/dependency-tree-esm": "^2.0.3",
|
|
3123
|
+
"@11ty/eleventy-dev-server": "^3.0.0-alpha.5",
|
|
3124
|
+
"@11ty/eleventy-plugin-bundle": "^3.0.7",
|
|
3124
3125
|
"@11ty/eleventy-utils": "^2.0.7",
|
|
3125
|
-
"@11ty/gray-matter": "^2.0.
|
|
3126
|
+
"@11ty/gray-matter": "^2.0.1",
|
|
3126
3127
|
"@11ty/lodash-custom": "^4.17.21",
|
|
3127
|
-
"@11ty/parse-date-strings": "^2.0.
|
|
3128
|
-
"@11ty/posthtml-urls": "^1.0.
|
|
3129
|
-
"@11ty/recursive-copy": "^4.0.
|
|
3130
|
-
"@sindresorhus/slugify": "^
|
|
3128
|
+
"@11ty/parse-date-strings": "^2.0.6",
|
|
3129
|
+
"@11ty/posthtml-urls": "^1.0.2",
|
|
3130
|
+
"@11ty/recursive-copy": "^4.0.3",
|
|
3131
|
+
"@sindresorhus/slugify": "^3.0.0",
|
|
3131
3132
|
"bcp-47-normalize": "^2.3.0",
|
|
3132
|
-
chokidar: "^
|
|
3133
|
-
debug: "^4.4.
|
|
3133
|
+
chokidar: "^5.0.0",
|
|
3134
|
+
debug: "^4.4.3",
|
|
3134
3135
|
"dependency-graph": "^1.0.0",
|
|
3135
|
-
entities: "^
|
|
3136
|
-
"import-module-string": "^2.0.
|
|
3136
|
+
entities: "^7.0.0",
|
|
3137
|
+
"import-module-string": "^2.0.3",
|
|
3137
3138
|
"iso-639-1": "^3.1.5",
|
|
3138
3139
|
kleur: "^4.1.5",
|
|
3139
|
-
liquidjs: "^10.
|
|
3140
|
+
liquidjs: "^10.24.0",
|
|
3140
3141
|
"markdown-it": "^14.1.0",
|
|
3141
3142
|
minimist: "^1.2.8",
|
|
3142
3143
|
moo: "^0.5.2",
|
|
@@ -3144,13 +3145,16 @@ var init_package = __esm({
|
|
|
3144
3145
|
nunjucks: "^3.2.4",
|
|
3145
3146
|
picomatch: "^4.0.3",
|
|
3146
3147
|
"please-upgrade-node": "^3.2.0",
|
|
3147
|
-
posthtml: "^0.16.
|
|
3148
|
+
posthtml: "^0.16.7",
|
|
3148
3149
|
"posthtml-match-helper": "^2.0.3",
|
|
3149
|
-
semver: "^7.7.
|
|
3150
|
-
tinyglobby: "^0.2.
|
|
3150
|
+
semver: "^7.7.3",
|
|
3151
|
+
tinyglobby: "^0.2.15"
|
|
3151
3152
|
},
|
|
3152
3153
|
overrides: {
|
|
3153
|
-
|
|
3154
|
+
commander: "^14",
|
|
3155
|
+
chokidar: "$chokidar",
|
|
3156
|
+
fdir: "6.4.6",
|
|
3157
|
+
"posthtml-parser": "^0.12"
|
|
3154
3158
|
}
|
|
3155
3159
|
};
|
|
3156
3160
|
}
|
|
@@ -3159,8 +3163,8 @@ var init_package = __esm({
|
|
|
3159
3163
|
// ../../src/Util/RequireUtils.core.js
|
|
3160
3164
|
function clearRequireCache(absolutePath) {
|
|
3161
3165
|
}
|
|
3162
|
-
function importJsonSync(
|
|
3163
|
-
let rawInput = loadContents(
|
|
3166
|
+
function importJsonSync(path9) {
|
|
3167
|
+
let rawInput = loadContents(path9);
|
|
3164
3168
|
if (!rawInput) {
|
|
3165
3169
|
return;
|
|
3166
3170
|
}
|
|
@@ -4479,6 +4483,18 @@ var require_loader = __commonJS({
|
|
|
4479
4483
|
(c - 65536 & 1023) + 56320
|
|
4480
4484
|
);
|
|
4481
4485
|
}
|
|
4486
|
+
function setProperty(object, key, value) {
|
|
4487
|
+
if (key === "__proto__") {
|
|
4488
|
+
Object.defineProperty(object, key, {
|
|
4489
|
+
configurable: true,
|
|
4490
|
+
enumerable: true,
|
|
4491
|
+
writable: true,
|
|
4492
|
+
value
|
|
4493
|
+
});
|
|
4494
|
+
} else {
|
|
4495
|
+
object[key] = value;
|
|
4496
|
+
}
|
|
4497
|
+
}
|
|
4482
4498
|
var simpleEscapeCheck = new Array(256);
|
|
4483
4499
|
var simpleEscapeMap = new Array(256);
|
|
4484
4500
|
for (i = 0; i < 256; i++) {
|
|
@@ -4598,7 +4614,7 @@ var require_loader = __commonJS({
|
|
|
4598
4614
|
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
4599
4615
|
key = sourceKeys[index];
|
|
4600
4616
|
if (!_hasOwnProperty.call(destination, key)) {
|
|
4601
|
-
destination
|
|
4617
|
+
setProperty(destination, key, source[key]);
|
|
4602
4618
|
overridableKeys[key] = true;
|
|
4603
4619
|
}
|
|
4604
4620
|
}
|
|
@@ -4638,16 +4654,7 @@ var require_loader = __commonJS({
|
|
|
4638
4654
|
state.position = startPos || state.position;
|
|
4639
4655
|
throwError(state, "duplicated mapping key");
|
|
4640
4656
|
}
|
|
4641
|
-
|
|
4642
|
-
Object.defineProperty(_result, keyNode, {
|
|
4643
|
-
configurable: true,
|
|
4644
|
-
enumerable: true,
|
|
4645
|
-
writable: true,
|
|
4646
|
-
value: valueNode
|
|
4647
|
-
});
|
|
4648
|
-
} else {
|
|
4649
|
-
_result[keyNode] = valueNode;
|
|
4650
|
-
}
|
|
4657
|
+
setProperty(_result, keyNode, valueNode);
|
|
4651
4658
|
delete overridableKeys[keyNode];
|
|
4652
4659
|
}
|
|
4653
4660
|
return _result;
|
|
@@ -5817,7 +5824,7 @@ var require_dumper = __commonJS({
|
|
|
5817
5824
|
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
|
|
5818
5825
|
}
|
|
5819
5826
|
function writeScalar(state, string, level, iskey, inblock) {
|
|
5820
|
-
state.dump = function() {
|
|
5827
|
+
state.dump = (function() {
|
|
5821
5828
|
if (string.length === 0) {
|
|
5822
5829
|
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
|
|
5823
5830
|
}
|
|
@@ -5855,7 +5862,7 @@ var require_dumper = __commonJS({
|
|
|
5855
5862
|
default:
|
|
5856
5863
|
throw new YAMLException("impossible error: invalid scalar style");
|
|
5857
5864
|
}
|
|
5858
|
-
}();
|
|
5865
|
+
})();
|
|
5859
5866
|
}
|
|
5860
5867
|
function blockHeader(string, indentPerLevel) {
|
|
5861
5868
|
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
|
|
@@ -5869,12 +5876,12 @@ var require_dumper = __commonJS({
|
|
|
5869
5876
|
}
|
|
5870
5877
|
function foldString(string, width) {
|
|
5871
5878
|
var lineRe = /(\n+)([^\n]*)/g;
|
|
5872
|
-
var result = function() {
|
|
5879
|
+
var result = (function() {
|
|
5873
5880
|
var nextLF = string.indexOf("\n");
|
|
5874
5881
|
nextLF = nextLF !== -1 ? nextLF : string.length;
|
|
5875
5882
|
lineRe.lastIndex = nextLF;
|
|
5876
5883
|
return foldLine(string.slice(0, nextLF), width);
|
|
5877
|
-
}();
|
|
5884
|
+
})();
|
|
5878
5885
|
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
5879
5886
|
var moreIndented;
|
|
5880
5887
|
var match;
|
|
@@ -6252,7 +6259,7 @@ var require_engines = __commonJS({
|
|
|
6252
6259
|
}
|
|
6253
6260
|
};
|
|
6254
6261
|
engines.javascript = {
|
|
6255
|
-
parse: function
|
|
6262
|
+
parse: function parse3(str, options, wrap) {
|
|
6256
6263
|
throw new Error("Parsing JavaScript in front matter is no longer supported internally in `@11ty/gray-matter`. Support is added upstream in `@11ty/eleventy`.");
|
|
6257
6264
|
},
|
|
6258
6265
|
stringify: function() {
|
|
@@ -6441,11 +6448,11 @@ var require_excerpt = __commonJS({
|
|
|
6441
6448
|
if (typeof opts.excerpt === "function") {
|
|
6442
6449
|
return opts.excerpt(file, opts);
|
|
6443
6450
|
}
|
|
6444
|
-
const
|
|
6445
|
-
if (
|
|
6451
|
+
const sep2 = file.data.excerpt_separator || opts.excerpt_separator;
|
|
6452
|
+
if (sep2 == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
6446
6453
|
return file;
|
|
6447
6454
|
}
|
|
6448
|
-
const delimiter = typeof opts.excerpt === "string" ? opts.excerpt :
|
|
6455
|
+
const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep2 || opts.delimiters[0];
|
|
6449
6456
|
const idx = file.content.indexOf(delimiter);
|
|
6450
6457
|
if (idx !== -1) {
|
|
6451
6458
|
file.excerpt = file.content.slice(0, idx);
|
|
@@ -6517,7 +6524,7 @@ var require_gray_matter = __commonJS({
|
|
|
6517
6524
|
var excerpt = require_excerpt();
|
|
6518
6525
|
var engines = require_engines();
|
|
6519
6526
|
var toFile = require_to_file();
|
|
6520
|
-
var
|
|
6527
|
+
var parse3 = require_parse();
|
|
6521
6528
|
var utils = require_utils();
|
|
6522
6529
|
function matter2(input, options) {
|
|
6523
6530
|
if (input === "") {
|
|
@@ -6569,7 +6576,7 @@ var require_gray_matter = __commonJS({
|
|
|
6569
6576
|
file.empty = file.content;
|
|
6570
6577
|
file.data = {};
|
|
6571
6578
|
} else {
|
|
6572
|
-
file.data =
|
|
6579
|
+
file.data = parse3(file.language, file.matter, opts);
|
|
6573
6580
|
}
|
|
6574
6581
|
if (closeIndex === len) {
|
|
6575
6582
|
file.content = "";
|
|
@@ -7801,20 +7808,20 @@ var TemplateGlob = class _TemplateGlob {
|
|
|
7801
7808
|
}
|
|
7802
7809
|
return import_eleventy_utils.TemplatePath.addLeadingDotSlash(import_eleventy_utils.TemplatePath.join(...paths));
|
|
7803
7810
|
}
|
|
7804
|
-
static normalize(
|
|
7805
|
-
|
|
7806
|
-
if (
|
|
7807
|
-
return "!" + _TemplateGlob.normalizePath(
|
|
7811
|
+
static normalize(path9) {
|
|
7812
|
+
path9 = path9.trim();
|
|
7813
|
+
if (path9.charAt(0) === "!") {
|
|
7814
|
+
return "!" + _TemplateGlob.normalizePath(path9.slice(1));
|
|
7808
7815
|
} else {
|
|
7809
|
-
return _TemplateGlob.normalizePath(
|
|
7816
|
+
return _TemplateGlob.normalizePath(path9);
|
|
7810
7817
|
}
|
|
7811
7818
|
}
|
|
7812
7819
|
static map(files) {
|
|
7813
7820
|
if (typeof files === "string") {
|
|
7814
7821
|
return _TemplateGlob.normalize(files);
|
|
7815
7822
|
} else if (Array.isArray(files)) {
|
|
7816
|
-
return files.map(function(
|
|
7817
|
-
return _TemplateGlob.normalize(
|
|
7823
|
+
return files.map(function(path9) {
|
|
7824
|
+
return _TemplateGlob.normalize(path9);
|
|
7818
7825
|
});
|
|
7819
7826
|
} else {
|
|
7820
7827
|
return files;
|
|
@@ -8082,10 +8089,10 @@ var TemplateData = class _TemplateData {
|
|
|
8082
8089
|
getGlobalDataExtensionPriorities() {
|
|
8083
8090
|
return this.getUserDataExtensions().concat(["json", "mjs", "cjs", "js"]);
|
|
8084
8091
|
}
|
|
8085
|
-
static calculateExtensionPriority(
|
|
8092
|
+
static calculateExtensionPriority(path9, priorities) {
|
|
8086
8093
|
for (let i = 0; i < priorities.length; i++) {
|
|
8087
8094
|
let ext = priorities[i];
|
|
8088
|
-
if (
|
|
8095
|
+
if (path9.endsWith(ext)) {
|
|
8089
8096
|
return i;
|
|
8090
8097
|
}
|
|
8091
8098
|
}
|
|
@@ -8137,7 +8144,7 @@ var TemplateData = class _TemplateData {
|
|
|
8137
8144
|
`merging global data from ${files[j]} with an already existing global data file (${dataFileConflicts[objectPathTargetString]}). Overriding existing keys.`
|
|
8138
8145
|
);
|
|
8139
8146
|
let oldData = lodashGet(globalData, objectPathTarget);
|
|
8140
|
-
data =
|
|
8147
|
+
data = (0, import_eleventy_utils5.Merge)(oldData, data);
|
|
8141
8148
|
}
|
|
8142
8149
|
dataFileConflicts[objectPathTargetString] = files[j];
|
|
8143
8150
|
debug3(`Found global data file ${files[j]} and adding as: ${objectPathTarget}`);
|
|
@@ -8195,38 +8202,38 @@ var TemplateData = class _TemplateData {
|
|
|
8195
8202
|
if (!Array.isArray(localDataPaths)) {
|
|
8196
8203
|
localDataPaths = [localDataPaths];
|
|
8197
8204
|
}
|
|
8198
|
-
localDataPaths = localDataPaths.filter((
|
|
8199
|
-
return this.exists(
|
|
8205
|
+
localDataPaths = localDataPaths.filter((path9) => {
|
|
8206
|
+
return this.exists(path9);
|
|
8200
8207
|
});
|
|
8201
8208
|
this.config.events.emit("eleventy.dataFiles", localDataPaths);
|
|
8202
8209
|
if (!localDataPaths.length) {
|
|
8203
8210
|
return localData;
|
|
8204
8211
|
}
|
|
8205
8212
|
let dataSource = {};
|
|
8206
|
-
for (let
|
|
8207
|
-
let dataForPath = await this.getDataValue(
|
|
8213
|
+
for (let path9 of localDataPaths) {
|
|
8214
|
+
let dataForPath = await this.getDataValue(path9);
|
|
8208
8215
|
if (!(0, import_eleventy_utils5.isPlainObject)(dataForPath)) {
|
|
8209
8216
|
debug3(
|
|
8210
8217
|
"Warning: Template and Directory data files expect an object to be returned, instead `%o` returned `%o`",
|
|
8211
|
-
|
|
8218
|
+
path9,
|
|
8212
8219
|
dataForPath
|
|
8213
8220
|
);
|
|
8214
8221
|
} else {
|
|
8215
8222
|
let cleanedDataForPath = _TemplateData.cleanupData(dataForPath, {
|
|
8216
|
-
file:
|
|
8223
|
+
file: path9
|
|
8217
8224
|
});
|
|
8218
8225
|
for (let key in cleanedDataForPath) {
|
|
8219
8226
|
if (Object.prototype.hasOwnProperty.call(dataSource, key)) {
|
|
8220
8227
|
debugWarn(
|
|
8221
8228
|
"Local data files have conflicting data. Overwriting '%s' with data from '%s'. Previous data location was from '%s'",
|
|
8222
8229
|
key,
|
|
8223
|
-
|
|
8230
|
+
path9,
|
|
8224
8231
|
dataSource[key]
|
|
8225
8232
|
);
|
|
8226
8233
|
}
|
|
8227
|
-
dataSource[key] =
|
|
8234
|
+
dataSource[key] = path9;
|
|
8228
8235
|
}
|
|
8229
|
-
|
|
8236
|
+
(0, import_eleventy_utils5.Merge)(localData, cleanedDataForPath);
|
|
8230
8237
|
}
|
|
8231
8238
|
}
|
|
8232
8239
|
return localData;
|
|
@@ -8254,42 +8261,42 @@ var TemplateData = class _TemplateData {
|
|
|
8254
8261
|
hasUserDataExtensions() {
|
|
8255
8262
|
return this.config.dataExtensions && this.config.dataExtensions.size > 0;
|
|
8256
8263
|
}
|
|
8257
|
-
async _parseDataFile(
|
|
8264
|
+
async _parseDataFile(path9, parser, options = {}) {
|
|
8258
8265
|
let readFile = !("read" in options) || options.read === true;
|
|
8259
8266
|
let rawInput;
|
|
8260
8267
|
if (readFile) {
|
|
8261
|
-
rawInput = loadContents(
|
|
8268
|
+
rawInput = loadContents(path9, options);
|
|
8262
8269
|
}
|
|
8263
8270
|
if (readFile && !rawInput) {
|
|
8264
8271
|
return {};
|
|
8265
8272
|
}
|
|
8266
8273
|
try {
|
|
8267
8274
|
if (readFile) {
|
|
8268
|
-
return parser(rawInput,
|
|
8275
|
+
return parser(rawInput, path9);
|
|
8269
8276
|
} else {
|
|
8270
|
-
return parser(
|
|
8277
|
+
return parser(path9, path9);
|
|
8271
8278
|
}
|
|
8272
8279
|
} catch (e) {
|
|
8273
|
-
throw new TemplateDataParseError(`Having trouble parsing data file ${
|
|
8280
|
+
throw new TemplateDataParseError(`Having trouble parsing data file ${path9}`, e);
|
|
8274
8281
|
}
|
|
8275
8282
|
}
|
|
8276
8283
|
// ignoreProcessing = false for global data files
|
|
8277
8284
|
// ignoreProcessing = true for local data files
|
|
8278
|
-
async getDataValue(
|
|
8279
|
-
let extension = import_eleventy_utils5.TemplatePath.getExtension(
|
|
8285
|
+
async getDataValue(path9) {
|
|
8286
|
+
let extension = import_eleventy_utils5.TemplatePath.getExtension(path9);
|
|
8280
8287
|
if (extension === "js" || extension === "cjs" || extension === "mjs") {
|
|
8281
|
-
if (!this.exists(
|
|
8288
|
+
if (!this.exists(path9)) {
|
|
8282
8289
|
return {};
|
|
8283
8290
|
}
|
|
8284
8291
|
let aggregateDataBench = this.benchmarks.aggregate.get("Data File");
|
|
8285
8292
|
aggregateDataBench.before();
|
|
8286
|
-
let dataBench = this.benchmarks.data.get(`\`${
|
|
8293
|
+
let dataBench = this.benchmarks.data.get(`\`${path9}\``);
|
|
8287
8294
|
dataBench.before();
|
|
8288
8295
|
let type = "cjs";
|
|
8289
8296
|
if (extension === "mjs" || extension === "js" && this.isEsm) {
|
|
8290
8297
|
type = "esm";
|
|
8291
8298
|
}
|
|
8292
|
-
let returnValue = await dynamicImport(
|
|
8299
|
+
let returnValue = await dynamicImport(path9, type);
|
|
8293
8300
|
if (typeof returnValue === "function") {
|
|
8294
8301
|
let configApiGlobalData = await this.getInitialGlobalData();
|
|
8295
8302
|
returnValue = await returnValue(configApiGlobalData || {});
|
|
@@ -8299,13 +8306,13 @@ var TemplateData = class _TemplateData {
|
|
|
8299
8306
|
return returnValue;
|
|
8300
8307
|
} else if (this.isUserDataExtension(extension)) {
|
|
8301
8308
|
let { parser, options } = this.getUserDataParser(extension);
|
|
8302
|
-
return this._parseDataFile(
|
|
8309
|
+
return this._parseDataFile(path9, parser, options);
|
|
8303
8310
|
} else if (extension === "json") {
|
|
8304
8311
|
const parser = (content) => JSON.parse(content);
|
|
8305
|
-
return this._parseDataFile(
|
|
8312
|
+
return this._parseDataFile(path9, parser);
|
|
8306
8313
|
} else {
|
|
8307
8314
|
throw new TemplateDataParseError(
|
|
8308
|
-
`Could not find an appropriate data parser for ${
|
|
8315
|
+
`Could not find an appropriate data parser for ${path9}. Do you need to add a plugin to your config file?`
|
|
8309
8316
|
);
|
|
8310
8317
|
}
|
|
8311
8318
|
}
|
|
@@ -8374,16 +8381,6 @@ var TemplateData = class _TemplateData {
|
|
|
8374
8381
|
debug3("getLocalDataPaths(%o): %o", templatePath, paths);
|
|
8375
8382
|
return Unique(paths).reverse();
|
|
8376
8383
|
}
|
|
8377
|
-
static mergeDeep(deepMerge, target, ...source) {
|
|
8378
|
-
if (!deepMerge && deepMerge !== void 0) {
|
|
8379
|
-
return Object.assign(target, ...source);
|
|
8380
|
-
} else {
|
|
8381
|
-
return _TemplateData.merge(target, ...source);
|
|
8382
|
-
}
|
|
8383
|
-
}
|
|
8384
|
-
static merge(target, ...source) {
|
|
8385
|
-
return (0, import_eleventy_utils5.Merge)(target, ...source);
|
|
8386
|
-
}
|
|
8387
8384
|
/* Like cleanupData() but does not mutate */
|
|
8388
8385
|
static getCleanedTagsImmutable(data, options = {}) {
|
|
8389
8386
|
let tags = [];
|
|
@@ -8441,10 +8438,10 @@ var import_eleventy_utils24 = __toESM(require_eleventy_utils(), 1);
|
|
|
8441
8438
|
init_debug();
|
|
8442
8439
|
|
|
8443
8440
|
// ../../src/Template.js
|
|
8444
|
-
var
|
|
8441
|
+
var import_node_path8 = __toESM(require_path(), 1);
|
|
8445
8442
|
init_shim_consume_fs();
|
|
8446
8443
|
var import_lodash_custom8 = __toESM(require_lodash_custom(), 1);
|
|
8447
|
-
var
|
|
8444
|
+
var import_eleventy_utils20 = __toESM(require_eleventy_utils(), 1);
|
|
8448
8445
|
init_debug();
|
|
8449
8446
|
|
|
8450
8447
|
// ../../src/Util/ConsoleLogger.js
|
|
@@ -8544,45 +8541,51 @@ function spawnAsync() {
|
|
|
8544
8541
|
throw new Error("This feature is not supported in `@11ty/client` bundles.");
|
|
8545
8542
|
}
|
|
8546
8543
|
|
|
8547
|
-
// ../../src/Util/
|
|
8548
|
-
|
|
8544
|
+
// ../../src/Util/MemoizeFunction.js
|
|
8545
|
+
function MemoizeFunction_default(callback, options = {}) {
|
|
8546
|
+
let { bench, name } = options;
|
|
8547
|
+
let cache = /* @__PURE__ */ new Map();
|
|
8548
|
+
return (...args) => {
|
|
8549
|
+
if (args.filter(Boolean).length > 1) {
|
|
8550
|
+
bench?.get(`(count) ${name} Not valid for memoize`).incrementCount();
|
|
8551
|
+
return callback(...args);
|
|
8552
|
+
}
|
|
8553
|
+
let [cacheKey] = args;
|
|
8554
|
+
if (!cache.has(cacheKey)) {
|
|
8555
|
+
cache.set(cacheKey, callback(...args));
|
|
8556
|
+
bench?.get(`(count) ${name} memoize miss`).incrementCount();
|
|
8557
|
+
return cache.get(cacheKey);
|
|
8558
|
+
}
|
|
8559
|
+
bench?.get(`(count) ${name} memoize hit`).incrementCount();
|
|
8560
|
+
return cache.get(cacheKey);
|
|
8561
|
+
};
|
|
8562
|
+
}
|
|
8563
|
+
|
|
8564
|
+
// ../../src/Util/Git.js
|
|
8565
|
+
var getCreatedTimestamp = MemoizeFunction_default(async function(filePath) {
|
|
8549
8566
|
try {
|
|
8550
8567
|
let timestamp = await spawnAsync(
|
|
8551
8568
|
"git",
|
|
8552
8569
|
// Formats https://www.git-scm.com/docs/git-log#_pretty_formats
|
|
8553
8570
|
// %at author date, UNIX timestamp
|
|
8554
|
-
["log", "-1", "--format=%at", filePath]
|
|
8571
|
+
["log", "--diff-filter=A", "--follow", "-1", "--format=%at", filePath]
|
|
8555
8572
|
);
|
|
8556
8573
|
return parseInt(timestamp, 10) * 1e3;
|
|
8557
8574
|
} catch (e) {
|
|
8558
8575
|
}
|
|
8559
|
-
}
|
|
8560
|
-
async function
|
|
8561
|
-
let timestamp = await getGitLastUpdatedTimeStamp(inputPath);
|
|
8562
|
-
if (timestamp) {
|
|
8563
|
-
return new Date(timestamp);
|
|
8564
|
-
}
|
|
8565
|
-
}
|
|
8566
|
-
|
|
8567
|
-
// ../../src/Util/DateGitFirstAdded.js
|
|
8568
|
-
async function getGitFirstAddedTimeStamp(filePath) {
|
|
8576
|
+
});
|
|
8577
|
+
var getUpdatedTimestamp = MemoizeFunction_default(async function(filePath) {
|
|
8569
8578
|
try {
|
|
8570
8579
|
let timestamp = await spawnAsync(
|
|
8571
8580
|
"git",
|
|
8572
8581
|
// Formats https://www.git-scm.com/docs/git-log#_pretty_formats
|
|
8573
8582
|
// %at author date, UNIX timestamp
|
|
8574
|
-
["log", "
|
|
8583
|
+
["log", "-1", "--format=%at", filePath]
|
|
8575
8584
|
);
|
|
8576
8585
|
return parseInt(timestamp, 10) * 1e3;
|
|
8577
8586
|
} catch (e) {
|
|
8578
8587
|
}
|
|
8579
|
-
}
|
|
8580
|
-
async function DateGitFirstAdded_default(inputPath) {
|
|
8581
|
-
let timestamp = await getGitFirstAddedTimeStamp(inputPath);
|
|
8582
|
-
if (timestamp) {
|
|
8583
|
-
return new Date(timestamp);
|
|
8584
|
-
}
|
|
8585
|
-
}
|
|
8588
|
+
});
|
|
8586
8589
|
|
|
8587
8590
|
// ../../src/TemplateContent.js
|
|
8588
8591
|
init_shim_consume_fs();
|
|
@@ -8612,7 +8615,10 @@ function JavaScript_default(frontMatterCode, context = {}) {
|
|
|
8612
8615
|
let { filePath } = context;
|
|
8613
8616
|
let trimmed = frontMatterCode.trimStart();
|
|
8614
8617
|
if (trimmed.startsWith("{")) {
|
|
8615
|
-
return RetrieveGlobals(`export default ${trimmed}`, filePath
|
|
8618
|
+
return RetrieveGlobals(`export default ${trimmed}`, filePath, {
|
|
8619
|
+
isJavaScriptFrontMatterCompat: true
|
|
8620
|
+
// turns off implicit exports
|
|
8621
|
+
}).then((res) => {
|
|
8616
8622
|
return res.default;
|
|
8617
8623
|
});
|
|
8618
8624
|
}
|
|
@@ -8623,6 +8629,7 @@ function JavaScript_default(frontMatterCode, context = {}) {
|
|
|
8623
8629
|
var EOL = "\n";
|
|
8624
8630
|
|
|
8625
8631
|
// ../../src/TemplateRender.js
|
|
8632
|
+
init_debug();
|
|
8626
8633
|
init_EleventyBaseError();
|
|
8627
8634
|
|
|
8628
8635
|
// ../../src/Engines/TemplateEngineManager.js
|
|
@@ -8774,6 +8781,7 @@ var TemplateEngineManager = class _TemplateEngineManager {
|
|
|
8774
8781
|
var TemplateEngineManager_default = TemplateEngineManager;
|
|
8775
8782
|
|
|
8776
8783
|
// ../../src/TemplateRender.js
|
|
8784
|
+
var debugConfiguration = debug_default("Eleventy:UserConfig");
|
|
8777
8785
|
var TemplateRenderUnknownEngineError = class extends EleventyBaseError_default {
|
|
8778
8786
|
};
|
|
8779
8787
|
var TemplateRender = class _TemplateRender {
|
|
@@ -8786,6 +8794,12 @@ var TemplateRender = class _TemplateRender {
|
|
|
8786
8794
|
this.#setConfig(config);
|
|
8787
8795
|
this.engineNameOrPath = tmplPath;
|
|
8788
8796
|
this.parseMarkdownWith = this.config.markdownTemplateEngine;
|
|
8797
|
+
if (this.parseMarkdownWith === "md") {
|
|
8798
|
+
this.parseMarkdownWith = false;
|
|
8799
|
+
debugConfiguration(
|
|
8800
|
+
"Misconfiguration warning: the preprocessing template syntax for Markdown files cannot be Markdown, we\u2019re assuming you meant `false` to skip preprocessing altogether (via the `markdownTemplateEngine` configuration property or the `setMarkdownTemplateEngine` configuration method). Read more: https://www.11ty.dev/docs/config/#default-template-engine-for-markdown-files"
|
|
8801
|
+
);
|
|
8802
|
+
}
|
|
8789
8803
|
this.parseHtmlWith = this.config.htmlTemplateEngine;
|
|
8790
8804
|
}
|
|
8791
8805
|
#setConfig(config) {
|
|
@@ -9080,7 +9094,7 @@ var TemplateContent = class _TemplateContent {
|
|
|
9080
9094
|
#initialized = false;
|
|
9081
9095
|
#config;
|
|
9082
9096
|
#templateRender;
|
|
9083
|
-
#
|
|
9097
|
+
#renderPreprocessorEngine;
|
|
9084
9098
|
#extensionMap;
|
|
9085
9099
|
#configOptions;
|
|
9086
9100
|
#frontMatterOptions;
|
|
@@ -9102,7 +9116,7 @@ var TemplateContent = class _TemplateContent {
|
|
|
9102
9116
|
let preprocessorEngineName = this.templateRender.getPreprocessorEngineName();
|
|
9103
9117
|
if (preprocessorEngineName && this.templateRender.engine.getName() !== preprocessorEngineName) {
|
|
9104
9118
|
let engine = await this.templateRender.getEngineByName(preprocessorEngineName);
|
|
9105
|
-
this.#
|
|
9119
|
+
this.#renderPreprocessorEngine = engine;
|
|
9106
9120
|
}
|
|
9107
9121
|
}
|
|
9108
9122
|
resetCachedTemplate({ eleventyConfig }) {
|
|
@@ -9311,14 +9325,14 @@ var TemplateContent = class _TemplateContent {
|
|
|
9311
9325
|
}
|
|
9312
9326
|
/* Incremental builds cache the Template instances (in TemplateWriter) but
|
|
9313
9327
|
* these template specific caches are important for Pagination */
|
|
9314
|
-
static cache(
|
|
9315
|
-
this._inputCache.set(import_eleventy_utils7.TemplatePath.absolutePath(
|
|
9328
|
+
static cache(path9, content) {
|
|
9329
|
+
this._inputCache.set(import_eleventy_utils7.TemplatePath.absolutePath(path9), content);
|
|
9316
9330
|
}
|
|
9317
|
-
static getCached(
|
|
9318
|
-
return this._inputCache.get(import_eleventy_utils7.TemplatePath.absolutePath(
|
|
9331
|
+
static getCached(path9) {
|
|
9332
|
+
return this._inputCache.get(import_eleventy_utils7.TemplatePath.absolutePath(path9));
|
|
9319
9333
|
}
|
|
9320
|
-
static deleteFromInputCache(
|
|
9321
|
-
this._inputCache.delete(import_eleventy_utils7.TemplatePath.absolutePath(
|
|
9334
|
+
static deleteFromInputCache(path9) {
|
|
9335
|
+
this._inputCache.delete(import_eleventy_utils7.TemplatePath.absolutePath(path9));
|
|
9322
9336
|
}
|
|
9323
9337
|
// Used via clone
|
|
9324
9338
|
setInputContent(content) {
|
|
@@ -9389,6 +9403,9 @@ var TemplateContent = class _TemplateContent {
|
|
|
9389
9403
|
}
|
|
9390
9404
|
return this._frontMatterDataCache;
|
|
9391
9405
|
}
|
|
9406
|
+
getEngineNames(engineOverride) {
|
|
9407
|
+
return this.templateRender.getEnginesList(engineOverride);
|
|
9408
|
+
}
|
|
9392
9409
|
async getEngineOverride() {
|
|
9393
9410
|
return this.getFrontMatterData().then((data) => {
|
|
9394
9411
|
return data[this.config.keys.engineOverride];
|
|
@@ -9396,8 +9413,8 @@ var TemplateContent = class _TemplateContent {
|
|
|
9396
9413
|
}
|
|
9397
9414
|
// checks engines
|
|
9398
9415
|
isTemplateCacheable() {
|
|
9399
|
-
if (this.#
|
|
9400
|
-
return this.#
|
|
9416
|
+
if (this.#renderPreprocessorEngine) {
|
|
9417
|
+
return this.#renderPreprocessorEngine.cacheable;
|
|
9401
9418
|
}
|
|
9402
9419
|
return this.engine.cacheable;
|
|
9403
9420
|
}
|
|
@@ -9470,8 +9487,8 @@ var TemplateContent = class _TemplateContent {
|
|
|
9470
9487
|
}
|
|
9471
9488
|
getParseForSymbolsFunction(str) {
|
|
9472
9489
|
let engine = this.engine;
|
|
9473
|
-
if (this.#
|
|
9474
|
-
engine = this.#
|
|
9490
|
+
if (this.#renderPreprocessorEngine) {
|
|
9491
|
+
engine = this.#renderPreprocessorEngine;
|
|
9475
9492
|
}
|
|
9476
9493
|
if ("parseForSymbols" in engine) {
|
|
9477
9494
|
return () => {
|
|
@@ -9632,9 +9649,9 @@ var TemplateContent = class _TemplateContent {
|
|
|
9632
9649
|
};
|
|
9633
9650
|
TemplateContent._inputCache = /* @__PURE__ */ new Map();
|
|
9634
9651
|
TemplateContent._compileCache = /* @__PURE__ */ new Map();
|
|
9635
|
-
EventBus_default.on("eleventy.resourceModified", (
|
|
9636
|
-
TemplateContent.deleteFromInputCache(
|
|
9637
|
-
let normalized = import_eleventy_utils7.TemplatePath.addLeadingDotSlash(
|
|
9652
|
+
EventBus_default.on("eleventy.resourceModified", (path9) => {
|
|
9653
|
+
TemplateContent.deleteFromInputCache(path9);
|
|
9654
|
+
let normalized = import_eleventy_utils7.TemplatePath.addLeadingDotSlash(path9);
|
|
9638
9655
|
let compileCache = TemplateContent._compileCache.get(normalized);
|
|
9639
9656
|
if (compileCache) {
|
|
9640
9657
|
compileCache.clear();
|
|
@@ -9649,11 +9666,13 @@ var TemplateContent_default = TemplateContent;
|
|
|
9649
9666
|
var import_node_path3 = __toESM(require_path(), 1);
|
|
9650
9667
|
var import_eleventy_utils8 = __toESM(require_eleventy_utils(), 1);
|
|
9651
9668
|
var TemplatePermalink = class _TemplatePermalink {
|
|
9669
|
+
#dynamicPermalinkEnabled;
|
|
9652
9670
|
// `link` with template syntax should have already been rendered in Template.js
|
|
9653
|
-
constructor(link, extraSubdir) {
|
|
9671
|
+
constructor(link, extraSubdir, isDynamicPermalinkEnabled = true) {
|
|
9654
9672
|
let isLinkAnObject = (0, import_eleventy_utils8.isPlainObject)(link);
|
|
9655
9673
|
this._isRendered = true;
|
|
9656
9674
|
this._writeToFileSystem = true;
|
|
9675
|
+
this.#dynamicPermalinkEnabled = isDynamicPermalinkEnabled;
|
|
9657
9676
|
let buildLink;
|
|
9658
9677
|
if (isLinkAnObject) {
|
|
9659
9678
|
if ("build" in link) {
|
|
@@ -9682,7 +9701,7 @@ var TemplatePermalink = class _TemplatePermalink {
|
|
|
9682
9701
|
|
|
9683
9702
|
${buildLink.toString()}` : "";
|
|
9684
9703
|
throw new Error(
|
|
9685
|
-
|
|
9704
|
+
`Expected permalink value to be a string. Received \`${typeof buildLink}\` (dynamicPermalink: ${this.#dynamicPermalinkEnabled})${stringToString}`
|
|
9686
9705
|
);
|
|
9687
9706
|
}
|
|
9688
9707
|
this.buildLink = buildLink;
|
|
@@ -9780,15 +9799,15 @@ ${buildLink.toString()}` : "";
|
|
|
9780
9799
|
}
|
|
9781
9800
|
return folders[folders.length - 1] === base;
|
|
9782
9801
|
}
|
|
9783
|
-
static generate(dir, filenameNoExt, extraSubdir, fileExtension = "html") {
|
|
9784
|
-
let
|
|
9802
|
+
static generate(dir, filenameNoExt, extraSubdir, fileExtension = "html", isDynamicPermalinkEnabled) {
|
|
9803
|
+
let path9;
|
|
9785
9804
|
if (fileExtension === "html") {
|
|
9786
9805
|
let hasDupeFolder = _TemplatePermalink._hasDuplicateFolder(dir, filenameNoExt);
|
|
9787
|
-
|
|
9806
|
+
path9 = (dir ? dir + "/" : "") + (filenameNoExt !== "index" && !hasDupeFolder ? filenameNoExt + "/" : "") + "index.html";
|
|
9788
9807
|
} else {
|
|
9789
|
-
|
|
9808
|
+
path9 = (dir ? dir + "/" : "") + filenameNoExt + "." + fileExtension;
|
|
9790
9809
|
}
|
|
9791
|
-
return new _TemplatePermalink(
|
|
9810
|
+
return new _TemplatePermalink(path9, extraSubdir, isDynamicPermalinkEnabled);
|
|
9792
9811
|
}
|
|
9793
9812
|
};
|
|
9794
9813
|
var TemplatePermalink_default = TemplatePermalink;
|
|
@@ -9800,14 +9819,14 @@ init_debug();
|
|
|
9800
9819
|
// ../../src/TemplateLayoutPathResolver.js
|
|
9801
9820
|
var import_eleventy_utils9 = __toESM(require_eleventy_utils(), 1);
|
|
9802
9821
|
var TemplateLayoutPathResolver = class {
|
|
9803
|
-
constructor(
|
|
9822
|
+
constructor(path9, extensionMap, templateConfig) {
|
|
9804
9823
|
if (!templateConfig) {
|
|
9805
9824
|
throw new Error("Expected `templateConfig` in TemplateLayoutPathResolver constructor");
|
|
9806
9825
|
}
|
|
9807
9826
|
this.templateConfig = templateConfig;
|
|
9808
|
-
this.originalPath =
|
|
9827
|
+
this.originalPath = path9;
|
|
9809
9828
|
this.originalDisplayPath = import_eleventy_utils9.TemplatePath.join(this.layoutsDir, this.originalPath) + ` (via \`layout: ${this.originalPath}\`)`;
|
|
9810
|
-
this.path =
|
|
9829
|
+
this.path = path9;
|
|
9811
9830
|
this.aliases = {};
|
|
9812
9831
|
this.extensionMap = extensionMap;
|
|
9813
9832
|
if (!extensionMap) {
|
|
@@ -9974,6 +9993,29 @@ var LayoutCache_default = layoutCache;
|
|
|
9974
9993
|
|
|
9975
9994
|
// ../../src/TemplateLayout.js
|
|
9976
9995
|
var debugDev3 = debug_default("Dev:Eleventy:TemplateLayout");
|
|
9996
|
+
var CdataWrapper = class _CdataWrapper {
|
|
9997
|
+
static PREFIX = "<![CDATA[STARTRAW";
|
|
9998
|
+
static POSTFIX = "ENDRAW]]>";
|
|
9999
|
+
constructor(templateSyntax) {
|
|
10000
|
+
this.isEligible = _CdataWrapper.isEligible(templateSyntax);
|
|
10001
|
+
}
|
|
10002
|
+
// Markdown only
|
|
10003
|
+
static isEligible(templateSyntax) {
|
|
10004
|
+
return templateSyntax.split(",").includes("md");
|
|
10005
|
+
}
|
|
10006
|
+
wrap(content) {
|
|
10007
|
+
if (this.isEligible) {
|
|
10008
|
+
return _CdataWrapper.PREFIX + content + _CdataWrapper.POSTFIX;
|
|
10009
|
+
}
|
|
10010
|
+
return content;
|
|
10011
|
+
}
|
|
10012
|
+
unwrap(content) {
|
|
10013
|
+
if (this.isEligible) {
|
|
10014
|
+
return content.replaceAll(_CdataWrapper.PREFIX, "").replaceAll(_CdataWrapper.POSTFIX, "");
|
|
10015
|
+
}
|
|
10016
|
+
return content;
|
|
10017
|
+
}
|
|
10018
|
+
};
|
|
9977
10019
|
var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
|
|
9978
10020
|
constructor(key, extensionMap, eleventyConfig) {
|
|
9979
10021
|
if (!eleventyConfig || eleventyConfig.constructor.name !== "TemplateConfig") {
|
|
@@ -10070,7 +10112,7 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
|
|
|
10070
10112
|
for (let j = map.length - 1; j >= 0; j--) {
|
|
10071
10113
|
dataToMerge.push(map[j].frontMatterData);
|
|
10072
10114
|
}
|
|
10073
|
-
let data =
|
|
10115
|
+
let data = (0, import_eleventy_utils11.Merge)({}, ...dataToMerge);
|
|
10074
10116
|
delete data[this.config.keys.layout];
|
|
10075
10117
|
return data;
|
|
10076
10118
|
}
|
|
@@ -10096,6 +10138,8 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
|
|
|
10096
10138
|
let fns = [];
|
|
10097
10139
|
try {
|
|
10098
10140
|
fns.push({
|
|
10141
|
+
inputPath: this.inputPath,
|
|
10142
|
+
template: this,
|
|
10099
10143
|
render: await this.getCachedCompiledLayoutFunction()
|
|
10100
10144
|
});
|
|
10101
10145
|
if (layoutMap.length > 1) {
|
|
@@ -10131,12 +10175,14 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
|
|
|
10131
10175
|
async renderPageEntry(pageEntry) {
|
|
10132
10176
|
let templateContent = pageEntry.templateContent;
|
|
10133
10177
|
let compiledFunctions = await this.getCompiledLayoutFunctions();
|
|
10134
|
-
for (let { render } of compiledFunctions) {
|
|
10178
|
+
for (let { render, template } of compiledFunctions) {
|
|
10179
|
+
let templateSyntax = template.getEngineNames(pageEntry.data[this.config.keys.engineOverride]);
|
|
10180
|
+
let cdata = new CdataWrapper(templateSyntax);
|
|
10135
10181
|
let data = {
|
|
10136
|
-
content: templateContent,
|
|
10182
|
+
content: cdata.wrap(templateContent),
|
|
10137
10183
|
...pageEntry.data
|
|
10138
10184
|
};
|
|
10139
|
-
templateContent = await render(data);
|
|
10185
|
+
templateContent = cdata.unwrap(await render(data));
|
|
10140
10186
|
}
|
|
10141
10187
|
return templateContent;
|
|
10142
10188
|
}
|
|
@@ -10160,7 +10206,7 @@ var TemplateFileSlug = class {
|
|
|
10160
10206
|
inputPath = import_eleventy_utils12.TemplatePath.stripLeadingSubPath(inputPath, inputDir);
|
|
10161
10207
|
}
|
|
10162
10208
|
this.inputPath = inputPath;
|
|
10163
|
-
this.cleanInputPath =
|
|
10209
|
+
this.cleanInputPath = import_eleventy_utils12.TemplatePath.stripLeadingDotSlash(inputPath);
|
|
10164
10210
|
let dirs = this.cleanInputPath.split("/");
|
|
10165
10211
|
this.dirs = dirs;
|
|
10166
10212
|
this.dirs.pop();
|
|
@@ -10835,15 +10881,17 @@ var Pagination = class _Pagination {
|
|
|
10835
10881
|
let {
|
|
10836
10882
|
/*linkInstance,*/
|
|
10837
10883
|
rawPath,
|
|
10838
|
-
path:
|
|
10839
|
-
href
|
|
10884
|
+
path: path9,
|
|
10885
|
+
href,
|
|
10886
|
+
dir
|
|
10840
10887
|
} = await cloned.getOutputLocations(clonedData);
|
|
10841
10888
|
if (rawPath) {
|
|
10842
10889
|
links.push("/" + rawPath);
|
|
10843
10890
|
}
|
|
10844
10891
|
hrefs.push(href);
|
|
10845
10892
|
clonedData.page.url = href;
|
|
10846
|
-
clonedData.page.outputPath =
|
|
10893
|
+
clonedData.page.outputPath = path9;
|
|
10894
|
+
clonedData.page.dir = dir;
|
|
10847
10895
|
entries.push({
|
|
10848
10896
|
pageNumber,
|
|
10849
10897
|
// This is used by i18n Plugin to allow subgroups of nested pagination to be separate
|
|
@@ -11202,6 +11250,154 @@ var FileSystemManager = class {
|
|
|
11202
11250
|
}
|
|
11203
11251
|
};
|
|
11204
11252
|
|
|
11253
|
+
// ../../src/TemplatePreprocessors.js
|
|
11254
|
+
var TemplatePreprocessors = class {
|
|
11255
|
+
constructor(preprocessors) {
|
|
11256
|
+
this.preprocessors = preprocessors || [];
|
|
11257
|
+
}
|
|
11258
|
+
async runAll(template, data) {
|
|
11259
|
+
let { inputPath } = template;
|
|
11260
|
+
let content = await template.getPreRender();
|
|
11261
|
+
let skippedVia = false;
|
|
11262
|
+
for (let [name, preprocessor] of Object.entries(this.preprocessors)) {
|
|
11263
|
+
let { filter, callback } = preprocessor;
|
|
11264
|
+
let filters;
|
|
11265
|
+
if (Array.isArray(filter)) {
|
|
11266
|
+
filters = filter;
|
|
11267
|
+
} else if (typeof filter === "string") {
|
|
11268
|
+
filters = filter.split(",");
|
|
11269
|
+
} else {
|
|
11270
|
+
throw new Error(
|
|
11271
|
+
`Expected file extensions passed to "${name}" content preprocessor to be a string or array. Received: ${filter}`
|
|
11272
|
+
);
|
|
11273
|
+
}
|
|
11274
|
+
filters = filters.map((extension) => {
|
|
11275
|
+
if (extension.startsWith(".") || extension === "*") {
|
|
11276
|
+
return extension;
|
|
11277
|
+
}
|
|
11278
|
+
return `.${extension}`;
|
|
11279
|
+
});
|
|
11280
|
+
if (!filters.some((extension) => extension === "*" || inputPath.endsWith(extension))) {
|
|
11281
|
+
continue;
|
|
11282
|
+
}
|
|
11283
|
+
try {
|
|
11284
|
+
let ret = await callback.call(
|
|
11285
|
+
{
|
|
11286
|
+
inputPath
|
|
11287
|
+
},
|
|
11288
|
+
data,
|
|
11289
|
+
content
|
|
11290
|
+
);
|
|
11291
|
+
if (ret === false) {
|
|
11292
|
+
skippedVia = name;
|
|
11293
|
+
continue;
|
|
11294
|
+
}
|
|
11295
|
+
if (ret) {
|
|
11296
|
+
content = ret;
|
|
11297
|
+
}
|
|
11298
|
+
} catch (e) {
|
|
11299
|
+
throw new Error(
|
|
11300
|
+
`Preprocessor \`${name}\` encountered an error when transforming ${inputPath}.`,
|
|
11301
|
+
{ cause: e }
|
|
11302
|
+
);
|
|
11303
|
+
}
|
|
11304
|
+
}
|
|
11305
|
+
return {
|
|
11306
|
+
skippedVia,
|
|
11307
|
+
content
|
|
11308
|
+
};
|
|
11309
|
+
}
|
|
11310
|
+
};
|
|
11311
|
+
|
|
11312
|
+
// ../../src/Util/PathNormalizer.js
|
|
11313
|
+
var import_node_path7 = __toESM(require_path(), 1);
|
|
11314
|
+
var import_eleventy_utils19 = __toESM(require_eleventy_utils(), 1);
|
|
11315
|
+
|
|
11316
|
+
// ../../src/Adapters/Packages/url.core.js
|
|
11317
|
+
var import_node_path6 = __toESM(require_path());
|
|
11318
|
+
function fileURLToPath(url) {
|
|
11319
|
+
if (typeof url === "string") {
|
|
11320
|
+
url = new URL(url);
|
|
11321
|
+
}
|
|
11322
|
+
if (url.protocol !== "file:") {
|
|
11323
|
+
throw new Error("The URL must use the file: protocol");
|
|
11324
|
+
}
|
|
11325
|
+
if (url.hostname) {
|
|
11326
|
+
throw new Error("The file: URL host must be 'localhost' or empty");
|
|
11327
|
+
}
|
|
11328
|
+
if (/%2f/i.test(url.pathname)) {
|
|
11329
|
+
throw new Error("The file: URL path must not include encoded / characters");
|
|
11330
|
+
}
|
|
11331
|
+
return import_node_path6.default.normalize(decodeURIComponent(url.pathname));
|
|
11332
|
+
}
|
|
11333
|
+
|
|
11334
|
+
// ../../src/Util/PathNormalizer.js
|
|
11335
|
+
var PathNormalizer = class {
|
|
11336
|
+
static getParts(inputPath) {
|
|
11337
|
+
if (!inputPath) {
|
|
11338
|
+
return [];
|
|
11339
|
+
}
|
|
11340
|
+
let separator = "/";
|
|
11341
|
+
if (inputPath.includes(import_node_path7.sep)) {
|
|
11342
|
+
separator = import_node_path7.sep;
|
|
11343
|
+
}
|
|
11344
|
+
return inputPath.split(separator).filter((entry) => entry !== ".");
|
|
11345
|
+
}
|
|
11346
|
+
// order is important here: the top-most directory returns first
|
|
11347
|
+
// array of file and all parent directories
|
|
11348
|
+
static getAllPaths(inputPath) {
|
|
11349
|
+
let parts = this.getParts(inputPath);
|
|
11350
|
+
let allPaths = [];
|
|
11351
|
+
let fullpath = "";
|
|
11352
|
+
for (let part of parts) {
|
|
11353
|
+
fullpath += (fullpath.length > 0 ? "/" : "") + part;
|
|
11354
|
+
allPaths.push(fullpath);
|
|
11355
|
+
}
|
|
11356
|
+
return allPaths;
|
|
11357
|
+
}
|
|
11358
|
+
static normalizeSeperator(inputPath) {
|
|
11359
|
+
if (!inputPath) {
|
|
11360
|
+
return inputPath;
|
|
11361
|
+
}
|
|
11362
|
+
return inputPath.split(import_node_path7.sep).join("/");
|
|
11363
|
+
}
|
|
11364
|
+
static addTrailingSlashToDirectory(dir) {
|
|
11365
|
+
if (dir.endsWith("/")) {
|
|
11366
|
+
return dir;
|
|
11367
|
+
}
|
|
11368
|
+
return dir + "/";
|
|
11369
|
+
}
|
|
11370
|
+
// returns a path
|
|
11371
|
+
static getDirectoryFromFilePath(filePath) {
|
|
11372
|
+
let parsed = (0, import_node_path7.parse)(filePath);
|
|
11373
|
+
return this.addTrailingSlashToDirectory(parsed.dir);
|
|
11374
|
+
}
|
|
11375
|
+
static fullNormalization(inputPath) {
|
|
11376
|
+
if (typeof inputPath !== "string") {
|
|
11377
|
+
return inputPath;
|
|
11378
|
+
}
|
|
11379
|
+
if (inputPath.startsWith("file://")) {
|
|
11380
|
+
inputPath = fileURLToPath(inputPath);
|
|
11381
|
+
}
|
|
11382
|
+
return import_eleventy_utils19.TemplatePath.stripLeadingDotSlash(
|
|
11383
|
+
this.normalizeSeperator(import_eleventy_utils19.TemplatePath.relativePath(inputPath))
|
|
11384
|
+
);
|
|
11385
|
+
}
|
|
11386
|
+
};
|
|
11387
|
+
|
|
11388
|
+
// ../../src/Util/UrlUtil.js
|
|
11389
|
+
function getDirectoryFromUrl(url) {
|
|
11390
|
+
if (url === false) {
|
|
11391
|
+
return false;
|
|
11392
|
+
}
|
|
11393
|
+
if (url.endsWith("/")) {
|
|
11394
|
+
return url;
|
|
11395
|
+
}
|
|
11396
|
+
let parts = url.split("/");
|
|
11397
|
+
parts.pop();
|
|
11398
|
+
return parts.join("/") + "/";
|
|
11399
|
+
}
|
|
11400
|
+
|
|
11205
11401
|
// ../../src/Template.js
|
|
11206
11402
|
var { set: lodashSet8, get: lodashGet5 } = import_lodash_custom8.default;
|
|
11207
11403
|
var debug13 = debug_default("Eleventy:Template");
|
|
@@ -11210,10 +11406,11 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11210
11406
|
#logger;
|
|
11211
11407
|
#fsManager;
|
|
11212
11408
|
#stats;
|
|
11409
|
+
#preprocessorCache;
|
|
11213
11410
|
constructor(templatePath, templateData, extensionMap, config) {
|
|
11214
11411
|
debugDev4("new Template(%o)", templatePath);
|
|
11215
11412
|
super(templatePath, config);
|
|
11216
|
-
this.parsed =
|
|
11413
|
+
this.parsed = (0, import_node_path8.parse)(templatePath);
|
|
11217
11414
|
this.extraOutputSubdirectory = "";
|
|
11218
11415
|
this.extensionMap = extensionMap;
|
|
11219
11416
|
this.templateData = templateData;
|
|
@@ -11229,6 +11426,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11229
11426
|
this.outputFormat = "fs";
|
|
11230
11427
|
this.behavior = new TemplateBehavior_default(this.config);
|
|
11231
11428
|
this.behavior.setOutputFormat(this.outputFormat);
|
|
11429
|
+
this.templatePreprocessor = new TemplatePreprocessors(this.config.preprocessors);
|
|
11232
11430
|
}
|
|
11233
11431
|
#initFileSlug() {
|
|
11234
11432
|
this.fileSlug = new TemplateFileSlug_default(this.inputPath, this.extensionMap, this.eleventyConfig);
|
|
@@ -11278,6 +11476,9 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11278
11476
|
resetCaches(types) {
|
|
11279
11477
|
types = this.getResetTypes(types);
|
|
11280
11478
|
super.resetCaches(types);
|
|
11479
|
+
if (types.data || types.read) {
|
|
11480
|
+
this.#preprocessorCache = void 0;
|
|
11481
|
+
}
|
|
11281
11482
|
if (types.data) {
|
|
11282
11483
|
delete this._dataCache;
|
|
11283
11484
|
}
|
|
@@ -11305,12 +11506,12 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11305
11506
|
this.extraOutputSubdirectory = dir + "/";
|
|
11306
11507
|
}
|
|
11307
11508
|
getTemplateSubfolder() {
|
|
11308
|
-
let dir =
|
|
11309
|
-
let inputDir =
|
|
11509
|
+
let dir = import_eleventy_utils20.TemplatePath.absolutePath(this.parsed.dir);
|
|
11510
|
+
let inputDir = import_eleventy_utils20.TemplatePath.absolutePath(this.inputDir);
|
|
11310
11511
|
if (inputDir === "/" && dir.startsWith("/")) {
|
|
11311
11512
|
return dir;
|
|
11312
11513
|
}
|
|
11313
|
-
return
|
|
11514
|
+
return import_eleventy_utils20.TemplatePath.stripLeadingSubPath(dir, inputDir);
|
|
11314
11515
|
}
|
|
11315
11516
|
templateUsesLayouts(pageData) {
|
|
11316
11517
|
if (this.hasTemplateRender()) {
|
|
@@ -11331,25 +11532,20 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11331
11532
|
get baseFile() {
|
|
11332
11533
|
return this.extensionMap.removeTemplateExtension(this.parsed.base);
|
|
11333
11534
|
}
|
|
11334
|
-
async _getRawPermalinkInstance(permalinkValue) {
|
|
11335
|
-
let perm = new TemplatePermalink_default(permalinkValue, this.extraOutputSubdirectory);
|
|
11336
|
-
perm.setUrlTransforms(this.config.urlTransforms);
|
|
11337
|
-
this.behavior.setFromPermalink(perm);
|
|
11338
|
-
return perm;
|
|
11339
|
-
}
|
|
11340
11535
|
async _getLink(data) {
|
|
11341
11536
|
if (!data) {
|
|
11342
11537
|
throw new Error("Internal error: data argument missing in Template->_getLink");
|
|
11343
11538
|
}
|
|
11344
11539
|
let permalink = data[this.config.keys.permalink] ?? data?.[this.config.keys.computed]?.[this.config.keys.permalink];
|
|
11345
11540
|
let permalinkValue;
|
|
11541
|
+
let isDynamicPermalinkEnabled = this.config.dynamicPermalinks && data.dynamicPermalink !== false;
|
|
11346
11542
|
if (typeof permalink === "boolean") {
|
|
11347
11543
|
debugDev4("Using boolean permalink %o", permalink);
|
|
11348
11544
|
permalinkValue = permalink;
|
|
11349
|
-
} else if (permalink &&
|
|
11545
|
+
} else if (permalink && !isDynamicPermalinkEnabled) {
|
|
11350
11546
|
debugDev4("Not using dynamic permalinks, using %o", permalink);
|
|
11351
11547
|
permalinkValue = permalink;
|
|
11352
|
-
} else if ((0,
|
|
11548
|
+
} else if ((0, import_eleventy_utils20.isPlainObject)(permalink)) {
|
|
11353
11549
|
let isEmptyObject = Object.keys(permalink).length === 0;
|
|
11354
11550
|
if (!isEmptyObject) {
|
|
11355
11551
|
let promises2 = [];
|
|
@@ -11383,7 +11579,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11383
11579
|
debug13("Rendering permalink for %o: %s becomes %o", this.inputPath, permalink, permalinkValue);
|
|
11384
11580
|
debugDev4("Permalink rendered with data: %o", data);
|
|
11385
11581
|
}
|
|
11386
|
-
if (!permalink &&
|
|
11582
|
+
if (!permalink && isDynamicPermalinkEnabled) {
|
|
11387
11583
|
let tr = await this.getTemplateRender();
|
|
11388
11584
|
let permalinkCompilation = tr.engine.permalinkNeedsCompilation("");
|
|
11389
11585
|
if (typeof permalinkCompilation === "function") {
|
|
@@ -11398,13 +11594,21 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11398
11594
|
}
|
|
11399
11595
|
}
|
|
11400
11596
|
if (permalinkValue !== void 0) {
|
|
11401
|
-
|
|
11597
|
+
let p2 = new TemplatePermalink_default(
|
|
11598
|
+
permalinkValue,
|
|
11599
|
+
this.extraOutputSubdirectory,
|
|
11600
|
+
isDynamicPermalinkEnabled
|
|
11601
|
+
);
|
|
11602
|
+
p2.setUrlTransforms(this.config.urlTransforms);
|
|
11603
|
+
this.behavior.setFromPermalink(p2);
|
|
11604
|
+
return p2;
|
|
11402
11605
|
}
|
|
11403
11606
|
let p = TemplatePermalink_default.generate(
|
|
11404
11607
|
this.getTemplateSubfolder(),
|
|
11405
11608
|
this.baseFile,
|
|
11406
11609
|
this.extraOutputSubdirectory,
|
|
11407
|
-
this.engine.defaultTemplateFileExtension
|
|
11610
|
+
this.engine.defaultTemplateFileExtension,
|
|
11611
|
+
isDynamicPermalinkEnabled
|
|
11408
11612
|
);
|
|
11409
11613
|
p.setUrlTransforms(this.config.urlTransforms);
|
|
11410
11614
|
return p;
|
|
@@ -11419,17 +11623,21 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11419
11623
|
async getOutputLocations(data) {
|
|
11420
11624
|
this.bench.get("(count) getOutputLocations").incrementCount();
|
|
11421
11625
|
let link = await this._getLink(data);
|
|
11422
|
-
let
|
|
11626
|
+
let path9;
|
|
11423
11627
|
if (await this.usePermalinkRoot()) {
|
|
11424
|
-
|
|
11628
|
+
path9 = link.toPathFromRoot();
|
|
11425
11629
|
} else {
|
|
11426
|
-
|
|
11630
|
+
path9 = link.toPath(this.outputDir);
|
|
11427
11631
|
}
|
|
11632
|
+
let href = link.toHref();
|
|
11428
11633
|
return {
|
|
11429
11634
|
linkInstance: link,
|
|
11430
11635
|
rawPath: link.toOutputPath(),
|
|
11431
|
-
|
|
11432
|
-
|
|
11636
|
+
// includes output directory
|
|
11637
|
+
href,
|
|
11638
|
+
path: path9,
|
|
11639
|
+
dir: getDirectoryFromUrl(href)
|
|
11640
|
+
// for `page.dir`
|
|
11433
11641
|
};
|
|
11434
11642
|
}
|
|
11435
11643
|
// This is likely now a test-only method
|
|
@@ -11483,14 +11691,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11483
11691
|
}
|
|
11484
11692
|
}
|
|
11485
11693
|
try {
|
|
11486
|
-
let mergedData =
|
|
11487
|
-
this.config.dataDeepMerge,
|
|
11488
|
-
{},
|
|
11489
|
-
globalData,
|
|
11490
|
-
mergedLayoutData,
|
|
11491
|
-
localData,
|
|
11492
|
-
frontMatterData
|
|
11493
|
-
);
|
|
11694
|
+
let mergedData = (0, import_eleventy_utils20.Merge)({}, globalData, mergedLayoutData, localData, frontMatterData);
|
|
11494
11695
|
if (this.config.freezeReservedData) {
|
|
11495
11696
|
ReservedData_default.check(mergedData);
|
|
11496
11697
|
}
|
|
@@ -11518,12 +11719,11 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11518
11719
|
data.page = {};
|
|
11519
11720
|
}
|
|
11520
11721
|
data.page.inputPath = this.inputPath;
|
|
11722
|
+
data.page.inputPathDir = PathNormalizer.getDirectoryFromFilePath(this.inputPath);
|
|
11521
11723
|
data.page.fileSlug = this.fileSlugStr;
|
|
11522
11724
|
data.page.filePathStem = this.filePathStem;
|
|
11523
11725
|
data.page.outputFileExtension = this.engine.defaultTemplateFileExtension;
|
|
11524
|
-
data.page.templateSyntax = this.
|
|
11525
|
-
data[this.config.keys.engineOverride]
|
|
11526
|
-
);
|
|
11726
|
+
data.page.templateSyntax = this.getEngineNames(data[this.config.keys.engineOverride]);
|
|
11527
11727
|
let newDate = await this.getMappedDate(data);
|
|
11528
11728
|
if (newDate) {
|
|
11529
11729
|
data.page.date = newDate;
|
|
@@ -11549,7 +11749,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11549
11749
|
return this._cacheRenderedPromise;
|
|
11550
11750
|
}
|
|
11551
11751
|
setLinters(linters) {
|
|
11552
|
-
if (!(0,
|
|
11752
|
+
if (!(0, import_eleventy_utils20.isPlainObject)(linters)) {
|
|
11553
11753
|
throw new Error("Object expected in setLinters");
|
|
11554
11754
|
}
|
|
11555
11755
|
this.linters = [];
|
|
@@ -11578,7 +11778,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11578
11778
|
}
|
|
11579
11779
|
}
|
|
11580
11780
|
setTransforms(transforms) {
|
|
11581
|
-
if (!(0,
|
|
11781
|
+
if (!(0, import_eleventy_utils20.isPlainObject)(transforms)) {
|
|
11582
11782
|
throw new Error("Object expected in setTransforms");
|
|
11583
11783
|
}
|
|
11584
11784
|
this.transforms = transforms;
|
|
@@ -11592,7 +11792,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11592
11792
|
if (typeof entry === "string") {
|
|
11593
11793
|
return this.renderComputedData(entry, data);
|
|
11594
11794
|
}
|
|
11595
|
-
if ((0,
|
|
11795
|
+
if ((0, import_eleventy_utils20.isPlainObject)(entry)) {
|
|
11596
11796
|
for (let key in entry) {
|
|
11597
11797
|
entry[key] = await this.#renderComputedUnit(entry[key], data);
|
|
11598
11798
|
}
|
|
@@ -11617,7 +11817,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11617
11817
|
this.getParseForSymbolsFunction(obj),
|
|
11618
11818
|
this
|
|
11619
11819
|
);
|
|
11620
|
-
} else if ((0,
|
|
11820
|
+
} else if ((0, import_eleventy_utils20.isPlainObject)(obj)) {
|
|
11621
11821
|
for (let key in obj) {
|
|
11622
11822
|
let keys = [];
|
|
11623
11823
|
if (parentKey) {
|
|
@@ -11631,7 +11831,7 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11631
11831
|
}
|
|
11632
11832
|
}
|
|
11633
11833
|
async addComputedData(data) {
|
|
11634
|
-
if ((0,
|
|
11834
|
+
if ((0, import_eleventy_utils20.isPlainObject)(data?.[this.config.keys.computed])) {
|
|
11635
11835
|
this.computedData = new ComputedData_default(this.config);
|
|
11636
11836
|
this.computedData.addTemplateString(
|
|
11637
11837
|
"page.url",
|
|
@@ -11668,9 +11868,10 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11668
11868
|
if (data.page.url && data.page.outputPath) {
|
|
11669
11869
|
return;
|
|
11670
11870
|
}
|
|
11671
|
-
let { href, path:
|
|
11871
|
+
let { href, path: path9, dir } = await this.getOutputLocations(data);
|
|
11672
11872
|
data.page.url = href;
|
|
11673
|
-
data.page.outputPath =
|
|
11873
|
+
data.page.outputPath = path9;
|
|
11874
|
+
data.page.dir = dir;
|
|
11674
11875
|
}
|
|
11675
11876
|
}
|
|
11676
11877
|
// Computed data consuming collections!
|
|
@@ -11727,69 +11928,19 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
11727
11928
|
}
|
|
11728
11929
|
});
|
|
11729
11930
|
}
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
let { filter, callback } = preprocessor;
|
|
11734
|
-
let filters;
|
|
11735
|
-
if (Array.isArray(filter)) {
|
|
11736
|
-
filters = filter;
|
|
11737
|
-
} else if (typeof filter === "string") {
|
|
11738
|
-
filters = filter.split(",");
|
|
11739
|
-
} else {
|
|
11740
|
-
throw new Error(
|
|
11741
|
-
`Expected file extensions passed to "${name}" content preprocessor to be a string or array. Received: ${filter}`
|
|
11742
|
-
);
|
|
11743
|
-
}
|
|
11744
|
-
filters = filters.map((extension) => {
|
|
11745
|
-
if (extension.startsWith(".") || extension === "*") {
|
|
11746
|
-
return extension;
|
|
11747
|
-
}
|
|
11748
|
-
return `.${extension}`;
|
|
11749
|
-
});
|
|
11750
|
-
if (!filters.some((extension) => extension === "*" || inputPath.endsWith(extension))) {
|
|
11751
|
-
continue;
|
|
11752
|
-
}
|
|
11753
|
-
try {
|
|
11754
|
-
let ret = await callback.call(
|
|
11755
|
-
{
|
|
11756
|
-
inputPath
|
|
11757
|
-
},
|
|
11758
|
-
data,
|
|
11759
|
-
content
|
|
11760
|
-
);
|
|
11761
|
-
if (ret === false) {
|
|
11762
|
-
skippedVia = name;
|
|
11763
|
-
continue;
|
|
11764
|
-
}
|
|
11765
|
-
if (ret) {
|
|
11766
|
-
content = ret;
|
|
11767
|
-
}
|
|
11768
|
-
} catch (e) {
|
|
11769
|
-
throw new EleventyBaseError_default(
|
|
11770
|
-
`Preprocessor \`${name}\` encountered an error when transforming ${inputPath}.`,
|
|
11771
|
-
e
|
|
11772
|
-
);
|
|
11773
|
-
}
|
|
11931
|
+
async runPreprocessors(data) {
|
|
11932
|
+
if (!this.#preprocessorCache) {
|
|
11933
|
+
this.#preprocessorCache = this.templatePreprocessor.runAll(this, data);
|
|
11774
11934
|
}
|
|
11775
|
-
return
|
|
11776
|
-
skippedVia,
|
|
11777
|
-
content
|
|
11778
|
-
};
|
|
11935
|
+
return this.#preprocessorCache;
|
|
11779
11936
|
}
|
|
11780
11937
|
async getTemplates(data) {
|
|
11781
|
-
let content = await this.
|
|
11782
|
-
|
|
11783
|
-
this.inputPath,
|
|
11784
|
-
content,
|
|
11785
|
-
data,
|
|
11786
|
-
this.config.preprocessors
|
|
11787
|
-
);
|
|
11788
|
-
if (skippedVia) {
|
|
11938
|
+
let { skippedVia: skippedViaPreprocessorName, content: rawInput } = await this.runPreprocessors(data);
|
|
11939
|
+
if (skippedViaPreprocessorName) {
|
|
11789
11940
|
debug13(
|
|
11790
11941
|
"Skipping %o, the %o preprocessor returned an explicit `false`",
|
|
11791
11942
|
this.inputPath,
|
|
11792
|
-
|
|
11943
|
+
skippedViaPreprocessorName
|
|
11793
11944
|
);
|
|
11794
11945
|
return [];
|
|
11795
11946
|
}
|
|
@@ -12027,9 +12178,13 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
12027
12178
|
}
|
|
12028
12179
|
if (!this.isVirtualTemplate()) {
|
|
12029
12180
|
if (dateValue.toLowerCase() === "git last modified") {
|
|
12030
|
-
let
|
|
12031
|
-
if (
|
|
12032
|
-
|
|
12181
|
+
let timestamp = await getUpdatedTimestamp(this.inputPath);
|
|
12182
|
+
if (timestamp) {
|
|
12183
|
+
debug13(
|
|
12184
|
+
`getMappedDate: found git last modified timestamp for ${this.inputPath}: %o`,
|
|
12185
|
+
timestamp
|
|
12186
|
+
);
|
|
12187
|
+
return new Date(timestamp);
|
|
12033
12188
|
}
|
|
12034
12189
|
return /* @__PURE__ */ new Date();
|
|
12035
12190
|
}
|
|
@@ -12037,9 +12192,13 @@ var Template = class _Template extends TemplateContent_default {
|
|
|
12037
12192
|
return this._getDateInstance("ctimeMs");
|
|
12038
12193
|
}
|
|
12039
12194
|
if (dateValue.toLowerCase() === "git created") {
|
|
12040
|
-
let
|
|
12041
|
-
if (
|
|
12042
|
-
|
|
12195
|
+
let timestamp = await getCreatedTimestamp(this.inputPath);
|
|
12196
|
+
if (timestamp) {
|
|
12197
|
+
debug13(
|
|
12198
|
+
`getMappedDate: found git created timestamp for ${this.inputPath}: %o`,
|
|
12199
|
+
timestamp
|
|
12200
|
+
);
|
|
12201
|
+
return new Date(timestamp);
|
|
12043
12202
|
}
|
|
12044
12203
|
return /* @__PURE__ */ new Date();
|
|
12045
12204
|
}
|
|
@@ -12085,7 +12244,7 @@ var import_eleventy_utils23 = __toESM(require_eleventy_utils(), 1);
|
|
|
12085
12244
|
init_debug();
|
|
12086
12245
|
|
|
12087
12246
|
// ../../src/TemplateCollection.js
|
|
12088
|
-
var
|
|
12247
|
+
var import_eleventy_utils21 = __toESM(require_eleventy_utils(), 1);
|
|
12089
12248
|
|
|
12090
12249
|
// ../../src/Util/Objects/Sortable.js
|
|
12091
12250
|
var Sortable = class _Sortable {
|
|
@@ -12232,7 +12391,7 @@ var TemplateCollection = class extends Sortable_default {
|
|
|
12232
12391
|
if (typeof globs === "string") {
|
|
12233
12392
|
globs = [globs];
|
|
12234
12393
|
}
|
|
12235
|
-
globs = globs.map((glob) =>
|
|
12394
|
+
globs = globs.map((glob) => import_eleventy_utils21.TemplatePath.addLeadingDotSlash(glob));
|
|
12236
12395
|
return globs;
|
|
12237
12396
|
}
|
|
12238
12397
|
getFilteredByGlob(globs) {
|
|
@@ -12277,9 +12436,6 @@ var UsingCircularTemplateContentReferenceError = class extends EleventyBaseError
|
|
|
12277
12436
|
};
|
|
12278
12437
|
var UsingCircularTemplateContentReferenceError_default = UsingCircularTemplateContentReferenceError;
|
|
12279
12438
|
|
|
12280
|
-
// ../../src/TemplateMap.js
|
|
12281
|
-
init_EleventyBaseError();
|
|
12282
|
-
|
|
12283
12439
|
// ../../src/Errors/DuplicatePermalinkOutputError.js
|
|
12284
12440
|
init_EleventyBaseError();
|
|
12285
12441
|
var DuplicatePermalinkOutputError = class extends EleventyBaseError_default {
|
|
@@ -12301,71 +12457,6 @@ var JavaScriptDependencies = class {
|
|
|
12301
12457
|
};
|
|
12302
12458
|
var JavaScriptDependencies_core_default = JavaScriptDependencies;
|
|
12303
12459
|
|
|
12304
|
-
// ../../src/Util/PathNormalizer.js
|
|
12305
|
-
var import_node_path8 = __toESM(require_path(), 1);
|
|
12306
|
-
var import_eleventy_utils21 = __toESM(require_eleventy_utils(), 1);
|
|
12307
|
-
|
|
12308
|
-
// ../../src/Adapters/Packages/url.core.js
|
|
12309
|
-
var import_node_path7 = __toESM(require_path());
|
|
12310
|
-
function fileURLToPath(url) {
|
|
12311
|
-
if (typeof url === "string") {
|
|
12312
|
-
url = new URL(url);
|
|
12313
|
-
}
|
|
12314
|
-
if (url.protocol !== "file:") {
|
|
12315
|
-
throw new Error("The URL must use the file: protocol");
|
|
12316
|
-
}
|
|
12317
|
-
if (url.hostname) {
|
|
12318
|
-
throw new Error("The file: URL host must be 'localhost' or empty");
|
|
12319
|
-
}
|
|
12320
|
-
if (/%2f/i.test(url.pathname)) {
|
|
12321
|
-
throw new Error("The file: URL path must not include encoded / characters");
|
|
12322
|
-
}
|
|
12323
|
-
return import_node_path7.default.normalize(decodeURIComponent(url.pathname));
|
|
12324
|
-
}
|
|
12325
|
-
|
|
12326
|
-
// ../../src/Util/PathNormalizer.js
|
|
12327
|
-
var PathNormalizer = class {
|
|
12328
|
-
static getParts(inputPath) {
|
|
12329
|
-
if (!inputPath) {
|
|
12330
|
-
return [];
|
|
12331
|
-
}
|
|
12332
|
-
let separator = "/";
|
|
12333
|
-
if (inputPath.includes(import_node_path8.default.sep)) {
|
|
12334
|
-
separator = import_node_path8.default.sep;
|
|
12335
|
-
}
|
|
12336
|
-
return inputPath.split(separator).filter((entry) => entry !== ".");
|
|
12337
|
-
}
|
|
12338
|
-
// order is important here: the top-most directory returns first
|
|
12339
|
-
// array of file and all parent directories
|
|
12340
|
-
static getAllPaths(inputPath) {
|
|
12341
|
-
let parts = this.getParts(inputPath);
|
|
12342
|
-
let allPaths = [];
|
|
12343
|
-
let fullpath = "";
|
|
12344
|
-
for (let part of parts) {
|
|
12345
|
-
fullpath += (fullpath.length > 0 ? "/" : "") + part;
|
|
12346
|
-
allPaths.push(fullpath);
|
|
12347
|
-
}
|
|
12348
|
-
return allPaths;
|
|
12349
|
-
}
|
|
12350
|
-
static normalizeSeperator(inputPath) {
|
|
12351
|
-
if (!inputPath) {
|
|
12352
|
-
return inputPath;
|
|
12353
|
-
}
|
|
12354
|
-
return inputPath.split(import_node_path8.default.sep).join("/");
|
|
12355
|
-
}
|
|
12356
|
-
static fullNormalization(inputPath) {
|
|
12357
|
-
if (typeof inputPath !== "string") {
|
|
12358
|
-
return inputPath;
|
|
12359
|
-
}
|
|
12360
|
-
if (inputPath.startsWith("file://")) {
|
|
12361
|
-
inputPath = fileURLToPath(inputPath);
|
|
12362
|
-
}
|
|
12363
|
-
return import_eleventy_utils21.TemplatePath.stripLeadingDotSlash(
|
|
12364
|
-
this.normalizeSeperator(import_eleventy_utils21.TemplatePath.relativePath(inputPath))
|
|
12365
|
-
);
|
|
12366
|
-
}
|
|
12367
|
-
};
|
|
12368
|
-
|
|
12369
12460
|
// ../../src/Util/TemplateDepGraph.js
|
|
12370
12461
|
var import_dependency_graph2 = __toESM(require_dep_graph(), 1);
|
|
12371
12462
|
init_debug();
|
|
@@ -12828,10 +12919,6 @@ var GlobalDependencyMap_default = GlobalDependencyMap;
|
|
|
12828
12919
|
|
|
12829
12920
|
// ../../src/TemplateMap.js
|
|
12830
12921
|
var debug16 = debug_default("Eleventy:TemplateMap");
|
|
12831
|
-
var EleventyMapPagesError = class extends EleventyBaseError_default {
|
|
12832
|
-
};
|
|
12833
|
-
var EleventyDataSchemaError = class extends EleventyBaseError_default {
|
|
12834
|
-
};
|
|
12835
12922
|
var EXTENSIONLESS_URL_ALLOWLIST = [
|
|
12836
12923
|
"/_redirects",
|
|
12837
12924
|
// Netlify specific
|
|
@@ -12852,6 +12939,7 @@ var TemplateMap = class {
|
|
|
12852
12939
|
}
|
|
12853
12940
|
this.eleventyConfig = eleventyConfig;
|
|
12854
12941
|
this.map = [];
|
|
12942
|
+
this.inputPathMap = /* @__PURE__ */ new Map();
|
|
12855
12943
|
this.collectionsData = null;
|
|
12856
12944
|
this.cached = false;
|
|
12857
12945
|
this.verboseOutput = true;
|
|
@@ -12878,13 +12966,22 @@ var TemplateMap = class {
|
|
|
12878
12966
|
}
|
|
12879
12967
|
let data = await template.getData();
|
|
12880
12968
|
let entries = await template.getTemplateMapEntries(data);
|
|
12969
|
+
let { skippedVia } = await template.runPreprocessors(data);
|
|
12970
|
+
if (skippedVia) {
|
|
12971
|
+
return;
|
|
12972
|
+
}
|
|
12881
12973
|
for (let map of entries) {
|
|
12882
12974
|
this.map.push(map);
|
|
12975
|
+
this._addToInputPathMap(map);
|
|
12883
12976
|
}
|
|
12884
12977
|
}
|
|
12885
12978
|
getMap() {
|
|
12886
12979
|
return this.map;
|
|
12887
12980
|
}
|
|
12981
|
+
_addToInputPathMap(mapEntry) {
|
|
12982
|
+
let absoluteInputPath = import_eleventy_utils23.TemplatePath.absolutePath(mapEntry.inputPath);
|
|
12983
|
+
this.inputPathMap.set(absoluteInputPath, mapEntry);
|
|
12984
|
+
}
|
|
12888
12985
|
getTagTarget(str) {
|
|
12889
12986
|
if (str === "collections") {
|
|
12890
12987
|
return SPECIAL_COLLECTION_NAMES.keys;
|
|
@@ -12960,10 +13057,7 @@ var TemplateMap = class {
|
|
|
12960
13057
|
try {
|
|
12961
13058
|
map._pages = await map.template.getTemplates(map.data);
|
|
12962
13059
|
} catch (e) {
|
|
12963
|
-
throw new
|
|
12964
|
-
"Error generating template page(s) for " + map.inputPath + ".",
|
|
12965
|
-
e
|
|
12966
|
-
);
|
|
13060
|
+
throw new Error("Error generating template page(s) for " + map.inputPath + ".", { cause: e });
|
|
12967
13061
|
}
|
|
12968
13062
|
if (map._pages.length === 0) {
|
|
12969
13063
|
} else {
|
|
@@ -13060,14 +13154,9 @@ var TemplateMap = class {
|
|
|
13060
13154
|
hasMapEntryForInputPath(inputPath) {
|
|
13061
13155
|
return Boolean(this.getMapEntryForInputPath(inputPath));
|
|
13062
13156
|
}
|
|
13063
|
-
// TODO(slightlyoff): hot inner loop?
|
|
13064
13157
|
getMapEntryForInputPath(inputPath) {
|
|
13065
13158
|
let absoluteInputPath = import_eleventy_utils23.TemplatePath.absolutePath(inputPath);
|
|
13066
|
-
return this.
|
|
13067
|
-
if (entry.inputPath === inputPath || entry.inputPath === absoluteInputPath) {
|
|
13068
|
-
return entry;
|
|
13069
|
-
}
|
|
13070
|
-
});
|
|
13159
|
+
return this.inputPathMap.get(absoluteInputPath);
|
|
13071
13160
|
}
|
|
13072
13161
|
#removeTagsFromTemplateOrder(maps) {
|
|
13073
13162
|
return maps.filter((dep) => !GlobalDependencyMap_default.isCollection(dep));
|
|
@@ -13082,9 +13171,9 @@ var TemplateMap = class {
|
|
|
13082
13171
|
try {
|
|
13083
13172
|
await pageEntry.data[this.config.keys.dataSchema](pageEntry.data);
|
|
13084
13173
|
} catch (e) {
|
|
13085
|
-
throw new
|
|
13174
|
+
throw new Error(
|
|
13086
13175
|
`Error in the data schema for: ${map.inputPath} (via \`eleventyDataSchema\`)`,
|
|
13087
|
-
e
|
|
13176
|
+
{ cause: e }
|
|
13088
13177
|
);
|
|
13089
13178
|
}
|
|
13090
13179
|
}
|
|
@@ -13538,10 +13627,10 @@ var TemplateWriter = class {
|
|
|
13538
13627
|
}
|
|
13539
13628
|
getPathsWithVirtualTemplates(paths) {
|
|
13540
13629
|
if (this.config.virtualTemplates && (0, import_eleventy_utils24.isPlainObject)(this.config.virtualTemplates)) {
|
|
13541
|
-
let virtualTemplates = Object.keys(this.config.virtualTemplates).filter((
|
|
13542
|
-
return this.dirs.isTemplateFile(
|
|
13543
|
-
}).map((
|
|
13544
|
-
let fullVirtualPath = this.dirs.getInputPath(
|
|
13630
|
+
let virtualTemplates = Object.keys(this.config.virtualTemplates).filter((path9) => {
|
|
13631
|
+
return this.dirs.isTemplateFile(path9);
|
|
13632
|
+
}).map((path9) => {
|
|
13633
|
+
let fullVirtualPath = this.dirs.getInputPath(path9);
|
|
13545
13634
|
if (!this.extensionMap.getKey(fullVirtualPath)) {
|
|
13546
13635
|
throw new Error(
|
|
13547
13636
|
`The virtual template at ${fullVirtualPath} is using a template format that\u2019s not valid for your project. Your project is using: "${this.formats}". Read more about formats: https://v3.11ty.dev/docs/config/#template-formats`
|
|
@@ -13552,13 +13641,13 @@ var TemplateWriter = class {
|
|
|
13552
13641
|
paths = paths.concat(virtualTemplates);
|
|
13553
13642
|
if (paths.length !== new Set(paths).size) {
|
|
13554
13643
|
let conflicts = {};
|
|
13555
|
-
for (let
|
|
13556
|
-
if (conflicts[
|
|
13644
|
+
for (let path9 of paths) {
|
|
13645
|
+
if (conflicts[path9]) {
|
|
13557
13646
|
throw new Error(
|
|
13558
|
-
`A virtual template had the same path as a file on the file system: "${
|
|
13647
|
+
`A virtual template had the same path as a file on the file system: "${path9}"`
|
|
13559
13648
|
);
|
|
13560
13649
|
}
|
|
13561
|
-
conflicts[
|
|
13650
|
+
conflicts[path9] = true;
|
|
13562
13651
|
}
|
|
13563
13652
|
}
|
|
13564
13653
|
}
|
|
@@ -13572,8 +13661,8 @@ var TemplateWriter = class {
|
|
|
13572
13661
|
paths = this.getPathsWithVirtualTemplates(paths);
|
|
13573
13662
|
return paths;
|
|
13574
13663
|
}
|
|
13575
|
-
_createTemplate(
|
|
13576
|
-
let tmpl = this._templatePathCache.get(
|
|
13664
|
+
_createTemplate(path9, to = "fs") {
|
|
13665
|
+
let tmpl = this._templatePathCache.get(path9);
|
|
13577
13666
|
let wasCached = false;
|
|
13578
13667
|
if (tmpl) {
|
|
13579
13668
|
wasCached = true;
|
|
@@ -13583,10 +13672,10 @@ var TemplateWriter = class {
|
|
|
13583
13672
|
eleventyConfig: this.templateConfig
|
|
13584
13673
|
});
|
|
13585
13674
|
} else {
|
|
13586
|
-
tmpl = new Template_default(
|
|
13675
|
+
tmpl = new Template_default(path9, this.templateData, this.extensionMap, this.templateConfig);
|
|
13587
13676
|
tmpl.setOutputFormat(to);
|
|
13588
13677
|
tmpl.logger = this.logger;
|
|
13589
|
-
this._templatePathCache.set(
|
|
13678
|
+
this._templatePathCache.set(path9, tmpl);
|
|
13590
13679
|
}
|
|
13591
13680
|
tmpl.setTransforms(this.config.transforms);
|
|
13592
13681
|
tmpl.setLinters(this.config.linters);
|
|
@@ -13604,8 +13693,8 @@ var TemplateWriter = class {
|
|
|
13604
13693
|
let secondOrderRelevantLookup = {};
|
|
13605
13694
|
let templates = [];
|
|
13606
13695
|
let promises2 = [];
|
|
13607
|
-
for (let
|
|
13608
|
-
let { template: tmpl } = this._createTemplate(
|
|
13696
|
+
for (let path9 of paths) {
|
|
13697
|
+
let { template: tmpl } = this._createTemplate(path9, to);
|
|
13609
13698
|
templates.push(tmpl);
|
|
13610
13699
|
await tmpl.asyncTemplateInitialization();
|
|
13611
13700
|
if (incrementalFileShape === "template" && tmpl.inputPath === this.incrementalFile) {
|
|
@@ -13678,8 +13767,8 @@ var TemplateWriter = class {
|
|
|
13678
13767
|
}
|
|
13679
13768
|
let ignoreInitialBuild = !this.isRunInitialBuild;
|
|
13680
13769
|
let promises2 = [];
|
|
13681
|
-
for (let
|
|
13682
|
-
let { template: tmpl, wasCached } = this._createTemplate(
|
|
13770
|
+
for (let path9 of paths) {
|
|
13771
|
+
let { template: tmpl, wasCached } = this._createTemplate(path9, to);
|
|
13683
13772
|
if (ignoreInitialBuild) {
|
|
13684
13773
|
tmpl.setRenderableOverride(false);
|
|
13685
13774
|
} else {
|
|
@@ -13700,8 +13789,8 @@ var TemplateWriter = class {
|
|
|
13700
13789
|
}
|
|
13701
13790
|
async _addToTemplateMap(paths, to = "fs") {
|
|
13702
13791
|
let incrementalFileShape = this.getFileShape(paths, this.incrementalFile);
|
|
13703
|
-
paths = paths.filter((
|
|
13704
|
-
if (!this.extensionMap.hasEngine(
|
|
13792
|
+
paths = paths.filter((path9) => {
|
|
13793
|
+
if (!this.extensionMap.hasEngine(path9)) {
|
|
13705
13794
|
return false;
|
|
13706
13795
|
}
|
|
13707
13796
|
if (incrementalFileShape === "copy") {
|
|
@@ -13906,14 +13995,14 @@ var EleventyExtensionMap = class {
|
|
|
13906
13995
|
this.#engineManager.reset();
|
|
13907
13996
|
}
|
|
13908
13997
|
/* Used for layout path resolution */
|
|
13909
|
-
getFileList(
|
|
13910
|
-
if (!
|
|
13998
|
+
getFileList(path9, dir) {
|
|
13999
|
+
if (!path9) {
|
|
13911
14000
|
return [];
|
|
13912
14001
|
}
|
|
13913
14002
|
let files = [];
|
|
13914
14003
|
this.validTemplateLanguageKeys.forEach((key) => {
|
|
13915
14004
|
this.getExtensionsFromKey(key).forEach(function(extension) {
|
|
13916
|
-
files.push((dir ? dir + "/" : "") +
|
|
14005
|
+
files.push((dir ? dir + "/" : "") + path9 + "." + extension);
|
|
13917
14006
|
});
|
|
13918
14007
|
});
|
|
13919
14008
|
return files;
|
|
@@ -13921,9 +14010,9 @@ var EleventyExtensionMap = class {
|
|
|
13921
14010
|
// Warning: this would false positive on an include, but is only used
|
|
13922
14011
|
// on paths found from the file system glob search.
|
|
13923
14012
|
// TODO: Method name might just need to be renamed to something more accurate.
|
|
13924
|
-
isFullTemplateFilePath(
|
|
14013
|
+
isFullTemplateFilePath(path9) {
|
|
13925
14014
|
for (let extension of this.validTemplateLanguageKeys) {
|
|
13926
|
-
if (
|
|
14015
|
+
if (path9.endsWith(`.${extension}`)) {
|
|
13927
14016
|
return true;
|
|
13928
14017
|
}
|
|
13929
14018
|
}
|
|
@@ -13939,18 +14028,18 @@ var EleventyExtensionMap = class {
|
|
|
13939
14028
|
}
|
|
13940
14029
|
}
|
|
13941
14030
|
}
|
|
13942
|
-
getValidExtensionsForPath(
|
|
14031
|
+
getValidExtensionsForPath(path9) {
|
|
13943
14032
|
let extensions = /* @__PURE__ */ new Set();
|
|
13944
14033
|
for (let extension in this.extensionToKeyMap) {
|
|
13945
|
-
if (
|
|
14034
|
+
if (path9.endsWith(`.${extension}`)) {
|
|
13946
14035
|
extensions.add(extension);
|
|
13947
14036
|
}
|
|
13948
14037
|
}
|
|
13949
14038
|
let sorted = Array.from(extensions).filter((extension) => this.validTemplateLanguageKeys.includes(extension)).sort((a, b) => b.length - a.length);
|
|
13950
14039
|
return sorted;
|
|
13951
14040
|
}
|
|
13952
|
-
async shouldSpiderJavaScriptDependencies(
|
|
13953
|
-
let extensions = this.getValidExtensionsForPath(
|
|
14041
|
+
async shouldSpiderJavaScriptDependencies(path9) {
|
|
14042
|
+
let extensions = this.getValidExtensionsForPath(path9);
|
|
13954
14043
|
for (let extension of extensions) {
|
|
13955
14044
|
if (extension in this._spiderJsDepsCache) {
|
|
13956
14045
|
return this._spiderJsDepsCache[extension];
|
|
@@ -14052,16 +14141,16 @@ var EleventyExtensionMap = class {
|
|
|
14052
14141
|
}
|
|
14053
14142
|
}
|
|
14054
14143
|
}
|
|
14055
|
-
removeTemplateExtension(
|
|
14144
|
+
removeTemplateExtension(path9) {
|
|
14056
14145
|
for (let extension in this.extensionToKeyMap) {
|
|
14057
|
-
if (
|
|
14058
|
-
return
|
|
14146
|
+
if (path9 === extension || path9.endsWith("." + extension)) {
|
|
14147
|
+
return path9.slice(
|
|
14059
14148
|
0,
|
|
14060
|
-
|
|
14149
|
+
path9.length - 1 - extension.length < 0 ? 0 : path9.length - 1 - extension.length
|
|
14061
14150
|
);
|
|
14062
14151
|
}
|
|
14063
14152
|
}
|
|
14064
|
-
return
|
|
14153
|
+
return path9;
|
|
14065
14154
|
}
|
|
14066
14155
|
// keys are file extensions
|
|
14067
14156
|
// values are template language keys
|
|
@@ -14474,8 +14563,6 @@ var UserConfig = class {
|
|
|
14474
14563
|
#pluginExecution = false;
|
|
14475
14564
|
/** @type {boolean} */
|
|
14476
14565
|
#quietModeLocked = false;
|
|
14477
|
-
/** @type {boolean} */
|
|
14478
|
-
#dataDeepMergeModified = false;
|
|
14479
14566
|
/** @type {number|undefined} */
|
|
14480
14567
|
#uniqueId;
|
|
14481
14568
|
/** @type {number} */
|
|
@@ -14501,12 +14588,6 @@ var UserConfig = class {
|
|
|
14501
14588
|
this.reset();
|
|
14502
14589
|
this.#uniqueId = Math.random();
|
|
14503
14590
|
}
|
|
14504
|
-
// this.DateTime removed in v4
|
|
14505
|
-
get DateTime() {
|
|
14506
|
-
throw new Error(
|
|
14507
|
-
'Luxon\u2019s DateTime property in configuration was removed in Eleventy v4. Please `import { DateTime } from "luxon"` directly.'
|
|
14508
|
-
);
|
|
14509
|
-
}
|
|
14510
14591
|
// Internally used in TemplateContent for cache keys
|
|
14511
14592
|
_getUniqueId() {
|
|
14512
14593
|
return this.#uniqueId;
|
|
@@ -14538,8 +14619,8 @@ var UserConfig = class {
|
|
|
14538
14619
|
filters: {},
|
|
14539
14620
|
shortcodes: {},
|
|
14540
14621
|
pairedShortcodes: {},
|
|
14541
|
-
parameterParsing: "
|
|
14542
|
-
// or
|
|
14622
|
+
parameterParsing: "builtin"
|
|
14623
|
+
// or legacy (Breaking: default swapped in v4.0.0)
|
|
14543
14624
|
};
|
|
14544
14625
|
this.nunjucks = {
|
|
14545
14626
|
// `dev: true` gives us better error messaging
|
|
@@ -14578,7 +14659,6 @@ var UserConfig = class {
|
|
|
14578
14659
|
defaultIgnores.add(".git/**");
|
|
14579
14660
|
this.ignores = new Set(defaultIgnores);
|
|
14580
14661
|
this.watchIgnores = new Set(defaultIgnores);
|
|
14581
|
-
this.dataDeepMerge = true;
|
|
14582
14662
|
this.extensionMap = /* @__PURE__ */ new Set();
|
|
14583
14663
|
this.extensionMapClasses = {};
|
|
14584
14664
|
this.extensionConflictMap = {};
|
|
@@ -14696,9 +14776,9 @@ var UserConfig = class {
|
|
|
14696
14776
|
/*
|
|
14697
14777
|
* Markdown
|
|
14698
14778
|
*/
|
|
14699
|
-
//
|
|
14700
|
-
//
|
|
14701
|
-
//
|
|
14779
|
+
// Don’t use this, projects should use `amendLibrary` as documented here:
|
|
14780
|
+
// https://www.11ty.dev/docs/languages/markdown/#optional-amend-the-library-instance
|
|
14781
|
+
// Warning: this is in use by the Syntax Highlighting plugin (as of v5.0.2)
|
|
14702
14782
|
addMarkdownHighlighter(highlightFn) {
|
|
14703
14783
|
this.markdownHighlighter = highlightFn;
|
|
14704
14784
|
}
|
|
@@ -15077,9 +15157,6 @@ var UserConfig = class {
|
|
|
15077
15157
|
/*
|
|
15078
15158
|
* Template Formats
|
|
15079
15159
|
*/
|
|
15080
|
-
_normalizeTemplateFormats() {
|
|
15081
|
-
throw new Error("The internal _normalizeTemplateFormats() method was removed in Eleventy 3.0");
|
|
15082
|
-
}
|
|
15083
15160
|
setTemplateFormats(templateFormats) {
|
|
15084
15161
|
this.templateFormats = templateFormats;
|
|
15085
15162
|
}
|
|
@@ -15133,14 +15210,6 @@ var UserConfig = class {
|
|
|
15133
15210
|
setUseGitIgnore(enabled) {
|
|
15134
15211
|
this.useGitIgnore = !!enabled;
|
|
15135
15212
|
}
|
|
15136
|
-
setDataDeepMerge(deepMerge) {
|
|
15137
|
-
this.#dataDeepMergeModified = true;
|
|
15138
|
-
this.dataDeepMerge = !!deepMerge;
|
|
15139
|
-
}
|
|
15140
|
-
// Used by the Upgrade Helper Plugin
|
|
15141
|
-
isDataDeepMergeModified() {
|
|
15142
|
-
return this.#dataDeepMergeModified;
|
|
15143
|
-
}
|
|
15144
15213
|
addWatchTarget(additionalWatchTargets, options = {}) {
|
|
15145
15214
|
if (options.resetConfig) {
|
|
15146
15215
|
this.watchTargetsConfigReset.add(additionalWatchTargets);
|
|
@@ -15157,12 +15226,6 @@ var UserConfig = class {
|
|
|
15157
15226
|
this.serverOptions = (0, import_eleventy_utils26.DeepCopy)(this.serverOptions, options);
|
|
15158
15227
|
}
|
|
15159
15228
|
}
|
|
15160
|
-
setBrowserSyncConfig() {
|
|
15161
|
-
this._attemptedBrowserSyncUse = true;
|
|
15162
|
-
debug19(
|
|
15163
|
-
"The `setBrowserSyncConfig` method was removed in Eleventy 2.0.0. Use `setServerOptions` with the new Eleventy development server or the `@11ty/eleventy-browser-sync` plugin moving forward."
|
|
15164
|
-
);
|
|
15165
|
-
}
|
|
15166
15229
|
setChokidarConfig(options = {}) {
|
|
15167
15230
|
this.chokidarConfig = options;
|
|
15168
15231
|
}
|
|
@@ -15374,9 +15437,6 @@ var UserConfig = class {
|
|
|
15374
15437
|
configureErrorReporting(options = {}) {
|
|
15375
15438
|
Object.assign(this.errorReporting, options);
|
|
15376
15439
|
}
|
|
15377
|
-
configureTemplateHandling(options = {}) {
|
|
15378
|
-
throw new Error("Internal configuration API method `configureTemplateHandling` was removed.");
|
|
15379
|
-
}
|
|
15380
15440
|
/*
|
|
15381
15441
|
* Collections
|
|
15382
15442
|
*/
|
|
@@ -15454,7 +15514,6 @@ var UserConfig = class {
|
|
|
15454
15514
|
useGitIgnore: this.useGitIgnore,
|
|
15455
15515
|
ignores: this.ignores,
|
|
15456
15516
|
watchIgnores: this.watchIgnores,
|
|
15457
|
-
dataDeepMerge: this.dataDeepMerge,
|
|
15458
15517
|
watchJavaScriptDependencies: this.watchJavaScriptDependencies,
|
|
15459
15518
|
additionalWatchTargets: this.additionalWatchTargets,
|
|
15460
15519
|
watchTargetsConfigReset: this.watchTargetsConfigReset,
|
|
@@ -15489,6 +15548,31 @@ var UserConfig = class {
|
|
|
15489
15548
|
}
|
|
15490
15549
|
return obj;
|
|
15491
15550
|
}
|
|
15551
|
+
// Removed features
|
|
15552
|
+
get DateTime() {
|
|
15553
|
+
throw new Error(
|
|
15554
|
+
'Luxon\u2019s DateTime property in configuration was removed in Eleventy v4. Please `import { DateTime } from "luxon"` directly.'
|
|
15555
|
+
);
|
|
15556
|
+
}
|
|
15557
|
+
_normalizeTemplateFormats() {
|
|
15558
|
+
throw new Error("The internal _normalizeTemplateFormats() method was removed in Eleventy v3");
|
|
15559
|
+
}
|
|
15560
|
+
setBrowserSyncConfig() {
|
|
15561
|
+
this._attemptedBrowserSyncUse = true;
|
|
15562
|
+
debug19(
|
|
15563
|
+
"The `setBrowserSyncConfig` method was removed in Eleventy v2. Use `setServerOptions` with the new Eleventy development server or the `@11ty/eleventy-browser-sync` plugin moving forward."
|
|
15564
|
+
);
|
|
15565
|
+
}
|
|
15566
|
+
configureTemplateHandling(options = {}) {
|
|
15567
|
+
throw new Error("Internal configuration API method `configureTemplateHandling` was removed.");
|
|
15568
|
+
}
|
|
15569
|
+
setDataDeepMerge(deepMerge) {
|
|
15570
|
+
if (Boolean(deepMerge) === false) {
|
|
15571
|
+
throw new Error(
|
|
15572
|
+
"The `setDataDeepMerge(false)` Configuration API feature was removed in Eleventy v4. Read more at https://github.com/11ty/eleventy/issues/3937"
|
|
15573
|
+
);
|
|
15574
|
+
}
|
|
15575
|
+
}
|
|
15492
15576
|
// No-op functions for backwards compat
|
|
15493
15577
|
addHandlebarsHelper() {
|
|
15494
15578
|
}
|
|
@@ -15500,6 +15584,10 @@ var UserConfig = class {
|
|
|
15500
15584
|
}
|
|
15501
15585
|
addPairedHandlebarsShortcode() {
|
|
15502
15586
|
}
|
|
15587
|
+
// Used by the Upgrade Helper Plugin v1 (no longer relevant)
|
|
15588
|
+
// https://github.com/11ty/eleventy-upgrade-help/blob/v1.x/src/data-deep-merge.js#L5-L9
|
|
15589
|
+
isDataDeepMergeModified() {
|
|
15590
|
+
}
|
|
15503
15591
|
};
|
|
15504
15592
|
var UserConfig_default = UserConfig;
|
|
15505
15593
|
|
|
@@ -15512,38 +15600,42 @@ var ExistsCache = class {
|
|
|
15512
15600
|
constructor() {
|
|
15513
15601
|
this.lookupCount = 0;
|
|
15514
15602
|
}
|
|
15603
|
+
reset() {
|
|
15604
|
+
this.#exists = /* @__PURE__ */ new Map();
|
|
15605
|
+
this.#dirs = /* @__PURE__ */ new Map();
|
|
15606
|
+
}
|
|
15515
15607
|
get size() {
|
|
15516
15608
|
return this.#exists.size;
|
|
15517
15609
|
}
|
|
15518
|
-
has(
|
|
15519
|
-
return this.#exists.has(
|
|
15610
|
+
has(path9) {
|
|
15611
|
+
return this.#exists.has(path9);
|
|
15520
15612
|
}
|
|
15521
|
-
set(
|
|
15522
|
-
this.#exists.set(import_eleventy_utils27.TemplatePath.addLeadingDotSlash(
|
|
15613
|
+
set(path9, isExist) {
|
|
15614
|
+
this.#exists.set(import_eleventy_utils27.TemplatePath.addLeadingDotSlash(path9), Boolean(isExist));
|
|
15523
15615
|
}
|
|
15524
15616
|
// Not yet needed
|
|
15525
15617
|
// setDirectory(path, isExist) {}
|
|
15526
15618
|
// Relative paths (to root directory) expected (but not enforced due to perf costs)
|
|
15527
|
-
exists(
|
|
15528
|
-
if (!this.#exists.has(
|
|
15529
|
-
let exists = existsSync(
|
|
15619
|
+
exists(path9) {
|
|
15620
|
+
if (!this.#exists.has(path9)) {
|
|
15621
|
+
let exists = existsSync(path9);
|
|
15530
15622
|
this.lookupCount++;
|
|
15531
|
-
this.#exists.set(
|
|
15623
|
+
this.#exists.set(path9, Boolean(exists));
|
|
15532
15624
|
return exists;
|
|
15533
15625
|
}
|
|
15534
|
-
return this.#exists.get(
|
|
15626
|
+
return this.#exists.get(path9);
|
|
15535
15627
|
}
|
|
15536
|
-
isDirectory(
|
|
15537
|
-
if (!this.exists(
|
|
15628
|
+
isDirectory(path9) {
|
|
15629
|
+
if (!this.exists(path9)) {
|
|
15538
15630
|
return false;
|
|
15539
15631
|
}
|
|
15540
|
-
if (!this.#dirs.has(
|
|
15541
|
-
let isDir = statSync(
|
|
15632
|
+
if (!this.#dirs.has(path9)) {
|
|
15633
|
+
let isDir = statSync(path9).isDirectory();
|
|
15542
15634
|
this.lookupCount++;
|
|
15543
|
-
this.#dirs.set(
|
|
15635
|
+
this.#dirs.set(path9, isDir);
|
|
15544
15636
|
return isDir;
|
|
15545
15637
|
}
|
|
15546
|
-
return this.#dirs.get(
|
|
15638
|
+
return this.#dirs.get(path9);
|
|
15547
15639
|
}
|
|
15548
15640
|
};
|
|
15549
15641
|
var ExistsCache_default = ExistsCache;
|
|
@@ -15676,6 +15768,7 @@ var TemplateConfig = class {
|
|
|
15676
15768
|
#existsCache = new ExistsCache_default();
|
|
15677
15769
|
#usesGraph;
|
|
15678
15770
|
#previousBuildModifiedFile;
|
|
15771
|
+
#activeConfigPath;
|
|
15679
15772
|
constructor(customRootConfig, projectConfigPath) {
|
|
15680
15773
|
this.overrides = {};
|
|
15681
15774
|
if (projectConfigPath !== void 0) {
|
|
@@ -15759,7 +15852,7 @@ var TemplateConfig = class {
|
|
|
15759
15852
|
*/
|
|
15760
15853
|
getLocalProjectConfigFile() {
|
|
15761
15854
|
let configFiles = this.getLocalProjectConfigFiles();
|
|
15762
|
-
let configFile = configFiles.find((
|
|
15855
|
+
let configFile = configFiles.find((path9) => path9 && this.existsCache.exists(path9));
|
|
15763
15856
|
if (configFile) {
|
|
15764
15857
|
return configFile;
|
|
15765
15858
|
}
|
|
@@ -15767,10 +15860,16 @@ var TemplateConfig = class {
|
|
|
15767
15860
|
getLocalProjectConfigFiles() {
|
|
15768
15861
|
let paths = this.projectConfigPaths;
|
|
15769
15862
|
if (paths?.length > 0) {
|
|
15770
|
-
return import_eleventy_utils28.TemplatePath.addLeadingDotSlashArray(paths.filter((
|
|
15863
|
+
return import_eleventy_utils28.TemplatePath.addLeadingDotSlashArray(paths.filter((path9) => Boolean(path9)));
|
|
15771
15864
|
}
|
|
15772
15865
|
return [];
|
|
15773
15866
|
}
|
|
15867
|
+
getActiveConfigPath() {
|
|
15868
|
+
if (!this.#activeConfigPath) {
|
|
15869
|
+
this.#activeConfigPath = this.getLocalProjectConfigFile();
|
|
15870
|
+
}
|
|
15871
|
+
return this.#activeConfigPath;
|
|
15872
|
+
}
|
|
15774
15873
|
setProjectUsingEsm(isEsmProject) {
|
|
15775
15874
|
this.isEsm = !!isEsmProject;
|
|
15776
15875
|
this.usesGraph.setIsEsm(isEsmProject);
|
|
@@ -15782,6 +15881,7 @@ var TemplateConfig = class {
|
|
|
15782
15881
|
* Resets the configuration.
|
|
15783
15882
|
*/
|
|
15784
15883
|
async reset() {
|
|
15884
|
+
this.#existsCache.reset();
|
|
15785
15885
|
debugDev5("Resetting configuration: TemplateConfig and UserConfig.");
|
|
15786
15886
|
this.userConfig.reset();
|
|
15787
15887
|
this.usesGraph.reset();
|
|
@@ -15802,6 +15902,7 @@ var TemplateConfig = class {
|
|
|
15802
15902
|
* Async-friendly init method
|
|
15803
15903
|
*/
|
|
15804
15904
|
async init(overrides) {
|
|
15905
|
+
this.#activeConfigPath = void 0;
|
|
15805
15906
|
await this.initializeRootConfig();
|
|
15806
15907
|
if (overrides) {
|
|
15807
15908
|
this.appendToRootConfig(overrides);
|
|
@@ -15832,10 +15933,10 @@ var TemplateConfig = class {
|
|
|
15832
15933
|
*
|
|
15833
15934
|
* @param {String} path - The new config path.
|
|
15834
15935
|
*/
|
|
15835
|
-
async setProjectConfigPath(
|
|
15936
|
+
async setProjectConfigPath(path9) {
|
|
15836
15937
|
this.#configManuallyDefined = true;
|
|
15837
|
-
if (
|
|
15838
|
-
this.projectConfigPaths = [
|
|
15938
|
+
if (path9 !== void 0) {
|
|
15939
|
+
this.projectConfigPaths = [path9];
|
|
15839
15940
|
} else {
|
|
15840
15941
|
this.projectConfigPaths = [];
|
|
15841
15942
|
}
|
|
@@ -15928,16 +16029,16 @@ var TemplateConfig = class {
|
|
|
15928
16029
|
async requireLocalConfigFile() {
|
|
15929
16030
|
let localConfig = {};
|
|
15930
16031
|
let exportedConfig = {};
|
|
15931
|
-
let
|
|
15932
|
-
if (this.projectConfigPaths.length > 0 && this.#configManuallyDefined && !
|
|
16032
|
+
let path9 = this.getActiveConfigPath();
|
|
16033
|
+
if (this.projectConfigPaths.length > 0 && this.#configManuallyDefined && !path9) {
|
|
15933
16034
|
throw new EleventyConfigError(
|
|
15934
16035
|
"A configuration file was specified but not found: " + this.projectConfigPaths.join(", ")
|
|
15935
16036
|
);
|
|
15936
16037
|
}
|
|
15937
|
-
debug21(`Merging default config with ${
|
|
15938
|
-
if (
|
|
16038
|
+
debug21(`Merging default config with ${path9}`);
|
|
16039
|
+
if (path9) {
|
|
15939
16040
|
try {
|
|
15940
|
-
let { default: configDefaultReturn, config: exportedConfigObject } = await dynamicImportRaw(
|
|
16041
|
+
let { default: configDefaultReturn, config: exportedConfigObject } = await dynamicImportRaw(path9, this.isEsm ? "esm" : "cjs");
|
|
15941
16042
|
exportedConfig = exportedConfigObject || {};
|
|
15942
16043
|
if (this.directories && Object.keys(exportedConfigObject?.dir || {}).length > 0) {
|
|
15943
16044
|
debug21(
|
|
@@ -15955,7 +16056,7 @@ var TemplateConfig = class {
|
|
|
15955
16056
|
let isModuleError = err instanceof Error && (err?.message || "").includes("Cannot find module");
|
|
15956
16057
|
return Promise.reject(
|
|
15957
16058
|
new EleventyConfigError(
|
|
15958
|
-
`Error in your Eleventy config file '${
|
|
16059
|
+
`Error in your Eleventy config file '${path9}'.` + (isModuleError ? chalk_client_default.cyan(" You may need to run `npm install`.") : ""),
|
|
15959
16060
|
err
|
|
15960
16061
|
)
|
|
15961
16062
|
);
|
|
@@ -16138,11 +16239,11 @@ var ProjectDirectories = class _ProjectDirectories {
|
|
|
16138
16239
|
normalizeDirectoryPathRelativeToInputDirectory(filePath) {
|
|
16139
16240
|
return _ProjectDirectories.normalizeDirectory(import_node_path10.default.join(this.input, filePath));
|
|
16140
16241
|
}
|
|
16141
|
-
static addTrailingSlash(
|
|
16142
|
-
if (
|
|
16143
|
-
return
|
|
16242
|
+
static addTrailingSlash(path9) {
|
|
16243
|
+
if (path9.slice(-1) === "/") {
|
|
16244
|
+
return path9;
|
|
16144
16245
|
}
|
|
16145
|
-
return
|
|
16246
|
+
return path9 + "/";
|
|
16146
16247
|
}
|
|
16147
16248
|
// If input/output are set via CLI, they take precedence over all other configuration values.
|
|
16148
16249
|
freeze() {
|
|
@@ -16194,6 +16295,9 @@ var ProjectDirectories = class _ProjectDirectories {
|
|
|
16194
16295
|
if (!dirOrFile) {
|
|
16195
16296
|
return;
|
|
16196
16297
|
}
|
|
16298
|
+
if (import_node_path10.default.isAbsolute(dirOrFile)) {
|
|
16299
|
+
dirOrFile = import_node_path10.default.relative(".", dirOrFile);
|
|
16300
|
+
}
|
|
16197
16301
|
let inputExists = existsSync(dirOrFile);
|
|
16198
16302
|
let inputExistsAndIsDirectory = inputExists && statSync(dirOrFile).isDirectory();
|
|
16199
16303
|
if (inputExistsAndIsDirectory) {
|
|
@@ -16261,6 +16365,9 @@ var ProjectDirectories = class _ProjectDirectories {
|
|
|
16261
16365
|
}
|
|
16262
16366
|
if (dir !== void 0) {
|
|
16263
16367
|
this.#raw.output = dir;
|
|
16368
|
+
if (import_node_path10.default.isAbsolute(dir)) {
|
|
16369
|
+
dir = import_node_path10.default.relative(".", dir);
|
|
16370
|
+
}
|
|
16264
16371
|
this.#dirs.output = _ProjectDirectories.normalizeDirectory(dir || "");
|
|
16265
16372
|
}
|
|
16266
16373
|
}
|
|
@@ -16921,7 +17028,7 @@ Verbose Output: ${this.verboseMode}`;
|
|
|
16921
17028
|
"Internal error: Eleventy didn\u2019t run init() properly and wasn\u2019t able to create a TemplateWriter."
|
|
16922
17029
|
);
|
|
16923
17030
|
}
|
|
16924
|
-
let incrementalFile = this.programmaticApiIncrementalFile || this.
|
|
17031
|
+
let incrementalFile = this.programmaticApiIncrementalFile || this.watchQueue?.getIncrementalFile();
|
|
16925
17032
|
if (incrementalFile) {
|
|
16926
17033
|
this.writer.setIncrementalFile(incrementalFile);
|
|
16927
17034
|
}
|