@11ty/client 4.0.0-alpha.4 → 4.0.0-alpha.6

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.
@@ -1,4 +1,4 @@
1
- /*! Eleventy v4.0.0-alpha.4 (@11ty/client Bundle) */
1
+ /*! Eleventy v4.0.0-alpha.6 (@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(path11) {
749
- var result = splitDeviceRe.exec(path11), device = result[1] || "", isUnc = !!device && device[1] !== ":";
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 path11;
764
+ var path9;
765
765
  if (i >= 0) {
766
- path11 = arguments[i];
766
+ path9 = arguments[i];
767
767
  } else if (!resolvedDevice) {
768
- path11 = process.cwd();
768
+ path9 = process.cwd();
769
769
  } else {
770
- path11 = process.env["=" + resolvedDevice];
771
- if (!path11 || path11.substr(0, 3).toLowerCase() !== resolvedDevice.toLowerCase() + "\\") {
772
- path11 = resolvedDevice + "\\";
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(path11)) {
775
+ if (!util.isString(path9)) {
776
776
  throw new TypeError("Arguments to path.resolve must be strings");
777
- } else if (!path11) {
777
+ } else if (!path9) {
778
778
  continue;
779
779
  }
780
- var result = win32StatPath(path11), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail;
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(path11) {
805
- var result = win32StatPath(path11), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail, trailingSlash = /[\\\/]$/.test(tail);
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(path11) {
819
- return win32StatPath(path11).isAbsolute;
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(path11) {
865
- if (!util.isString(path11))
866
- return path11;
867
- if (!path11) {
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(path11);
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 path11;
876
+ return path9;
877
877
  };
878
- win32.dirname = function(path11) {
879
- var result = win32SplitPath(path11), root = result[0], dir = result[1];
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(path11, ext) {
889
- var f = win32SplitPath(path11)[2];
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(path11) {
896
- return win32SplitPath(path11)[3];
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 path11 = i >= 0 ? arguments[i] : process.cwd();
949
- if (!util.isString(path11)) {
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 (!path11) {
951
+ } else if (!path9) {
952
952
  continue;
953
953
  }
954
- resolvedPath = path11 + "/" + resolvedPath;
955
- resolvedAbsolute = path11[0] === "/";
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(path11) {
964
- var isAbsolute = posix.isAbsolute(path11), trailingSlash = path11 && path11[path11.length - 1] === "/";
965
- path11 = normalizeArray(path11.split("/"), !isAbsolute).join("/");
966
- if (!path11 && !isAbsolute) {
967
- path11 = ".";
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 (path11 && trailingSlash) {
970
- path11 += "/";
969
+ if (path9 && trailingSlash) {
970
+ path9 += "/";
971
971
  }
972
- return (isAbsolute ? "/" : "") + path11;
972
+ return (isAbsolute ? "/" : "") + path9;
973
973
  };
974
- posix.isAbsolute = function(path11) {
975
- return path11.charAt(0) === "/";
974
+ posix.isAbsolute = function(path9) {
975
+ return path9.charAt(0) === "/";
976
976
  };
977
977
  posix.join = function() {
978
- var path11 = "";
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 (!path11) {
986
- path11 += segment;
985
+ if (!path9) {
986
+ path9 += segment;
987
987
  } else {
988
- path11 += "/" + segment;
988
+ path9 += "/" + segment;
989
989
  }
990
990
  }
991
991
  }
992
- return posix.normalize(path11);
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(path11) {
1015
- return path11;
1014
+ posix._makeLong = function(path9) {
1015
+ return path9;
1016
1016
  };
1017
- posix.dirname = function(path11) {
1018
- var result = posixSplitPath(path11), root = result[0], dir = result[1];
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(path11, ext) {
1028
- var f = posixSplitPath(path11)[2];
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(path11) {
1035
- return posixSplitPath(path11)[3];
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 path11 = require_path();
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(path11.resolve("."));
1148
+ return TemplatePath24.normalize(path9.resolve("."));
1149
1149
  };
1150
- TemplatePath24.getDir = function(path12) {
1151
- if (TemplatePath24.isDirectorySync(path12)) {
1152
- return path12;
1150
+ TemplatePath24.getDir = function(path10) {
1151
+ if (TemplatePath24.isDirectorySync(path10)) {
1152
+ return path10;
1153
1153
  }
1154
- return TemplatePath24.getDirFromFilePath(path12);
1154
+ return TemplatePath24.getDirFromFilePath(path10);
1155
1155
  };
1156
1156
  TemplatePath24.getDirFromFilePath = function(filePath) {
1157
- return path11.parse(filePath).dir || ".";
1157
+ return path9.parse(filePath).dir || ".";
1158
1158
  };
1159
- TemplatePath24.getLastPathSegment = function(path12) {
1160
- if (!path12.includes("/")) {
1161
- return path12;
1159
+ TemplatePath24.getLastPathSegment = function(path10) {
1160
+ if (!path10.includes("/")) {
1161
+ return path10;
1162
1162
  }
1163
- path12 = path12.replace(/\/$/, "");
1164
- return path12.slice(path12.lastIndexOf("/") + 1);
1163
+ path10 = path10.replace(/\/$/, "");
1164
+ return path10.slice(path10.lastIndexOf("/") + 1);
1165
1165
  };
1166
- TemplatePath24.getAllDirs = function(path12) {
1167
- path12 = path12.replace(/\/$/, "");
1168
- if (!path12.includes("/")) {
1169
- return [path12];
1166
+ TemplatePath24.getAllDirs = function(path10) {
1167
+ path10 = path10.replace(/\/$/, "");
1168
+ if (!path10.includes("/")) {
1169
+ return [path10];
1170
1170
  }
1171
- return path12.split("/").map((segment, index, array) => array.slice(0, index + 1).join("/")).filter((path13) => path13 !== ".").reverse();
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 = path11.normalize(thePath).split(path11.sep).join("/");
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(path11.join(...paths));
1181
+ return TemplatePath24.normalize(path9.join(...paths));
1182
1182
  };
1183
1183
  TemplatePath24.normalizeUrlPath = function(...urlPaths) {
1184
- const urlPath = path11.posix.join(...urlPaths);
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 (path11.isAbsolute(p) && i > 0) {
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 && path11.isAbsolute(p)) {
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((path12) => TemplatePath24.addLeadingDotSlash(path12));
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 (path11.isAbsolute(pathArg) || pathArg.startsWith("./") || pathArg.startsWith("../")) {
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(path12) {
1225
- return typeof path12 === "string" ? path12.replace(/^\.\//, "") : path12;
1224
+ TemplatePath24.stripLeadingDotSlash = function(path10) {
1225
+ return typeof path10 === "string" ? path10.replace(/^\.\//, "") : path10;
1226
1226
  };
1227
- TemplatePath24.startsWithSubPath = function(path12, subPath) {
1228
- path12 = TemplatePath24.normalize(path12);
1227
+ TemplatePath24.startsWithSubPath = function(path10, subPath) {
1228
+ path10 = TemplatePath24.normalize(path10);
1229
1229
  subPath = TemplatePath24.normalize(subPath);
1230
- return path12.startsWith(subPath);
1230
+ return path10.startsWith(subPath);
1231
1231
  };
1232
- TemplatePath24.stripLeadingSubPath = function(path12, subPath) {
1233
- path12 = TemplatePath24.normalize(path12);
1232
+ TemplatePath24.stripLeadingSubPath = function(path10, subPath) {
1233
+ path10 = TemplatePath24.normalize(path10);
1234
1234
  subPath = TemplatePath24.normalize(subPath);
1235
- if (subPath !== "." && path12.startsWith(subPath)) {
1236
- return path12.slice(subPath.length + 1);
1235
+ if (subPath !== "." && path10.startsWith(subPath)) {
1236
+ return path10.slice(subPath.length + 1);
1237
1237
  }
1238
- return path12;
1238
+ return path10;
1239
1239
  };
1240
- TemplatePath24.isDirectorySync = function(path12) {
1241
- return fs2.existsSync(path12) && fs2.statSync(path12).isDirectory();
1240
+ TemplatePath24.isDirectorySync = function(path10) {
1241
+ return fs2.existsSync(path10) && fs2.statSync(path10).isDirectory();
1242
1242
  };
1243
- TemplatePath24.isDirectory = async function(path12) {
1243
+ TemplatePath24.isDirectory = async function(path10) {
1244
1244
  return new Promise((resolve) => {
1245
- fs2.stat(path12, (err, stats) => {
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(path12) {
1254
- if (path12 === "") {
1253
+ TemplatePath24.convertToRecursiveGlobSync = function(path10) {
1254
+ if (path10 === "") {
1255
1255
  return "./**";
1256
1256
  }
1257
- path12 = TemplatePath24.addLeadingDotSlash(path12);
1258
- if (TemplatePath24.isDirectorySync(path12)) {
1259
- return path12 + (!path12.endsWith("/") ? "/" : "") + "**";
1257
+ path10 = TemplatePath24.addLeadingDotSlash(path10);
1258
+ if (TemplatePath24.isDirectorySync(path10)) {
1259
+ return path10 + (!path10.endsWith("/") ? "/" : "") + "**";
1260
1260
  }
1261
- return path12;
1261
+ return path10;
1262
1262
  };
1263
- TemplatePath24.convertToRecursiveGlob = async function(path12) {
1264
- if (path12 === "") {
1263
+ TemplatePath24.convertToRecursiveGlob = async function(path10) {
1264
+ if (path10 === "") {
1265
1265
  return "./**";
1266
1266
  }
1267
- path12 = TemplatePath24.addLeadingDotSlash(path12);
1268
- if (await TemplatePath24.isDirectory(path12)) {
1269
- return path12 + (!path12.endsWith("/") ? "/" : "") + "**";
1267
+ path10 = TemplatePath24.addLeadingDotSlash(path10);
1268
+ if (await TemplatePath24.isDirectory(path10)) {
1269
+ return path10 + (!path10.endsWith("/") ? "/" : "") + "**";
1270
1270
  }
1271
- return path12;
1271
+ return path10;
1272
1272
  };
1273
1273
  TemplatePath24.getExtension = function(thePath) {
1274
- return path11.extname(thePath).replace(/^\./, "");
1274
+ return path9.extname(thePath).replace(/^\./, "");
1275
1275
  };
1276
- TemplatePath24.removeExtension = function(path12, extension = void 0) {
1276
+ TemplatePath24.removeExtension = function(path10, extension = void 0) {
1277
1277
  if (extension === void 0) {
1278
- return path12;
1278
+ return path10;
1279
1279
  }
1280
- const pathExtension = TemplatePath24.getExtension(path12);
1280
+ const pathExtension = TemplatePath24.getExtension(path10);
1281
1281
  if (pathExtension !== "" && extension.endsWith(pathExtension)) {
1282
- return path12.substring(0, path12.lastIndexOf(pathExtension) - 1);
1282
+ return path10.substring(0, path10.lastIndexOf(pathExtension) - 1);
1283
1283
  }
1284
- return path12;
1284
+ return path10;
1285
1285
  };
1286
- TemplatePath24.normalizeOperatingSystemFilePath = function(filePath, sep = "/") {
1287
- return filePath.split(sep).join(path11.sep);
1286
+ TemplatePath24.normalizeOperatingSystemFilePath = function(filePath, sep2 = "/") {
1287
+ return filePath.split(sep2).join(path9.sep);
1288
1288
  };
1289
- TemplatePath24.standardizeFilePath = function(filePath, sep = "/") {
1290
- return TemplatePath24.addLeadingDotSlash(filePath.split(path11.sep).join(sep));
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 Merge3(target, ...sources) {
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 = Merge3;
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 Merge3 = require_Merge();
1779
+ var Merge5 = require_Merge();
1780
1780
  var DateCompare = require_DateCompare();
1781
- var { DeepCopy: DeepCopy4 } = Merge3;
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: Merge3,
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, path11) {
2026
- path11 = castPath(path11, object);
2027
- var index = 0, length = path11.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(path11[index++])];
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, path11, value, customizer) {
2046
+ function baseSet(object, path9, value, customizer) {
2047
2047
  if (!isObject(object)) {
2048
2048
  return object;
2049
2049
  }
2050
- path11 = castPath(path11, object);
2051
- var index = -1, length = path11.length, lastIndex = length - 1, nested = object;
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(path11[index]), newValue = value;
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(path11[index + 1]) ? [] : {};
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, path11, defaultValue) {
2302
- var result = object == null ? undefined2 : baseGet(object, path11);
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, path11, value) {
2306
- return object == null ? object : baseSet(object, path11, value);
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(path11, options = {}) {
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(path11, encoding);
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.4",
2988
+ version: "4.0.0-alpha.6",
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,75 +3083,75 @@ 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.1",
3086
- "@11ty/eleventy-plugin-webc": "^0.12.0-beta.3",
3087
- "@eslint/js": "^9.32.0",
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.0",
3090
+ "@mdx-js/node-loader": "^3.1.1",
3090
3091
  "@stylistic/eslint-plugin-js": "^4.4.1",
3091
- "@types/node": "^22.17.0",
3092
- "@vue/server-renderer": "^3.5.18",
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": "^7.0.3",
3097
- eslint: "^9.32.0",
3097
+ "cross-env": "^10.1.0",
3098
+ eslint: "^9.39.1",
3098
3099
  "eslint-config-prettier": "^10.1.8",
3099
- globals: "^16.3.0",
3100
- "jsx-async-runtime": "^1.0.3",
3101
- luxon: "^3.7.1",
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.6.2",
3107
+ prettier: "^3.7.1",
3107
3108
  pretty: "^2.0.0",
3108
- react: "^19.1.1",
3109
- "react-dom": "^19.1.1",
3110
- rimraf: "^6.0.1",
3111
- sass: "^1.89.2",
3109
+ react: "^19.2.1",
3110
+ "react-dom": "^19.2.1",
3111
+ rimraf: "^6.1.2",
3112
+ sass: "^1.94.2",
3112
3113
  "simple-git-hooks": "^2.13.1",
3113
- tsx: "^4.20.3",
3114
- typescript: "^5.9.2",
3115
- vue: "^3.5.18",
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.3"
3118
+ "zod-validation-error": "^3.5.4"
3118
3119
  },
3119
3120
  dependencies: {
3120
- "@11ty/dependency-tree": "^4.0.0",
3121
- "@11ty/dependency-tree-esm": "^2.0.0",
3122
- "@11ty/eleventy-dev-server": "3.0.0-alpha.3",
3123
- "@11ty/eleventy-plugin-bundle": "^3.0.6",
3121
+ "@11ty/dependency-tree": "^4.0.1",
3122
+ "@11ty/dependency-tree-esm": "^2.0.3",
3123
+ "@11ty/eleventy-dev-server": "^3.0.0-alpha.6",
3124
+ "@11ty/eleventy-plugin-bundle": "^3.0.7",
3124
3125
  "@11ty/eleventy-utils": "^2.0.7",
3125
- "@11ty/gray-matter": "^2.0.0",
3126
+ "@11ty/gray-matter": "^2.0.1",
3126
3127
  "@11ty/lodash-custom": "^4.17.21",
3127
- "@11ty/parse-date-strings": "^2.0.5",
3128
- "@11ty/posthtml-urls": "^1.0.1",
3129
- "@11ty/recursive-copy": "^4.0.2",
3130
- "@sindresorhus/slugify": "^2.2.1",
3128
+ "@11ty/node-version-check": "^1.0.1",
3129
+ "@11ty/nunjucks": "^4.0.0-alpha.1",
3130
+ "@11ty/parse-date-strings": "^2.0.6",
3131
+ "@11ty/posthtml-urls": "^1.0.2",
3132
+ "@11ty/recursive-copy": "^5.0.0",
3133
+ "@sindresorhus/slugify": "^3.0.0",
3131
3134
  "bcp-47-normalize": "^2.3.0",
3132
- chokidar: "^4.0.3",
3133
- debug: "^4.4.1",
3135
+ chokidar: "^5.0.0",
3136
+ debug: "^4.4.3",
3134
3137
  "dependency-graph": "^1.0.0",
3135
- entities: "^6.0.1",
3136
- "import-module-string": "^2.0.1",
3138
+ entities: "^7.0.0",
3139
+ "import-module-string": "^2.0.3",
3137
3140
  "iso-639-1": "^3.1.5",
3138
3141
  kleur: "^4.1.5",
3139
- liquidjs: "^10.21.1",
3142
+ liquidjs: "^10.24.0",
3140
3143
  "markdown-it": "^14.1.0",
3141
3144
  minimist: "^1.2.8",
3142
3145
  moo: "^0.5.2",
3143
3146
  "node-retrieve-globals": "^6.0.1",
3144
- nunjucks: "^3.2.4",
3145
3147
  picomatch: "^4.0.3",
3146
- "please-upgrade-node": "^3.2.0",
3147
- posthtml: "^0.16.6",
3148
+ posthtml: "^0.16.7",
3148
3149
  "posthtml-match-helper": "^2.0.3",
3149
- semver: "^7.7.2",
3150
- tinyglobby: "^0.2.14"
3150
+ semver: "^7.7.3",
3151
+ tinyglobby: "^0.2.15"
3151
3152
  },
3152
3153
  overrides: {
3153
- chokidar: "$chokidar"
3154
+ fdir: "6.4.6"
3154
3155
  }
3155
3156
  };
3156
3157
  }
@@ -3159,8 +3160,8 @@ var init_package = __esm({
3159
3160
  // ../../src/Util/RequireUtils.core.js
3160
3161
  function clearRequireCache(absolutePath) {
3161
3162
  }
3162
- function importJsonSync(path11) {
3163
- let rawInput = loadContents(path11);
3163
+ function importJsonSync(path9) {
3164
+ let rawInput = loadContents(path9);
3164
3165
  if (!rawInput) {
3165
3166
  return;
3166
3167
  }
@@ -4479,6 +4480,18 @@ var require_loader = __commonJS({
4479
4480
  (c - 65536 & 1023) + 56320
4480
4481
  );
4481
4482
  }
4483
+ function setProperty(object, key, value) {
4484
+ if (key === "__proto__") {
4485
+ Object.defineProperty(object, key, {
4486
+ configurable: true,
4487
+ enumerable: true,
4488
+ writable: true,
4489
+ value
4490
+ });
4491
+ } else {
4492
+ object[key] = value;
4493
+ }
4494
+ }
4482
4495
  var simpleEscapeCheck = new Array(256);
4483
4496
  var simpleEscapeMap = new Array(256);
4484
4497
  for (i = 0; i < 256; i++) {
@@ -4598,7 +4611,7 @@ var require_loader = __commonJS({
4598
4611
  for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
4599
4612
  key = sourceKeys[index];
4600
4613
  if (!_hasOwnProperty.call(destination, key)) {
4601
- destination[key] = source[key];
4614
+ setProperty(destination, key, source[key]);
4602
4615
  overridableKeys[key] = true;
4603
4616
  }
4604
4617
  }
@@ -4638,16 +4651,7 @@ var require_loader = __commonJS({
4638
4651
  state.position = startPos || state.position;
4639
4652
  throwError(state, "duplicated mapping key");
4640
4653
  }
4641
- if (keyNode === "__proto__") {
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
- }
4654
+ setProperty(_result, keyNode, valueNode);
4651
4655
  delete overridableKeys[keyNode];
4652
4656
  }
4653
4657
  return _result;
@@ -5817,7 +5821,7 @@ var require_dumper = __commonJS({
5817
5821
  return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
5818
5822
  }
5819
5823
  function writeScalar(state, string, level, iskey, inblock) {
5820
- state.dump = function() {
5824
+ state.dump = (function() {
5821
5825
  if (string.length === 0) {
5822
5826
  return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
5823
5827
  }
@@ -5855,7 +5859,7 @@ var require_dumper = __commonJS({
5855
5859
  default:
5856
5860
  throw new YAMLException("impossible error: invalid scalar style");
5857
5861
  }
5858
- }();
5862
+ })();
5859
5863
  }
5860
5864
  function blockHeader(string, indentPerLevel) {
5861
5865
  var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
@@ -5869,12 +5873,12 @@ var require_dumper = __commonJS({
5869
5873
  }
5870
5874
  function foldString(string, width) {
5871
5875
  var lineRe = /(\n+)([^\n]*)/g;
5872
- var result = function() {
5876
+ var result = (function() {
5873
5877
  var nextLF = string.indexOf("\n");
5874
5878
  nextLF = nextLF !== -1 ? nextLF : string.length;
5875
5879
  lineRe.lastIndex = nextLF;
5876
5880
  return foldLine(string.slice(0, nextLF), width);
5877
- }();
5881
+ })();
5878
5882
  var prevMoreIndented = string[0] === "\n" || string[0] === " ";
5879
5883
  var moreIndented;
5880
5884
  var match;
@@ -6252,7 +6256,7 @@ var require_engines = __commonJS({
6252
6256
  }
6253
6257
  };
6254
6258
  engines.javascript = {
6255
- parse: function parse(str, options, wrap) {
6259
+ parse: function parse3(str, options, wrap) {
6256
6260
  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
6261
  },
6258
6262
  stringify: function() {
@@ -6441,11 +6445,11 @@ var require_excerpt = __commonJS({
6441
6445
  if (typeof opts.excerpt === "function") {
6442
6446
  return opts.excerpt(file, opts);
6443
6447
  }
6444
- const sep = file.data.excerpt_separator || opts.excerpt_separator;
6445
- if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
6448
+ const sep2 = file.data.excerpt_separator || opts.excerpt_separator;
6449
+ if (sep2 == null && (opts.excerpt === false || opts.excerpt == null)) {
6446
6450
  return file;
6447
6451
  }
6448
- const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep || opts.delimiters[0];
6452
+ const delimiter = typeof opts.excerpt === "string" ? opts.excerpt : sep2 || opts.delimiters[0];
6449
6453
  const idx = file.content.indexOf(delimiter);
6450
6454
  if (idx !== -1) {
6451
6455
  file.excerpt = file.content.slice(0, idx);
@@ -6517,7 +6521,7 @@ var require_gray_matter = __commonJS({
6517
6521
  var excerpt = require_excerpt();
6518
6522
  var engines = require_engines();
6519
6523
  var toFile = require_to_file();
6520
- var parse = require_parse();
6524
+ var parse3 = require_parse();
6521
6525
  var utils = require_utils();
6522
6526
  function matter2(input, options) {
6523
6527
  if (input === "") {
@@ -6569,7 +6573,7 @@ var require_gray_matter = __commonJS({
6569
6573
  file.empty = file.content;
6570
6574
  file.data = {};
6571
6575
  } else {
6572
- file.data = parse(file.language, file.matter, opts);
6576
+ file.data = parse3(file.language, file.matter, opts);
6573
6577
  }
6574
6578
  if (closeIndex === len) {
6575
6579
  file.content = "";
@@ -7022,6 +7026,22 @@ var init_JavaScript = __esm({
7022
7026
  }
7023
7027
  return new mod();
7024
7028
  } else {
7029
+ if (mod.toString().trimStart().startsWith("class ")) {
7030
+ let modInstance = new mod();
7031
+ if (Object.hasOwn(modInstance, "data") || Object.hasOwn(modInstance, "render")) {
7032
+ if (!Object.hasOwn(modInstance, "render")) {
7033
+ mod.prototype.render = noop2;
7034
+ }
7035
+ if (!Object.hasOwn(modInstance, "data") && !mod.data && originalModData) {
7036
+ mod.prototype.data = originalModData;
7037
+ }
7038
+ return modInstance;
7039
+ } else {
7040
+ throw new Error(
7041
+ "Invalid class signature for an 11ty.js template: needs a render or data instance property."
7042
+ );
7043
+ }
7044
+ }
7025
7045
  return {
7026
7046
  ...originalModData ? { data: originalModData } : void 0,
7027
7047
  render: mod
@@ -7801,20 +7821,20 @@ var TemplateGlob = class _TemplateGlob {
7801
7821
  }
7802
7822
  return import_eleventy_utils.TemplatePath.addLeadingDotSlash(import_eleventy_utils.TemplatePath.join(...paths));
7803
7823
  }
7804
- static normalize(path11) {
7805
- path11 = path11.trim();
7806
- if (path11.charAt(0) === "!") {
7807
- return "!" + _TemplateGlob.normalizePath(path11.slice(1));
7824
+ static normalize(path9) {
7825
+ path9 = path9.trim();
7826
+ if (path9.charAt(0) === "!") {
7827
+ return "!" + _TemplateGlob.normalizePath(path9.slice(1));
7808
7828
  } else {
7809
- return _TemplateGlob.normalizePath(path11);
7829
+ return _TemplateGlob.normalizePath(path9);
7810
7830
  }
7811
7831
  }
7812
7832
  static map(files) {
7813
7833
  if (typeof files === "string") {
7814
7834
  return _TemplateGlob.normalize(files);
7815
7835
  } else if (Array.isArray(files)) {
7816
- return files.map(function(path11) {
7817
- return _TemplateGlob.normalize(path11);
7836
+ return files.map(function(path9) {
7837
+ return _TemplateGlob.normalize(path9);
7818
7838
  });
7819
7839
  } else {
7820
7840
  return files;
@@ -7828,6 +7848,98 @@ init_EleventyBaseError();
7828
7848
 
7829
7849
  // ../../src/Data/TemplateDataInitialGlobalData.js
7830
7850
  var import_lodash_custom = __toESM(require_lodash_custom(), 1);
7851
+
7852
+ // ../../src/Util/ReservedData.js
7853
+ var EleventyReservedDataError = class extends TypeError {
7854
+ };
7855
+ var ReservedData = class _ReservedData {
7856
+ static fullProperties = [
7857
+ "pkg",
7858
+ // Object.freeze’d upstream
7859
+ "eleventy",
7860
+ // Object.freeze’d upstream
7861
+ // "page" is only frozen for specific subproperties below
7862
+ "content",
7863
+ "collections"
7864
+ ];
7865
+ static properties = [
7866
+ // "page" is only frozen for specific subproperties below
7867
+ "content",
7868
+ "collections"
7869
+ ];
7870
+ static pageProperties = [
7871
+ "date",
7872
+ "inputPath",
7873
+ "fileSlug",
7874
+ "filePathStem",
7875
+ "outputFileExtension",
7876
+ "templateSyntax",
7877
+ "url",
7878
+ "outputPath"
7879
+ // not yet `excerpt` or `lang` set via front matter and computed data
7880
+ ];
7881
+ // Check in the data cascade for reserved data properties.
7882
+ static getReservedKeys(data, globalProperties = this.fullProperties) {
7883
+ if (!data) {
7884
+ return [];
7885
+ }
7886
+ let keys = globalProperties.filter((key) => {
7887
+ return key in data;
7888
+ });
7889
+ if ("page" in data) {
7890
+ if (typeof data.page === "object") {
7891
+ for (let key of this.pageProperties) {
7892
+ if (key in data.page) {
7893
+ keys.push(`page.${key}`);
7894
+ }
7895
+ }
7896
+ } else {
7897
+ keys.push("page");
7898
+ }
7899
+ }
7900
+ return keys;
7901
+ }
7902
+ static #check(data, sourceLocation, propertiesList) {
7903
+ let reservedNames = _ReservedData.getReservedKeys(data, propertiesList);
7904
+ if (reservedNames.length === 0) {
7905
+ return;
7906
+ }
7907
+ throw this.getError({
7908
+ reservedNames,
7909
+ sourceLocation
7910
+ });
7911
+ }
7912
+ // check for frozen objects too
7913
+ static check(data, sourceLocation) {
7914
+ this.#check(data, sourceLocation, this.fullProperties);
7915
+ }
7916
+ static checkSubset(data, sourceLocation) {
7917
+ this.#check(data, sourceLocation, this.properties);
7918
+ }
7919
+ static getError(options = {}) {
7920
+ let { reservedNames, cause, sourceLocation } = options || {};
7921
+ if (cause) {
7922
+ reservedNames ??= cause.reservedNames;
7923
+ }
7924
+ let e = new EleventyReservedDataError(
7925
+ `You attempted to set one of Eleventy\u2019s reserved data property names${reservedNames ? `: ${reservedNames.join(", ")}` : ""}${sourceLocation ? ` (source: ${sourceLocation})` : ""}. You can opt-out of this behavior with \`eleventyConfig.setFreezeReservedData(false)\` or rename/remove the property in your data cascade that conflicts with Eleventy\u2019s reserved property names (e.g. \`eleventy\`, \`pkg\`, and others). Learn more: https://v3.11ty.dev/docs/data-eleventy-supplied/`,
7926
+ { cause }
7927
+ );
7928
+ if (reservedNames) {
7929
+ e.reservedNames = reservedNames;
7930
+ }
7931
+ return e;
7932
+ }
7933
+ static isFrozenError(e) {
7934
+ return e instanceof TypeError && e.message.startsWith("Cannot add property") && e.message.endsWith("not extensible");
7935
+ }
7936
+ static isReservedDataError(e) {
7937
+ return e instanceof EleventyReservedDataError;
7938
+ }
7939
+ };
7940
+ var ReservedData_default = ReservedData;
7941
+
7942
+ // ../../src/Data/TemplateDataInitialGlobalData.js
7831
7943
  init_EleventyBaseError();
7832
7944
  var { set: lodashSet } = import_lodash_custom.default;
7833
7945
  var TemplateDataConfigError = class extends EleventyBaseError_default {
@@ -7852,6 +7964,9 @@ var TemplateDataInitialGlobalData = class {
7852
7964
  lodashSet(globalData, key, returnValue);
7853
7965
  }
7854
7966
  }
7967
+ if (this.config.freezeReservedData) {
7968
+ ReservedData_default.check(globalData, this.templateConfig.getActiveConfigPath());
7969
+ }
7855
7970
  return globalData;
7856
7971
  }
7857
7972
  };
@@ -8082,10 +8197,10 @@ var TemplateData = class _TemplateData {
8082
8197
  getGlobalDataExtensionPriorities() {
8083
8198
  return this.getUserDataExtensions().concat(["json", "mjs", "cjs", "js"]);
8084
8199
  }
8085
- static calculateExtensionPriority(path11, priorities) {
8200
+ static calculateExtensionPriority(path9, priorities) {
8086
8201
  for (let i = 0; i < priorities.length; i++) {
8087
8202
  let ext = priorities[i];
8088
- if (path11.endsWith(ext)) {
8203
+ if (path9.endsWith(ext)) {
8089
8204
  return i;
8090
8205
  }
8091
8206
  }
@@ -8137,11 +8252,14 @@ var TemplateData = class _TemplateData {
8137
8252
  `merging global data from ${files[j]} with an already existing global data file (${dataFileConflicts[objectPathTargetString]}). Overriding existing keys.`
8138
8253
  );
8139
8254
  let oldData = lodashGet(globalData, objectPathTarget);
8140
- data = _TemplateData.mergeDeep(this.config.dataDeepMerge, oldData, data);
8255
+ data = (0, import_eleventy_utils5.Merge)(oldData, data);
8141
8256
  }
8142
8257
  dataFileConflicts[objectPathTargetString] = files[j];
8143
8258
  debug3(`Found global data file ${files[j]} and adding as: ${objectPathTarget}`);
8144
8259
  lodashSet2(globalData, objectPathTarget, data);
8260
+ if (this.config.freezeReservedData) {
8261
+ ReservedData_default.check(globalData, files[j]);
8262
+ }
8145
8263
  }
8146
8264
  return globalData;
8147
8265
  }
@@ -8195,38 +8313,38 @@ var TemplateData = class _TemplateData {
8195
8313
  if (!Array.isArray(localDataPaths)) {
8196
8314
  localDataPaths = [localDataPaths];
8197
8315
  }
8198
- localDataPaths = localDataPaths.filter((path11) => {
8199
- return this.exists(path11);
8316
+ localDataPaths = localDataPaths.filter((path9) => {
8317
+ return this.exists(path9);
8200
8318
  });
8201
8319
  this.config.events.emit("eleventy.dataFiles", localDataPaths);
8202
8320
  if (!localDataPaths.length) {
8203
8321
  return localData;
8204
8322
  }
8205
8323
  let dataSource = {};
8206
- for (let path11 of localDataPaths) {
8207
- let dataForPath = await this.getDataValue(path11);
8324
+ for (let path9 of localDataPaths) {
8325
+ let dataForPath = await this.getDataValue(path9);
8208
8326
  if (!(0, import_eleventy_utils5.isPlainObject)(dataForPath)) {
8209
8327
  debug3(
8210
8328
  "Warning: Template and Directory data files expect an object to be returned, instead `%o` returned `%o`",
8211
- path11,
8329
+ path9,
8212
8330
  dataForPath
8213
8331
  );
8214
8332
  } else {
8215
8333
  let cleanedDataForPath = _TemplateData.cleanupData(dataForPath, {
8216
- file: path11
8334
+ file: path9
8217
8335
  });
8218
8336
  for (let key in cleanedDataForPath) {
8219
8337
  if (Object.prototype.hasOwnProperty.call(dataSource, key)) {
8220
8338
  debugWarn(
8221
8339
  "Local data files have conflicting data. Overwriting '%s' with data from '%s'. Previous data location was from '%s'",
8222
8340
  key,
8223
- path11,
8341
+ path9,
8224
8342
  dataSource[key]
8225
8343
  );
8226
8344
  }
8227
- dataSource[key] = path11;
8345
+ dataSource[key] = path9;
8228
8346
  }
8229
- _TemplateData.mergeDeep(this.config.dataDeepMerge, localData, cleanedDataForPath);
8347
+ (0, import_eleventy_utils5.Merge)(localData, cleanedDataForPath);
8230
8348
  }
8231
8349
  }
8232
8350
  return localData;
@@ -8254,42 +8372,42 @@ var TemplateData = class _TemplateData {
8254
8372
  hasUserDataExtensions() {
8255
8373
  return this.config.dataExtensions && this.config.dataExtensions.size > 0;
8256
8374
  }
8257
- async _parseDataFile(path11, parser, options = {}) {
8375
+ async _parseDataFile(path9, parser, options = {}) {
8258
8376
  let readFile = !("read" in options) || options.read === true;
8259
8377
  let rawInput;
8260
8378
  if (readFile) {
8261
- rawInput = loadContents(path11, options);
8379
+ rawInput = loadContents(path9, options);
8262
8380
  }
8263
8381
  if (readFile && !rawInput) {
8264
8382
  return {};
8265
8383
  }
8266
8384
  try {
8267
8385
  if (readFile) {
8268
- return parser(rawInput, path11);
8386
+ return parser(rawInput, path9);
8269
8387
  } else {
8270
- return parser(path11, path11);
8388
+ return parser(path9, path9);
8271
8389
  }
8272
8390
  } catch (e) {
8273
- throw new TemplateDataParseError(`Having trouble parsing data file ${path11}`, e);
8391
+ throw new TemplateDataParseError(`Having trouble parsing data file ${path9}`, e);
8274
8392
  }
8275
8393
  }
8276
8394
  // ignoreProcessing = false for global data files
8277
8395
  // ignoreProcessing = true for local data files
8278
- async getDataValue(path11) {
8279
- let extension = import_eleventy_utils5.TemplatePath.getExtension(path11);
8396
+ async getDataValue(path9) {
8397
+ let extension = import_eleventy_utils5.TemplatePath.getExtension(path9);
8280
8398
  if (extension === "js" || extension === "cjs" || extension === "mjs") {
8281
- if (!this.exists(path11)) {
8399
+ if (!this.exists(path9)) {
8282
8400
  return {};
8283
8401
  }
8284
8402
  let aggregateDataBench = this.benchmarks.aggregate.get("Data File");
8285
8403
  aggregateDataBench.before();
8286
- let dataBench = this.benchmarks.data.get(`\`${path11}\``);
8404
+ let dataBench = this.benchmarks.data.get(`\`${path9}\``);
8287
8405
  dataBench.before();
8288
8406
  let type = "cjs";
8289
8407
  if (extension === "mjs" || extension === "js" && this.isEsm) {
8290
8408
  type = "esm";
8291
8409
  }
8292
- let returnValue = await dynamicImport(path11, type);
8410
+ let returnValue = await dynamicImport(path9, type);
8293
8411
  if (typeof returnValue === "function") {
8294
8412
  let configApiGlobalData = await this.getInitialGlobalData();
8295
8413
  returnValue = await returnValue(configApiGlobalData || {});
@@ -8299,13 +8417,13 @@ var TemplateData = class _TemplateData {
8299
8417
  return returnValue;
8300
8418
  } else if (this.isUserDataExtension(extension)) {
8301
8419
  let { parser, options } = this.getUserDataParser(extension);
8302
- return this._parseDataFile(path11, parser, options);
8420
+ return this._parseDataFile(path9, parser, options);
8303
8421
  } else if (extension === "json") {
8304
8422
  const parser = (content) => JSON.parse(content);
8305
- return this._parseDataFile(path11, parser);
8423
+ return this._parseDataFile(path9, parser);
8306
8424
  } else {
8307
8425
  throw new TemplateDataParseError(
8308
- `Could not find an appropriate data parser for ${path11}. Do you need to add a plugin to your config file?`
8426
+ `Could not find an appropriate data parser for ${path9}. Do you need to add a plugin to your config file?`
8309
8427
  );
8310
8428
  }
8311
8429
  }
@@ -8374,16 +8492,6 @@ var TemplateData = class _TemplateData {
8374
8492
  debug3("getLocalDataPaths(%o): %o", templatePath, paths);
8375
8493
  return Unique(paths).reverse();
8376
8494
  }
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
8495
  /* Like cleanupData() but does not mutate */
8388
8496
  static getCleanedTagsImmutable(data, options = {}) {
8389
8497
  let tags = [];
@@ -8441,10 +8549,10 @@ var import_eleventy_utils24 = __toESM(require_eleventy_utils(), 1);
8441
8549
  init_debug();
8442
8550
 
8443
8551
  // ../../src/Template.js
8444
- var import_node_path6 = __toESM(require_path(), 1);
8552
+ var import_node_path8 = __toESM(require_path(), 1);
8445
8553
  init_shim_consume_fs();
8446
8554
  var import_lodash_custom8 = __toESM(require_lodash_custom(), 1);
8447
- var import_eleventy_utils19 = __toESM(require_eleventy_utils(), 1);
8555
+ var import_eleventy_utils20 = __toESM(require_eleventy_utils(), 1);
8448
8556
  init_debug();
8449
8557
 
8450
8558
  // ../../src/Util/ConsoleLogger.js
@@ -8544,45 +8652,51 @@ function spawnAsync() {
8544
8652
  throw new Error("This feature is not supported in `@11ty/client` bundles.");
8545
8653
  }
8546
8654
 
8547
- // ../../src/Util/DateGitLastUpdated.js
8548
- async function getGitLastUpdatedTimeStamp(filePath) {
8655
+ // ../../src/Util/MemoizeFunction.js
8656
+ function MemoizeFunction_default(callback, options = {}) {
8657
+ let { bench, name } = options;
8658
+ let cache = /* @__PURE__ */ new Map();
8659
+ return (...args) => {
8660
+ if (args.filter(Boolean).length > 1) {
8661
+ bench?.get(`(count) ${name} Not valid for memoize`).incrementCount();
8662
+ return callback(...args);
8663
+ }
8664
+ let [cacheKey] = args;
8665
+ if (!cache.has(cacheKey)) {
8666
+ cache.set(cacheKey, callback(...args));
8667
+ bench?.get(`(count) ${name} memoize miss`).incrementCount();
8668
+ return cache.get(cacheKey);
8669
+ }
8670
+ bench?.get(`(count) ${name} memoize hit`).incrementCount();
8671
+ return cache.get(cacheKey);
8672
+ };
8673
+ }
8674
+
8675
+ // ../../src/Util/Git.js
8676
+ var getCreatedTimestamp = MemoizeFunction_default(async function(filePath) {
8549
8677
  try {
8550
8678
  let timestamp = await spawnAsync(
8551
8679
  "git",
8552
8680
  // Formats https://www.git-scm.com/docs/git-log#_pretty_formats
8553
8681
  // %at author date, UNIX timestamp
8554
- ["log", "-1", "--format=%at", filePath]
8682
+ ["log", "--diff-filter=A", "--follow", "-1", "--format=%at", filePath]
8555
8683
  );
8556
8684
  return parseInt(timestamp, 10) * 1e3;
8557
8685
  } catch (e) {
8558
8686
  }
8559
- }
8560
- async function DateGitLastUpdated_default(inputPath) {
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) {
8687
+ });
8688
+ var getUpdatedTimestamp = MemoizeFunction_default(async function(filePath) {
8569
8689
  try {
8570
8690
  let timestamp = await spawnAsync(
8571
8691
  "git",
8572
8692
  // Formats https://www.git-scm.com/docs/git-log#_pretty_formats
8573
8693
  // %at author date, UNIX timestamp
8574
- ["log", "--diff-filter=A", "--follow", "-1", "--format=%at", filePath]
8694
+ ["log", "-1", "--format=%at", filePath]
8575
8695
  );
8576
8696
  return parseInt(timestamp, 10) * 1e3;
8577
8697
  } catch (e) {
8578
8698
  }
8579
- }
8580
- async function DateGitFirstAdded_default(inputPath) {
8581
- let timestamp = await getGitFirstAddedTimeStamp(inputPath);
8582
- if (timestamp) {
8583
- return new Date(timestamp);
8584
- }
8585
- }
8699
+ });
8586
8700
 
8587
8701
  // ../../src/TemplateContent.js
8588
8702
  init_shim_consume_fs();
@@ -8612,7 +8726,10 @@ function JavaScript_default(frontMatterCode, context = {}) {
8612
8726
  let { filePath } = context;
8613
8727
  let trimmed = frontMatterCode.trimStart();
8614
8728
  if (trimmed.startsWith("{")) {
8615
- return RetrieveGlobals(`export default ${trimmed}`, filePath).then((res) => {
8729
+ return RetrieveGlobals(`export default ${trimmed}`, filePath, {
8730
+ isJavaScriptFrontMatterCompat: true
8731
+ // turns off implicit exports
8732
+ }).then((res) => {
8616
8733
  return res.default;
8617
8734
  });
8618
8735
  }
@@ -8623,6 +8740,7 @@ function JavaScript_default(frontMatterCode, context = {}) {
8623
8740
  var EOL = "\n";
8624
8741
 
8625
8742
  // ../../src/TemplateRender.js
8743
+ init_debug();
8626
8744
  init_EleventyBaseError();
8627
8745
 
8628
8746
  // ../../src/Engines/TemplateEngineManager.js
@@ -8774,6 +8892,7 @@ var TemplateEngineManager = class _TemplateEngineManager {
8774
8892
  var TemplateEngineManager_default = TemplateEngineManager;
8775
8893
 
8776
8894
  // ../../src/TemplateRender.js
8895
+ var debugConfiguration = debug_default("Eleventy:UserConfig");
8777
8896
  var TemplateRenderUnknownEngineError = class extends EleventyBaseError_default {
8778
8897
  };
8779
8898
  var TemplateRender = class _TemplateRender {
@@ -8786,6 +8905,12 @@ var TemplateRender = class _TemplateRender {
8786
8905
  this.#setConfig(config);
8787
8906
  this.engineNameOrPath = tmplPath;
8788
8907
  this.parseMarkdownWith = this.config.markdownTemplateEngine;
8908
+ if (this.parseMarkdownWith === "md") {
8909
+ this.parseMarkdownWith = false;
8910
+ debugConfiguration(
8911
+ "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"
8912
+ );
8913
+ }
8789
8914
  this.parseHtmlWith = this.config.htmlTemplateEngine;
8790
8915
  }
8791
8916
  #setConfig(config) {
@@ -9080,7 +9205,7 @@ var TemplateContent = class _TemplateContent {
9080
9205
  #initialized = false;
9081
9206
  #config;
9082
9207
  #templateRender;
9083
- #preprocessorEngine;
9208
+ #renderPreprocessorEngine;
9084
9209
  #extensionMap;
9085
9210
  #configOptions;
9086
9211
  #frontMatterOptions;
@@ -9102,7 +9227,7 @@ var TemplateContent = class _TemplateContent {
9102
9227
  let preprocessorEngineName = this.templateRender.getPreprocessorEngineName();
9103
9228
  if (preprocessorEngineName && this.templateRender.engine.getName() !== preprocessorEngineName) {
9104
9229
  let engine = await this.templateRender.getEngineByName(preprocessorEngineName);
9105
- this.#preprocessorEngine = engine;
9230
+ this.#renderPreprocessorEngine = engine;
9106
9231
  }
9107
9232
  }
9108
9233
  resetCachedTemplate({ eleventyConfig }) {
@@ -9311,14 +9436,14 @@ var TemplateContent = class _TemplateContent {
9311
9436
  }
9312
9437
  /* Incremental builds cache the Template instances (in TemplateWriter) but
9313
9438
  * these template specific caches are important for Pagination */
9314
- static cache(path11, content) {
9315
- this._inputCache.set(import_eleventy_utils7.TemplatePath.absolutePath(path11), content);
9439
+ static cache(path9, content) {
9440
+ this._inputCache.set(import_eleventy_utils7.TemplatePath.absolutePath(path9), content);
9316
9441
  }
9317
- static getCached(path11) {
9318
- return this._inputCache.get(import_eleventy_utils7.TemplatePath.absolutePath(path11));
9442
+ static getCached(path9) {
9443
+ return this._inputCache.get(import_eleventy_utils7.TemplatePath.absolutePath(path9));
9319
9444
  }
9320
- static deleteFromInputCache(path11) {
9321
- this._inputCache.delete(import_eleventy_utils7.TemplatePath.absolutePath(path11));
9445
+ static deleteFromInputCache(path9) {
9446
+ this._inputCache.delete(import_eleventy_utils7.TemplatePath.absolutePath(path9));
9322
9447
  }
9323
9448
  // Used via clone
9324
9449
  setInputContent(content) {
@@ -9389,6 +9514,9 @@ var TemplateContent = class _TemplateContent {
9389
9514
  }
9390
9515
  return this._frontMatterDataCache;
9391
9516
  }
9517
+ getEngineNames(engineOverride) {
9518
+ return this.templateRender.getEnginesList(engineOverride);
9519
+ }
9392
9520
  async getEngineOverride() {
9393
9521
  return this.getFrontMatterData().then((data) => {
9394
9522
  return data[this.config.keys.engineOverride];
@@ -9396,8 +9524,8 @@ var TemplateContent = class _TemplateContent {
9396
9524
  }
9397
9525
  // checks engines
9398
9526
  isTemplateCacheable() {
9399
- if (this.#preprocessorEngine) {
9400
- return this.#preprocessorEngine.cacheable;
9527
+ if (this.#renderPreprocessorEngine) {
9528
+ return this.#renderPreprocessorEngine.cacheable;
9401
9529
  }
9402
9530
  return this.engine.cacheable;
9403
9531
  }
@@ -9470,8 +9598,8 @@ var TemplateContent = class _TemplateContent {
9470
9598
  }
9471
9599
  getParseForSymbolsFunction(str) {
9472
9600
  let engine = this.engine;
9473
- if (this.#preprocessorEngine) {
9474
- engine = this.#preprocessorEngine;
9601
+ if (this.#renderPreprocessorEngine) {
9602
+ engine = this.#renderPreprocessorEngine;
9475
9603
  }
9476
9604
  if ("parseForSymbols" in engine) {
9477
9605
  return () => {
@@ -9632,9 +9760,9 @@ var TemplateContent = class _TemplateContent {
9632
9760
  };
9633
9761
  TemplateContent._inputCache = /* @__PURE__ */ new Map();
9634
9762
  TemplateContent._compileCache = /* @__PURE__ */ new Map();
9635
- EventBus_default.on("eleventy.resourceModified", (path11) => {
9636
- TemplateContent.deleteFromInputCache(path11);
9637
- let normalized = import_eleventy_utils7.TemplatePath.addLeadingDotSlash(path11);
9763
+ EventBus_default.on("eleventy.resourceModified", (path9) => {
9764
+ TemplateContent.deleteFromInputCache(path9);
9765
+ let normalized = import_eleventy_utils7.TemplatePath.addLeadingDotSlash(path9);
9638
9766
  let compileCache = TemplateContent._compileCache.get(normalized);
9639
9767
  if (compileCache) {
9640
9768
  compileCache.clear();
@@ -9649,11 +9777,13 @@ var TemplateContent_default = TemplateContent;
9649
9777
  var import_node_path3 = __toESM(require_path(), 1);
9650
9778
  var import_eleventy_utils8 = __toESM(require_eleventy_utils(), 1);
9651
9779
  var TemplatePermalink = class _TemplatePermalink {
9780
+ #dynamicPermalinkEnabled;
9652
9781
  // `link` with template syntax should have already been rendered in Template.js
9653
- constructor(link, extraSubdir) {
9782
+ constructor(link, extraSubdir, isDynamicPermalinkEnabled = true) {
9654
9783
  let isLinkAnObject = (0, import_eleventy_utils8.isPlainObject)(link);
9655
9784
  this._isRendered = true;
9656
9785
  this._writeToFileSystem = true;
9786
+ this.#dynamicPermalinkEnabled = isDynamicPermalinkEnabled;
9657
9787
  let buildLink;
9658
9788
  if (isLinkAnObject) {
9659
9789
  if ("build" in link) {
@@ -9682,7 +9812,7 @@ var TemplatePermalink = class _TemplatePermalink {
9682
9812
 
9683
9813
  ${buildLink.toString()}` : "";
9684
9814
  throw new Error(
9685
- "Expected permalink value to be a string. Received `" + typeof buildLink + "`" + stringToString
9815
+ `Expected permalink value to be a string. Received \`${typeof buildLink}\` (dynamicPermalink: ${this.#dynamicPermalinkEnabled})${stringToString}`
9686
9816
  );
9687
9817
  }
9688
9818
  this.buildLink = buildLink;
@@ -9780,15 +9910,15 @@ ${buildLink.toString()}` : "";
9780
9910
  }
9781
9911
  return folders[folders.length - 1] === base;
9782
9912
  }
9783
- static generate(dir, filenameNoExt, extraSubdir, fileExtension = "html") {
9784
- let path11;
9913
+ static generate(dir, filenameNoExt, extraSubdir, fileExtension = "html", isDynamicPermalinkEnabled) {
9914
+ let path9;
9785
9915
  if (fileExtension === "html") {
9786
9916
  let hasDupeFolder = _TemplatePermalink._hasDuplicateFolder(dir, filenameNoExt);
9787
- path11 = (dir ? dir + "/" : "") + (filenameNoExt !== "index" && !hasDupeFolder ? filenameNoExt + "/" : "") + "index.html";
9917
+ path9 = (dir ? dir + "/" : "") + (filenameNoExt !== "index" && !hasDupeFolder ? filenameNoExt + "/" : "") + "index.html";
9788
9918
  } else {
9789
- path11 = (dir ? dir + "/" : "") + filenameNoExt + "." + fileExtension;
9919
+ path9 = (dir ? dir + "/" : "") + filenameNoExt + "." + fileExtension;
9790
9920
  }
9791
- return new _TemplatePermalink(path11, extraSubdir);
9921
+ return new _TemplatePermalink(path9, extraSubdir, isDynamicPermalinkEnabled);
9792
9922
  }
9793
9923
  };
9794
9924
  var TemplatePermalink_default = TemplatePermalink;
@@ -9800,14 +9930,14 @@ init_debug();
9800
9930
  // ../../src/TemplateLayoutPathResolver.js
9801
9931
  var import_eleventy_utils9 = __toESM(require_eleventy_utils(), 1);
9802
9932
  var TemplateLayoutPathResolver = class {
9803
- constructor(path11, extensionMap, templateConfig) {
9933
+ constructor(path9, extensionMap, templateConfig) {
9804
9934
  if (!templateConfig) {
9805
9935
  throw new Error("Expected `templateConfig` in TemplateLayoutPathResolver constructor");
9806
9936
  }
9807
9937
  this.templateConfig = templateConfig;
9808
- this.originalPath = path11;
9938
+ this.originalPath = path9;
9809
9939
  this.originalDisplayPath = import_eleventy_utils9.TemplatePath.join(this.layoutsDir, this.originalPath) + ` (via \`layout: ${this.originalPath}\`)`;
9810
- this.path = path11;
9940
+ this.path = path9;
9811
9941
  this.aliases = {};
9812
9942
  this.extensionMap = extensionMap;
9813
9943
  if (!extensionMap) {
@@ -9851,7 +9981,8 @@ var TemplateLayoutPathResolver = class {
9851
9981
  return true;
9852
9982
  }
9853
9983
  let fullPath = this.templateConfig.directories.getLayoutPath(layoutPath);
9854
- if (this.templateConfig.existsCache.exists(fullPath)) {
9984
+ let existsCache = this.templateConfig.existsCache;
9985
+ if (existsCache.exists(fullPath) && !existsCache.isDirectory(fullPath)) {
9855
9986
  return true;
9856
9987
  }
9857
9988
  return false;
@@ -9974,6 +10105,29 @@ var LayoutCache_default = layoutCache;
9974
10105
 
9975
10106
  // ../../src/TemplateLayout.js
9976
10107
  var debugDev3 = debug_default("Dev:Eleventy:TemplateLayout");
10108
+ var CdataWrapper = class _CdataWrapper {
10109
+ static PREFIX = "<![CDATA[STARTRAW";
10110
+ static POSTFIX = "ENDRAW]]>";
10111
+ constructor(pageTemplateSyntax = "", layoutTemplateSyntax = "") {
10112
+ this.isEligible = _CdataWrapper.isEligible(pageTemplateSyntax, layoutTemplateSyntax);
10113
+ }
10114
+ // Markdown in Markdown layout only
10115
+ static isEligible(templateSyntax, layoutTemplateSyntax) {
10116
+ return templateSyntax.split(",").includes("md") && layoutTemplateSyntax.split(",").includes("md");
10117
+ }
10118
+ wrap(content) {
10119
+ if (this.isEligible) {
10120
+ return _CdataWrapper.PREFIX + content + _CdataWrapper.POSTFIX;
10121
+ }
10122
+ return content;
10123
+ }
10124
+ unwrap(content) {
10125
+ if (this.isEligible) {
10126
+ return content.replaceAll(_CdataWrapper.PREFIX, "").replaceAll(_CdataWrapper.POSTFIX, "");
10127
+ }
10128
+ return content;
10129
+ }
10130
+ };
9977
10131
  var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
9978
10132
  constructor(key, extensionMap, eleventyConfig) {
9979
10133
  if (!eleventyConfig || eleventyConfig.constructor.name !== "TemplateConfig") {
@@ -10070,7 +10224,7 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
10070
10224
  for (let j = map.length - 1; j >= 0; j--) {
10071
10225
  dataToMerge.push(map[j].frontMatterData);
10072
10226
  }
10073
- let data = TemplateData_default.mergeDeep(this.config.dataDeepMerge, {}, ...dataToMerge);
10227
+ let data = (0, import_eleventy_utils11.Merge)({}, ...dataToMerge);
10074
10228
  delete data[this.config.keys.layout];
10075
10229
  return data;
10076
10230
  }
@@ -10096,6 +10250,8 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
10096
10250
  let fns = [];
10097
10251
  try {
10098
10252
  fns.push({
10253
+ inputPath: this.inputPath,
10254
+ template: this,
10099
10255
  render: await this.getCachedCompiledLayoutFunction()
10100
10256
  });
10101
10257
  if (layoutMap.length > 1) {
@@ -10129,14 +10285,20 @@ var TemplateLayout = class _TemplateLayout extends TemplateContent_default {
10129
10285
  // Trouble: layouts may need data variables present downstream/upstream
10130
10286
  // This is called from Template->renderPageEntry
10131
10287
  async renderPageEntry(pageEntry) {
10288
+ let pageTemplateSyntax = pageEntry.template?.getEngineNames(
10289
+ pageEntry.data[this.config.keys.engineOverride]
10290
+ );
10132
10291
  let templateContent = pageEntry.templateContent;
10133
10292
  let compiledFunctions = await this.getCompiledLayoutFunctions();
10134
- for (let { render } of compiledFunctions) {
10293
+ for (let { render, template } of compiledFunctions) {
10294
+ let layoutTemplateSyntax = template.getEngineNames();
10295
+ let cdata = new CdataWrapper(pageTemplateSyntax, layoutTemplateSyntax);
10135
10296
  let data = {
10136
- content: templateContent,
10137
- ...pageEntry.data
10297
+ ...pageEntry.data,
10298
+ // This should come *after* data, so `content` have override `content` props set in data cascade
10299
+ content: cdata.wrap(templateContent)
10138
10300
  };
10139
- templateContent = await render(data);
10301
+ templateContent = cdata.unwrap(await render(data));
10140
10302
  }
10141
10303
  return templateContent;
10142
10304
  }
@@ -10160,7 +10322,7 @@ var TemplateFileSlug = class {
10160
10322
  inputPath = import_eleventy_utils12.TemplatePath.stripLeadingSubPath(inputPath, inputDir);
10161
10323
  }
10162
10324
  this.inputPath = inputPath;
10163
- this.cleanInputPath = inputPath.replace(/^.\//, "");
10325
+ this.cleanInputPath = import_eleventy_utils12.TemplatePath.stripLeadingDotSlash(inputPath);
10164
10326
  let dirs = this.cleanInputPath.split("/");
10165
10327
  this.dirs = dirs;
10166
10328
  this.dirs.pop();
@@ -10835,15 +10997,17 @@ var Pagination = class _Pagination {
10835
10997
  let {
10836
10998
  /*linkInstance,*/
10837
10999
  rawPath,
10838
- path: path11,
10839
- href
11000
+ path: path9,
11001
+ href,
11002
+ dir
10840
11003
  } = await cloned.getOutputLocations(clonedData);
10841
11004
  if (rawPath) {
10842
11005
  links.push("/" + rawPath);
10843
11006
  }
10844
11007
  hrefs.push(href);
10845
11008
  clonedData.page.url = href;
10846
- clonedData.page.outputPath = path11;
11009
+ clonedData.page.outputPath = path9;
11010
+ clonedData.page.dir = dir;
10847
11011
  entries.push({
10848
11012
  pageNumber,
10849
11013
  // This is used by i18n Plugin to allow subgroups of nested pagination to be separate
@@ -11055,66 +11219,6 @@ function fromISOtoDateUTC(dateValue, inputPath) {
11055
11219
  }
11056
11220
  }
11057
11221
 
11058
- // ../../src/Util/ReservedData.js
11059
- var EleventyReservedDataError = class extends TypeError {
11060
- };
11061
- var ReservedData = class _ReservedData {
11062
- static properties = [
11063
- // "pkg", // Object.freeze’d upstream
11064
- // "eleventy", // Object.freeze’d upstream
11065
- // "page" is only frozen for specific subproperties below
11066
- "content",
11067
- "collections"
11068
- ];
11069
- static pageProperties = [
11070
- "date",
11071
- "inputPath",
11072
- "fileSlug",
11073
- "filePathStem",
11074
- "outputFileExtension",
11075
- "templateSyntax",
11076
- "url",
11077
- "outputPath"
11078
- // not yet `excerpt` or `lang` set via front matter and computed data
11079
- ];
11080
- // Check in the data cascade for reserved data properties.
11081
- static getReservedKeys(data) {
11082
- if (!data) {
11083
- return [];
11084
- }
11085
- let keys = this.properties.filter((key) => {
11086
- return key in data;
11087
- });
11088
- if ("page" in data) {
11089
- if (typeof data.page === "object") {
11090
- for (let key of this.pageProperties) {
11091
- if (key in data.page) {
11092
- keys.push(`page.${key}`);
11093
- }
11094
- }
11095
- } else {
11096
- keys.push("page");
11097
- }
11098
- }
11099
- return keys;
11100
- }
11101
- static check(data) {
11102
- let reserved = _ReservedData.getReservedKeys(data);
11103
- if (reserved.length === 0) {
11104
- return;
11105
- }
11106
- let error = new EleventyReservedDataError(
11107
- `Cannot override reserved Eleventy properties: ${reserved.join(", ")}`
11108
- );
11109
- error.reservedNames = reserved;
11110
- throw error;
11111
- }
11112
- static isReservedDataError(e) {
11113
- return e instanceof EleventyReservedDataError;
11114
- }
11115
- };
11116
- var ReservedData_default = ReservedData;
11117
-
11118
11222
  // ../../src/Util/TransformsUtil.js
11119
11223
  init_EleventyBaseError();
11120
11224
  var import_eleventy_utils18 = __toESM(require_eleventy_utils(), 1);
@@ -11202,6 +11306,154 @@ var FileSystemManager = class {
11202
11306
  }
11203
11307
  };
11204
11308
 
11309
+ // ../../src/TemplatePreprocessors.js
11310
+ var TemplatePreprocessors = class {
11311
+ constructor(preprocessors) {
11312
+ this.preprocessors = preprocessors || [];
11313
+ }
11314
+ async runAll(template, data) {
11315
+ let { inputPath } = template;
11316
+ let content = await template.getPreRender();
11317
+ let skippedVia = false;
11318
+ for (let [name, preprocessor] of Object.entries(this.preprocessors)) {
11319
+ let { filter, callback } = preprocessor;
11320
+ let filters;
11321
+ if (Array.isArray(filter)) {
11322
+ filters = filter;
11323
+ } else if (typeof filter === "string") {
11324
+ filters = filter.split(",");
11325
+ } else {
11326
+ throw new Error(
11327
+ `Expected file extensions passed to "${name}" content preprocessor to be a string or array. Received: ${filter}`
11328
+ );
11329
+ }
11330
+ filters = filters.map((extension) => {
11331
+ if (extension.startsWith(".") || extension === "*") {
11332
+ return extension;
11333
+ }
11334
+ return `.${extension}`;
11335
+ });
11336
+ if (!filters.some((extension) => extension === "*" || inputPath.endsWith(extension))) {
11337
+ continue;
11338
+ }
11339
+ try {
11340
+ let ret = await callback.call(
11341
+ {
11342
+ inputPath
11343
+ },
11344
+ data,
11345
+ content
11346
+ );
11347
+ if (ret === false) {
11348
+ skippedVia = name;
11349
+ continue;
11350
+ }
11351
+ if (ret) {
11352
+ content = ret;
11353
+ }
11354
+ } catch (e) {
11355
+ throw new Error(
11356
+ `Preprocessor \`${name}\` encountered an error when transforming ${inputPath}.`,
11357
+ { cause: e }
11358
+ );
11359
+ }
11360
+ }
11361
+ return {
11362
+ skippedVia,
11363
+ content
11364
+ };
11365
+ }
11366
+ };
11367
+
11368
+ // ../../src/Util/PathNormalizer.js
11369
+ var import_node_path7 = __toESM(require_path(), 1);
11370
+ var import_eleventy_utils19 = __toESM(require_eleventy_utils(), 1);
11371
+
11372
+ // ../../src/Adapters/Packages/url.core.js
11373
+ var import_node_path6 = __toESM(require_path());
11374
+ function fileURLToPath(url) {
11375
+ if (typeof url === "string") {
11376
+ url = new URL(url);
11377
+ }
11378
+ if (url.protocol !== "file:") {
11379
+ throw new Error("The URL must use the file: protocol");
11380
+ }
11381
+ if (url.hostname) {
11382
+ throw new Error("The file: URL host must be 'localhost' or empty");
11383
+ }
11384
+ if (/%2f/i.test(url.pathname)) {
11385
+ throw new Error("The file: URL path must not include encoded / characters");
11386
+ }
11387
+ return import_node_path6.default.normalize(decodeURIComponent(url.pathname));
11388
+ }
11389
+
11390
+ // ../../src/Util/PathNormalizer.js
11391
+ var PathNormalizer = class {
11392
+ static getParts(inputPath) {
11393
+ if (!inputPath) {
11394
+ return [];
11395
+ }
11396
+ let separator = "/";
11397
+ if (inputPath.includes(import_node_path7.sep)) {
11398
+ separator = import_node_path7.sep;
11399
+ }
11400
+ return inputPath.split(separator).filter((entry) => entry !== ".");
11401
+ }
11402
+ // order is important here: the top-most directory returns first
11403
+ // array of file and all parent directories
11404
+ static getAllPaths(inputPath) {
11405
+ let parts = this.getParts(inputPath);
11406
+ let allPaths = [];
11407
+ let fullpath = "";
11408
+ for (let part of parts) {
11409
+ fullpath += (fullpath.length > 0 ? "/" : "") + part;
11410
+ allPaths.push(fullpath);
11411
+ }
11412
+ return allPaths;
11413
+ }
11414
+ static normalizeSeperator(inputPath) {
11415
+ if (!inputPath) {
11416
+ return inputPath;
11417
+ }
11418
+ return inputPath.split(import_node_path7.sep).join("/");
11419
+ }
11420
+ static addTrailingSlashToDirectory(dir) {
11421
+ if (dir.endsWith("/")) {
11422
+ return dir;
11423
+ }
11424
+ return dir + "/";
11425
+ }
11426
+ // returns a path
11427
+ static getDirectoryFromFilePath(filePath) {
11428
+ let parsed = (0, import_node_path7.parse)(filePath);
11429
+ return this.addTrailingSlashToDirectory(parsed.dir);
11430
+ }
11431
+ static fullNormalization(inputPath) {
11432
+ if (typeof inputPath !== "string") {
11433
+ return inputPath;
11434
+ }
11435
+ if (inputPath.startsWith("file://")) {
11436
+ inputPath = fileURLToPath(inputPath);
11437
+ }
11438
+ return import_eleventy_utils19.TemplatePath.stripLeadingDotSlash(
11439
+ this.normalizeSeperator(import_eleventy_utils19.TemplatePath.relativePath(inputPath))
11440
+ );
11441
+ }
11442
+ };
11443
+
11444
+ // ../../src/Util/UrlUtil.js
11445
+ function getDirectoryFromUrl(url) {
11446
+ if (url === false) {
11447
+ return false;
11448
+ }
11449
+ if (url.endsWith("/")) {
11450
+ return url;
11451
+ }
11452
+ let parts = url.split("/");
11453
+ parts.pop();
11454
+ return parts.join("/") + "/";
11455
+ }
11456
+
11205
11457
  // ../../src/Template.js
11206
11458
  var { set: lodashSet8, get: lodashGet5 } = import_lodash_custom8.default;
11207
11459
  var debug13 = debug_default("Eleventy:Template");
@@ -11210,10 +11462,11 @@ var Template = class _Template extends TemplateContent_default {
11210
11462
  #logger;
11211
11463
  #fsManager;
11212
11464
  #stats;
11465
+ #preprocessorCache;
11213
11466
  constructor(templatePath, templateData, extensionMap, config) {
11214
11467
  debugDev4("new Template(%o)", templatePath);
11215
11468
  super(templatePath, config);
11216
- this.parsed = import_node_path6.default.parse(templatePath);
11469
+ this.parsed = (0, import_node_path8.parse)(templatePath);
11217
11470
  this.extraOutputSubdirectory = "";
11218
11471
  this.extensionMap = extensionMap;
11219
11472
  this.templateData = templateData;
@@ -11229,6 +11482,7 @@ var Template = class _Template extends TemplateContent_default {
11229
11482
  this.outputFormat = "fs";
11230
11483
  this.behavior = new TemplateBehavior_default(this.config);
11231
11484
  this.behavior.setOutputFormat(this.outputFormat);
11485
+ this.templatePreprocessor = new TemplatePreprocessors(this.config.preprocessors);
11232
11486
  }
11233
11487
  #initFileSlug() {
11234
11488
  this.fileSlug = new TemplateFileSlug_default(this.inputPath, this.extensionMap, this.eleventyConfig);
@@ -11278,6 +11532,9 @@ var Template = class _Template extends TemplateContent_default {
11278
11532
  resetCaches(types) {
11279
11533
  types = this.getResetTypes(types);
11280
11534
  super.resetCaches(types);
11535
+ if (types.data || types.read) {
11536
+ this.#preprocessorCache = void 0;
11537
+ }
11281
11538
  if (types.data) {
11282
11539
  delete this._dataCache;
11283
11540
  }
@@ -11305,12 +11562,12 @@ var Template = class _Template extends TemplateContent_default {
11305
11562
  this.extraOutputSubdirectory = dir + "/";
11306
11563
  }
11307
11564
  getTemplateSubfolder() {
11308
- let dir = import_eleventy_utils19.TemplatePath.absolutePath(this.parsed.dir);
11309
- let inputDir = import_eleventy_utils19.TemplatePath.absolutePath(this.inputDir);
11565
+ let dir = import_eleventy_utils20.TemplatePath.absolutePath(this.parsed.dir);
11566
+ let inputDir = import_eleventy_utils20.TemplatePath.absolutePath(this.inputDir);
11310
11567
  if (inputDir === "/" && dir.startsWith("/")) {
11311
11568
  return dir;
11312
11569
  }
11313
- return import_eleventy_utils19.TemplatePath.stripLeadingSubPath(dir, inputDir);
11570
+ return import_eleventy_utils20.TemplatePath.stripLeadingSubPath(dir, inputDir);
11314
11571
  }
11315
11572
  templateUsesLayouts(pageData) {
11316
11573
  if (this.hasTemplateRender()) {
@@ -11331,25 +11588,20 @@ var Template = class _Template extends TemplateContent_default {
11331
11588
  get baseFile() {
11332
11589
  return this.extensionMap.removeTemplateExtension(this.parsed.base);
11333
11590
  }
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
11591
  async _getLink(data) {
11341
11592
  if (!data) {
11342
11593
  throw new Error("Internal error: data argument missing in Template->_getLink");
11343
11594
  }
11344
11595
  let permalink = data[this.config.keys.permalink] ?? data?.[this.config.keys.computed]?.[this.config.keys.permalink];
11345
11596
  let permalinkValue;
11597
+ let isDynamicPermalinkEnabled = this.config.dynamicPermalinks && data.dynamicPermalink !== false;
11346
11598
  if (typeof permalink === "boolean") {
11347
11599
  debugDev4("Using boolean permalink %o", permalink);
11348
11600
  permalinkValue = permalink;
11349
- } else if (permalink && (!this.config.dynamicPermalinks || data.dynamicPermalink === false)) {
11601
+ } else if (permalink && !isDynamicPermalinkEnabled) {
11350
11602
  debugDev4("Not using dynamic permalinks, using %o", permalink);
11351
11603
  permalinkValue = permalink;
11352
- } else if ((0, import_eleventy_utils19.isPlainObject)(permalink)) {
11604
+ } else if ((0, import_eleventy_utils20.isPlainObject)(permalink)) {
11353
11605
  let isEmptyObject = Object.keys(permalink).length === 0;
11354
11606
  if (!isEmptyObject) {
11355
11607
  let promises2 = [];
@@ -11383,7 +11635,7 @@ var Template = class _Template extends TemplateContent_default {
11383
11635
  debug13("Rendering permalink for %o: %s becomes %o", this.inputPath, permalink, permalinkValue);
11384
11636
  debugDev4("Permalink rendered with data: %o", data);
11385
11637
  }
11386
- if (!permalink && this.config.dynamicPermalinks && data.dynamicPermalink !== false) {
11638
+ if (!permalink && isDynamicPermalinkEnabled) {
11387
11639
  let tr = await this.getTemplateRender();
11388
11640
  let permalinkCompilation = tr.engine.permalinkNeedsCompilation("");
11389
11641
  if (typeof permalinkCompilation === "function") {
@@ -11398,13 +11650,21 @@ var Template = class _Template extends TemplateContent_default {
11398
11650
  }
11399
11651
  }
11400
11652
  if (permalinkValue !== void 0) {
11401
- return this._getRawPermalinkInstance(permalinkValue);
11653
+ let p2 = new TemplatePermalink_default(
11654
+ permalinkValue,
11655
+ this.extraOutputSubdirectory,
11656
+ isDynamicPermalinkEnabled
11657
+ );
11658
+ p2.setUrlTransforms(this.config.urlTransforms);
11659
+ this.behavior.setFromPermalink(p2);
11660
+ return p2;
11402
11661
  }
11403
11662
  let p = TemplatePermalink_default.generate(
11404
11663
  this.getTemplateSubfolder(),
11405
11664
  this.baseFile,
11406
11665
  this.extraOutputSubdirectory,
11407
- this.engine.defaultTemplateFileExtension
11666
+ this.engine.defaultTemplateFileExtension,
11667
+ isDynamicPermalinkEnabled
11408
11668
  );
11409
11669
  p.setUrlTransforms(this.config.urlTransforms);
11410
11670
  return p;
@@ -11419,17 +11679,21 @@ var Template = class _Template extends TemplateContent_default {
11419
11679
  async getOutputLocations(data) {
11420
11680
  this.bench.get("(count) getOutputLocations").incrementCount();
11421
11681
  let link = await this._getLink(data);
11422
- let path11;
11682
+ let path9;
11423
11683
  if (await this.usePermalinkRoot()) {
11424
- path11 = link.toPathFromRoot();
11684
+ path9 = link.toPathFromRoot();
11425
11685
  } else {
11426
- path11 = link.toPath(this.outputDir);
11686
+ path9 = link.toPath(this.outputDir);
11427
11687
  }
11688
+ let href = link.toHref();
11428
11689
  return {
11429
11690
  linkInstance: link,
11430
11691
  rawPath: link.toOutputPath(),
11431
- href: link.toHref(),
11432
- path: path11
11692
+ // includes output directory
11693
+ href,
11694
+ path: path9,
11695
+ dir: getDirectoryFromUrl(href)
11696
+ // for `page.dir`
11433
11697
  };
11434
11698
  }
11435
11699
  // This is likely now a test-only method
@@ -11468,7 +11732,7 @@ var Template = class _Template extends TemplateContent_default {
11468
11732
  let globalData = {};
11469
11733
  if (this.templateData) {
11470
11734
  localData = await this.templateData.getTemplateDirectoryData(this.inputPath);
11471
- globalData = await this.templateData.getGlobalData(this.inputPath);
11735
+ globalData = await this.templateData.getGlobalData();
11472
11736
  debugDev4("%o getData getTemplateDirectoryData and getGlobalData", this.inputPath);
11473
11737
  }
11474
11738
  let { data: frontMatterData } = await this.getFrontMatterData();
@@ -11483,26 +11747,16 @@ var Template = class _Template extends TemplateContent_default {
11483
11747
  }
11484
11748
  }
11485
11749
  try {
11486
- let mergedData = TemplateData_default.mergeDeep(
11487
- this.config.dataDeepMerge,
11488
- {},
11489
- globalData,
11490
- mergedLayoutData,
11491
- localData,
11492
- frontMatterData
11493
- );
11750
+ let mergedData = (0, import_eleventy_utils20.Merge)({}, globalData, mergedLayoutData, localData, frontMatterData);
11494
11751
  if (this.config.freezeReservedData) {
11495
- ReservedData_default.check(mergedData);
11752
+ ReservedData_default.checkSubset(mergedData);
11496
11753
  }
11497
11754
  await this.addPage(mergedData);
11498
11755
  debugDev4("%o getData mergedData", this.inputPath);
11499
11756
  return mergedData;
11500
11757
  } catch (e) {
11501
- if (ReservedData_default.isReservedDataError(e) || e instanceof TypeError && e.message.startsWith("Cannot add property") && e.message.endsWith("not extensible")) {
11502
- throw new EleventyBaseError_default(
11503
- `You attempted to set one of Eleventy\u2019s reserved data property names${e.reservedNames ? `: ${e.reservedNames.join(", ")}` : ""}. You can opt-out of this behavior with \`eleventyConfig.setFreezeReservedData(false)\` or rename/remove the property in your data cascade that conflicts with Eleventy\u2019s reserved property names (e.g. \`eleventy\`, \`pkg\`, and others). Learn more: https://v3.11ty.dev/docs/data-eleventy-supplied/`,
11504
- e
11505
- );
11758
+ if (!ReservedData_default.isReservedDataError(e) && ReservedData_default.isFrozenError(e)) {
11759
+ throw ReservedData_default.getError({ cause: e });
11506
11760
  }
11507
11761
  throw e;
11508
11762
  }
@@ -11518,12 +11772,11 @@ var Template = class _Template extends TemplateContent_default {
11518
11772
  data.page = {};
11519
11773
  }
11520
11774
  data.page.inputPath = this.inputPath;
11775
+ data.page.inputPathDir = PathNormalizer.getDirectoryFromFilePath(this.inputPath);
11521
11776
  data.page.fileSlug = this.fileSlugStr;
11522
11777
  data.page.filePathStem = this.filePathStem;
11523
11778
  data.page.outputFileExtension = this.engine.defaultTemplateFileExtension;
11524
- data.page.templateSyntax = this.templateRender.getEnginesList(
11525
- data[this.config.keys.engineOverride]
11526
- );
11779
+ data.page.templateSyntax = this.getEngineNames(data[this.config.keys.engineOverride]);
11527
11780
  let newDate = await this.getMappedDate(data);
11528
11781
  if (newDate) {
11529
11782
  data.page.date = newDate;
@@ -11549,7 +11802,7 @@ var Template = class _Template extends TemplateContent_default {
11549
11802
  return this._cacheRenderedPromise;
11550
11803
  }
11551
11804
  setLinters(linters) {
11552
- if (!(0, import_eleventy_utils19.isPlainObject)(linters)) {
11805
+ if (!(0, import_eleventy_utils20.isPlainObject)(linters)) {
11553
11806
  throw new Error("Object expected in setLinters");
11554
11807
  }
11555
11808
  this.linters = [];
@@ -11578,7 +11831,7 @@ var Template = class _Template extends TemplateContent_default {
11578
11831
  }
11579
11832
  }
11580
11833
  setTransforms(transforms) {
11581
- if (!(0, import_eleventy_utils19.isPlainObject)(transforms)) {
11834
+ if (!(0, import_eleventy_utils20.isPlainObject)(transforms)) {
11582
11835
  throw new Error("Object expected in setTransforms");
11583
11836
  }
11584
11837
  this.transforms = transforms;
@@ -11592,7 +11845,7 @@ var Template = class _Template extends TemplateContent_default {
11592
11845
  if (typeof entry === "string") {
11593
11846
  return this.renderComputedData(entry, data);
11594
11847
  }
11595
- if ((0, import_eleventy_utils19.isPlainObject)(entry)) {
11848
+ if ((0, import_eleventy_utils20.isPlainObject)(entry)) {
11596
11849
  for (let key in entry) {
11597
11850
  entry[key] = await this.#renderComputedUnit(entry[key], data);
11598
11851
  }
@@ -11617,7 +11870,7 @@ var Template = class _Template extends TemplateContent_default {
11617
11870
  this.getParseForSymbolsFunction(obj),
11618
11871
  this
11619
11872
  );
11620
- } else if ((0, import_eleventy_utils19.isPlainObject)(obj)) {
11873
+ } else if ((0, import_eleventy_utils20.isPlainObject)(obj)) {
11621
11874
  for (let key in obj) {
11622
11875
  let keys = [];
11623
11876
  if (parentKey) {
@@ -11631,7 +11884,7 @@ var Template = class _Template extends TemplateContent_default {
11631
11884
  }
11632
11885
  }
11633
11886
  async addComputedData(data) {
11634
- if ((0, import_eleventy_utils19.isPlainObject)(data?.[this.config.keys.computed])) {
11887
+ if ((0, import_eleventy_utils20.isPlainObject)(data?.[this.config.keys.computed])) {
11635
11888
  this.computedData = new ComputedData_default(this.config);
11636
11889
  this.computedData.addTemplateString(
11637
11890
  "page.url",
@@ -11654,7 +11907,7 @@ var Template = class _Template extends TemplateContent_default {
11654
11907
  this
11655
11908
  );
11656
11909
  if (this.config.freezeReservedData) {
11657
- ReservedData_default.check(data[this.config.keys.computed]);
11910
+ ReservedData_default.checkSubset(data[this.config.keys.computed]);
11658
11911
  }
11659
11912
  this._addComputedEntry(this.computedData, data[this.config.keys.computed]);
11660
11913
  debug13("First round of computed data for %o", this.inputPath);
@@ -11668,9 +11921,10 @@ var Template = class _Template extends TemplateContent_default {
11668
11921
  if (data.page.url && data.page.outputPath) {
11669
11922
  return;
11670
11923
  }
11671
- let { href, path: path11 } = await this.getOutputLocations(data);
11924
+ let { href, path: path9, dir } = await this.getOutputLocations(data);
11672
11925
  data.page.url = href;
11673
- data.page.outputPath = path11;
11926
+ data.page.outputPath = path9;
11927
+ data.page.dir = dir;
11674
11928
  }
11675
11929
  }
11676
11930
  // Computed data consuming collections!
@@ -11727,69 +11981,19 @@ var Template = class _Template extends TemplateContent_default {
11727
11981
  }
11728
11982
  });
11729
11983
  }
11730
- static async runPreprocessors(inputPath, content, data, preprocessors) {
11731
- let skippedVia = false;
11732
- for (let [name, preprocessor] of Object.entries(preprocessors)) {
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
- }
11984
+ async runPreprocessors(data) {
11985
+ if (!this.#preprocessorCache) {
11986
+ this.#preprocessorCache = this.templatePreprocessor.runAll(this, data);
11774
11987
  }
11775
- return {
11776
- skippedVia,
11777
- content
11778
- };
11988
+ return this.#preprocessorCache;
11779
11989
  }
11780
11990
  async getTemplates(data) {
11781
- let content = await this.getPreRender();
11782
- let { skippedVia, content: rawInput } = await _Template.runPreprocessors(
11783
- this.inputPath,
11784
- content,
11785
- data,
11786
- this.config.preprocessors
11787
- );
11788
- if (skippedVia) {
11991
+ let { skippedVia: skippedViaPreprocessorName, content: rawInput } = await this.runPreprocessors(data);
11992
+ if (skippedViaPreprocessorName) {
11789
11993
  debug13(
11790
11994
  "Skipping %o, the %o preprocessor returned an explicit `false`",
11791
11995
  this.inputPath,
11792
- skippedVia
11996
+ skippedViaPreprocessorName
11793
11997
  );
11794
11998
  return [];
11795
11999
  }
@@ -12027,9 +12231,13 @@ var Template = class _Template extends TemplateContent_default {
12027
12231
  }
12028
12232
  if (!this.isVirtualTemplate()) {
12029
12233
  if (dateValue.toLowerCase() === "git last modified") {
12030
- let d = await DateGitLastUpdated_default(this.inputPath);
12031
- if (d) {
12032
- return d;
12234
+ let timestamp = await getUpdatedTimestamp(this.inputPath);
12235
+ if (timestamp) {
12236
+ debug13(
12237
+ `getMappedDate: found git last modified timestamp for ${this.inputPath}: %o`,
12238
+ timestamp
12239
+ );
12240
+ return new Date(timestamp);
12033
12241
  }
12034
12242
  return /* @__PURE__ */ new Date();
12035
12243
  }
@@ -12037,9 +12245,13 @@ var Template = class _Template extends TemplateContent_default {
12037
12245
  return this._getDateInstance("ctimeMs");
12038
12246
  }
12039
12247
  if (dateValue.toLowerCase() === "git created") {
12040
- let d = await DateGitFirstAdded_default(this.inputPath);
12041
- if (d) {
12042
- return d;
12248
+ let timestamp = await getCreatedTimestamp(this.inputPath);
12249
+ if (timestamp) {
12250
+ debug13(
12251
+ `getMappedDate: found git created timestamp for ${this.inputPath}: %o`,
12252
+ timestamp
12253
+ );
12254
+ return new Date(timestamp);
12043
12255
  }
12044
12256
  return /* @__PURE__ */ new Date();
12045
12257
  }
@@ -12085,7 +12297,7 @@ var import_eleventy_utils23 = __toESM(require_eleventy_utils(), 1);
12085
12297
  init_debug();
12086
12298
 
12087
12299
  // ../../src/TemplateCollection.js
12088
- var import_eleventy_utils20 = __toESM(require_eleventy_utils(), 1);
12300
+ var import_eleventy_utils21 = __toESM(require_eleventy_utils(), 1);
12089
12301
 
12090
12302
  // ../../src/Util/Objects/Sortable.js
12091
12303
  var Sortable = class _Sortable {
@@ -12232,7 +12444,7 @@ var TemplateCollection = class extends Sortable_default {
12232
12444
  if (typeof globs === "string") {
12233
12445
  globs = [globs];
12234
12446
  }
12235
- globs = globs.map((glob) => import_eleventy_utils20.TemplatePath.addLeadingDotSlash(glob));
12447
+ globs = globs.map((glob) => import_eleventy_utils21.TemplatePath.addLeadingDotSlash(glob));
12236
12448
  return globs;
12237
12449
  }
12238
12450
  getFilteredByGlob(globs) {
@@ -12277,9 +12489,6 @@ var UsingCircularTemplateContentReferenceError = class extends EleventyBaseError
12277
12489
  };
12278
12490
  var UsingCircularTemplateContentReferenceError_default = UsingCircularTemplateContentReferenceError;
12279
12491
 
12280
- // ../../src/TemplateMap.js
12281
- init_EleventyBaseError();
12282
-
12283
12492
  // ../../src/Errors/DuplicatePermalinkOutputError.js
12284
12493
  init_EleventyBaseError();
12285
12494
  var DuplicatePermalinkOutputError = class extends EleventyBaseError_default {
@@ -12301,71 +12510,6 @@ var JavaScriptDependencies = class {
12301
12510
  };
12302
12511
  var JavaScriptDependencies_core_default = JavaScriptDependencies;
12303
12512
 
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
12513
  // ../../src/Util/TemplateDepGraph.js
12370
12514
  var import_dependency_graph2 = __toESM(require_dep_graph(), 1);
12371
12515
  init_debug();
@@ -12828,10 +12972,6 @@ var GlobalDependencyMap_default = GlobalDependencyMap;
12828
12972
 
12829
12973
  // ../../src/TemplateMap.js
12830
12974
  var debug16 = debug_default("Eleventy:TemplateMap");
12831
- var EleventyMapPagesError = class extends EleventyBaseError_default {
12832
- };
12833
- var EleventyDataSchemaError = class extends EleventyBaseError_default {
12834
- };
12835
12975
  var EXTENSIONLESS_URL_ALLOWLIST = [
12836
12976
  "/_redirects",
12837
12977
  // Netlify specific
@@ -12852,6 +12992,7 @@ var TemplateMap = class {
12852
12992
  }
12853
12993
  this.eleventyConfig = eleventyConfig;
12854
12994
  this.map = [];
12995
+ this.inputPathMap = /* @__PURE__ */ new Map();
12855
12996
  this.collectionsData = null;
12856
12997
  this.cached = false;
12857
12998
  this.verboseOutput = true;
@@ -12878,13 +13019,22 @@ var TemplateMap = class {
12878
13019
  }
12879
13020
  let data = await template.getData();
12880
13021
  let entries = await template.getTemplateMapEntries(data);
13022
+ let { skippedVia } = await template.runPreprocessors(data);
13023
+ if (skippedVia) {
13024
+ return;
13025
+ }
12881
13026
  for (let map of entries) {
12882
13027
  this.map.push(map);
13028
+ this._addToInputPathMap(map);
12883
13029
  }
12884
13030
  }
12885
13031
  getMap() {
12886
13032
  return this.map;
12887
13033
  }
13034
+ _addToInputPathMap(mapEntry) {
13035
+ let absoluteInputPath = import_eleventy_utils23.TemplatePath.absolutePath(mapEntry.inputPath);
13036
+ this.inputPathMap.set(absoluteInputPath, mapEntry);
13037
+ }
12888
13038
  getTagTarget(str) {
12889
13039
  if (str === "collections") {
12890
13040
  return SPECIAL_COLLECTION_NAMES.keys;
@@ -12960,10 +13110,7 @@ var TemplateMap = class {
12960
13110
  try {
12961
13111
  map._pages = await map.template.getTemplates(map.data);
12962
13112
  } catch (e) {
12963
- throw new EleventyMapPagesError(
12964
- "Error generating template page(s) for " + map.inputPath + ".",
12965
- e
12966
- );
13113
+ throw new Error("Error generating template page(s) for " + map.inputPath + ".", { cause: e });
12967
13114
  }
12968
13115
  if (map._pages.length === 0) {
12969
13116
  } else {
@@ -13060,14 +13207,9 @@ var TemplateMap = class {
13060
13207
  hasMapEntryForInputPath(inputPath) {
13061
13208
  return Boolean(this.getMapEntryForInputPath(inputPath));
13062
13209
  }
13063
- // TODO(slightlyoff): hot inner loop?
13064
13210
  getMapEntryForInputPath(inputPath) {
13065
13211
  let absoluteInputPath = import_eleventy_utils23.TemplatePath.absolutePath(inputPath);
13066
- return this.map.find((entry) => {
13067
- if (entry.inputPath === inputPath || entry.inputPath === absoluteInputPath) {
13068
- return entry;
13069
- }
13070
- });
13212
+ return this.inputPathMap.get(absoluteInputPath);
13071
13213
  }
13072
13214
  #removeTagsFromTemplateOrder(maps) {
13073
13215
  return maps.filter((dep) => !GlobalDependencyMap_default.isCollection(dep));
@@ -13082,9 +13224,9 @@ var TemplateMap = class {
13082
13224
  try {
13083
13225
  await pageEntry.data[this.config.keys.dataSchema](pageEntry.data);
13084
13226
  } catch (e) {
13085
- throw new EleventyDataSchemaError(
13227
+ throw new Error(
13086
13228
  `Error in the data schema for: ${map.inputPath} (via \`eleventyDataSchema\`)`,
13087
- e
13229
+ { cause: e }
13088
13230
  );
13089
13231
  }
13090
13232
  }
@@ -13538,10 +13680,10 @@ var TemplateWriter = class {
13538
13680
  }
13539
13681
  getPathsWithVirtualTemplates(paths) {
13540
13682
  if (this.config.virtualTemplates && (0, import_eleventy_utils24.isPlainObject)(this.config.virtualTemplates)) {
13541
- let virtualTemplates = Object.keys(this.config.virtualTemplates).filter((path11) => {
13542
- return this.dirs.isTemplateFile(path11);
13543
- }).map((path11) => {
13544
- let fullVirtualPath = this.dirs.getInputPath(path11);
13683
+ let virtualTemplates = Object.keys(this.config.virtualTemplates).filter((path9) => {
13684
+ return this.dirs.isTemplateFile(path9);
13685
+ }).map((path9) => {
13686
+ let fullVirtualPath = this.dirs.getInputPath(path9);
13545
13687
  if (!this.extensionMap.getKey(fullVirtualPath)) {
13546
13688
  throw new Error(
13547
13689
  `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 +13694,13 @@ var TemplateWriter = class {
13552
13694
  paths = paths.concat(virtualTemplates);
13553
13695
  if (paths.length !== new Set(paths).size) {
13554
13696
  let conflicts = {};
13555
- for (let path11 of paths) {
13556
- if (conflicts[path11]) {
13697
+ for (let path9 of paths) {
13698
+ if (conflicts[path9]) {
13557
13699
  throw new Error(
13558
- `A virtual template had the same path as a file on the file system: "${path11}"`
13700
+ `A virtual template had the same path as a file on the file system: "${path9}"`
13559
13701
  );
13560
13702
  }
13561
- conflicts[path11] = true;
13703
+ conflicts[path9] = true;
13562
13704
  }
13563
13705
  }
13564
13706
  }
@@ -13572,8 +13714,8 @@ var TemplateWriter = class {
13572
13714
  paths = this.getPathsWithVirtualTemplates(paths);
13573
13715
  return paths;
13574
13716
  }
13575
- _createTemplate(path11, to = "fs") {
13576
- let tmpl = this._templatePathCache.get(path11);
13717
+ _createTemplate(path9, to = "fs") {
13718
+ let tmpl = this._templatePathCache.get(path9);
13577
13719
  let wasCached = false;
13578
13720
  if (tmpl) {
13579
13721
  wasCached = true;
@@ -13583,10 +13725,10 @@ var TemplateWriter = class {
13583
13725
  eleventyConfig: this.templateConfig
13584
13726
  });
13585
13727
  } else {
13586
- tmpl = new Template_default(path11, this.templateData, this.extensionMap, this.templateConfig);
13728
+ tmpl = new Template_default(path9, this.templateData, this.extensionMap, this.templateConfig);
13587
13729
  tmpl.setOutputFormat(to);
13588
13730
  tmpl.logger = this.logger;
13589
- this._templatePathCache.set(path11, tmpl);
13731
+ this._templatePathCache.set(path9, tmpl);
13590
13732
  }
13591
13733
  tmpl.setTransforms(this.config.transforms);
13592
13734
  tmpl.setLinters(this.config.linters);
@@ -13604,8 +13746,8 @@ var TemplateWriter = class {
13604
13746
  let secondOrderRelevantLookup = {};
13605
13747
  let templates = [];
13606
13748
  let promises2 = [];
13607
- for (let path11 of paths) {
13608
- let { template: tmpl } = this._createTemplate(path11, to);
13749
+ for (let path9 of paths) {
13750
+ let { template: tmpl } = this._createTemplate(path9, to);
13609
13751
  templates.push(tmpl);
13610
13752
  await tmpl.asyncTemplateInitialization();
13611
13753
  if (incrementalFileShape === "template" && tmpl.inputPath === this.incrementalFile) {
@@ -13678,8 +13820,8 @@ var TemplateWriter = class {
13678
13820
  }
13679
13821
  let ignoreInitialBuild = !this.isRunInitialBuild;
13680
13822
  let promises2 = [];
13681
- for (let path11 of paths) {
13682
- let { template: tmpl, wasCached } = this._createTemplate(path11, to);
13823
+ for (let path9 of paths) {
13824
+ let { template: tmpl, wasCached } = this._createTemplate(path9, to);
13683
13825
  if (ignoreInitialBuild) {
13684
13826
  tmpl.setRenderableOverride(false);
13685
13827
  } else {
@@ -13700,8 +13842,8 @@ var TemplateWriter = class {
13700
13842
  }
13701
13843
  async _addToTemplateMap(paths, to = "fs") {
13702
13844
  let incrementalFileShape = this.getFileShape(paths, this.incrementalFile);
13703
- paths = paths.filter((path11) => {
13704
- if (!this.extensionMap.hasEngine(path11)) {
13845
+ paths = paths.filter((path9) => {
13846
+ if (!this.extensionMap.hasEngine(path9)) {
13705
13847
  return false;
13706
13848
  }
13707
13849
  if (incrementalFileShape === "copy") {
@@ -13906,14 +14048,14 @@ var EleventyExtensionMap = class {
13906
14048
  this.#engineManager.reset();
13907
14049
  }
13908
14050
  /* Used for layout path resolution */
13909
- getFileList(path11, dir) {
13910
- if (!path11) {
14051
+ getFileList(path9, dir) {
14052
+ if (!path9) {
13911
14053
  return [];
13912
14054
  }
13913
14055
  let files = [];
13914
14056
  this.validTemplateLanguageKeys.forEach((key) => {
13915
14057
  this.getExtensionsFromKey(key).forEach(function(extension) {
13916
- files.push((dir ? dir + "/" : "") + path11 + "." + extension);
14058
+ files.push((dir ? dir + "/" : "") + path9 + "." + extension);
13917
14059
  });
13918
14060
  });
13919
14061
  return files;
@@ -13921,9 +14063,9 @@ var EleventyExtensionMap = class {
13921
14063
  // Warning: this would false positive on an include, but is only used
13922
14064
  // on paths found from the file system glob search.
13923
14065
  // TODO: Method name might just need to be renamed to something more accurate.
13924
- isFullTemplateFilePath(path11) {
14066
+ isFullTemplateFilePath(path9) {
13925
14067
  for (let extension of this.validTemplateLanguageKeys) {
13926
- if (path11.endsWith(`.${extension}`)) {
14068
+ if (path9.endsWith(`.${extension}`)) {
13927
14069
  return true;
13928
14070
  }
13929
14071
  }
@@ -13939,18 +14081,18 @@ var EleventyExtensionMap = class {
13939
14081
  }
13940
14082
  }
13941
14083
  }
13942
- getValidExtensionsForPath(path11) {
14084
+ getValidExtensionsForPath(path9) {
13943
14085
  let extensions = /* @__PURE__ */ new Set();
13944
14086
  for (let extension in this.extensionToKeyMap) {
13945
- if (path11.endsWith(`.${extension}`)) {
14087
+ if (path9.endsWith(`.${extension}`)) {
13946
14088
  extensions.add(extension);
13947
14089
  }
13948
14090
  }
13949
14091
  let sorted = Array.from(extensions).filter((extension) => this.validTemplateLanguageKeys.includes(extension)).sort((a, b) => b.length - a.length);
13950
14092
  return sorted;
13951
14093
  }
13952
- async shouldSpiderJavaScriptDependencies(path11) {
13953
- let extensions = this.getValidExtensionsForPath(path11);
14094
+ async shouldSpiderJavaScriptDependencies(path9) {
14095
+ let extensions = this.getValidExtensionsForPath(path9);
13954
14096
  for (let extension of extensions) {
13955
14097
  if (extension in this._spiderJsDepsCache) {
13956
14098
  return this._spiderJsDepsCache[extension];
@@ -14052,16 +14194,16 @@ var EleventyExtensionMap = class {
14052
14194
  }
14053
14195
  }
14054
14196
  }
14055
- removeTemplateExtension(path11) {
14197
+ removeTemplateExtension(path9) {
14056
14198
  for (let extension in this.extensionToKeyMap) {
14057
- if (path11 === extension || path11.endsWith("." + extension)) {
14058
- return path11.slice(
14199
+ if (path9 === extension || path9.endsWith("." + extension)) {
14200
+ return path9.slice(
14059
14201
  0,
14060
- path11.length - 1 - extension.length < 0 ? 0 : path11.length - 1 - extension.length
14202
+ path9.length - 1 - extension.length < 0 ? 0 : path9.length - 1 - extension.length
14061
14203
  );
14062
14204
  }
14063
14205
  }
14064
- return path11;
14206
+ return path9;
14065
14207
  }
14066
14208
  // keys are file extensions
14067
14209
  // values are template language keys
@@ -14306,7 +14448,6 @@ var Benchmark = class {
14306
14448
  return this.timeSpent;
14307
14449
  }
14308
14450
  };
14309
- var Benchmark_default = Benchmark;
14310
14451
 
14311
14452
  // ../../src/Benchmark/BenchmarkGroup.js
14312
14453
  var debugBenchmark = debug_default("Eleventy:Benchmark");
@@ -14329,7 +14470,7 @@ var BenchmarkGroup = class {
14329
14470
  }
14330
14471
  // TODO use addAsync everywhere instead
14331
14472
  add(type, callback) {
14332
- let benchmark = this.benchmarks[type] = new Benchmark_default();
14473
+ let benchmark = this.benchmarks[type] = new Benchmark();
14333
14474
  let fn = function(...args) {
14334
14475
  benchmark.before();
14335
14476
  let ret = callback.call(this, ...args);
@@ -14374,7 +14515,7 @@ var BenchmarkGroup = class {
14374
14515
  }
14375
14516
  get(type) {
14376
14517
  if (!this.benchmarks[type]) {
14377
- this.benchmarks[type] = new Benchmark_default();
14518
+ this.benchmarks[type] = new Benchmark();
14378
14519
  }
14379
14520
  return this.benchmarks[type];
14380
14521
  }
@@ -14474,8 +14615,6 @@ var UserConfig = class {
14474
14615
  #pluginExecution = false;
14475
14616
  /** @type {boolean} */
14476
14617
  #quietModeLocked = false;
14477
- /** @type {boolean} */
14478
- #dataDeepMergeModified = false;
14479
14618
  /** @type {number|undefined} */
14480
14619
  #uniqueId;
14481
14620
  /** @type {number} */
@@ -14501,12 +14640,6 @@ var UserConfig = class {
14501
14640
  this.reset();
14502
14641
  this.#uniqueId = Math.random();
14503
14642
  }
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
14643
  // Internally used in TemplateContent for cache keys
14511
14644
  _getUniqueId() {
14512
14645
  return this.#uniqueId;
@@ -14538,8 +14671,8 @@ var UserConfig = class {
14538
14671
  filters: {},
14539
14672
  shortcodes: {},
14540
14673
  pairedShortcodes: {},
14541
- parameterParsing: "legacy"
14542
- // or builtin
14674
+ parameterParsing: "builtin"
14675
+ // or legacy (Breaking: default swapped in v4.0.0)
14543
14676
  };
14544
14677
  this.nunjucks = {
14545
14678
  // `dev: true` gives us better error messaging
@@ -14578,7 +14711,6 @@ var UserConfig = class {
14578
14711
  defaultIgnores.add(".git/**");
14579
14712
  this.ignores = new Set(defaultIgnores);
14580
14713
  this.watchIgnores = new Set(defaultIgnores);
14581
- this.dataDeepMerge = true;
14582
14714
  this.extensionMap = /* @__PURE__ */ new Set();
14583
14715
  this.extensionMapClasses = {};
14584
14716
  this.extensionConflictMap = {};
@@ -14696,9 +14828,9 @@ var UserConfig = class {
14696
14828
  /*
14697
14829
  * Markdown
14698
14830
  */
14699
- // This is a method for plugins, probably shouldn’t use this in projects.
14700
- // Projects should use `setLibrary` as documented here:
14701
- // https://github.com/11ty/eleventy/blob/master/docs/engines/markdown.md#use-your-own-options
14831
+ // Don’t use this, projects should use `amendLibrary` as documented here:
14832
+ // https://www.11ty.dev/docs/languages/markdown/#optional-amend-the-library-instance
14833
+ // Warning: this is in use by the Syntax Highlighting plugin (as of v5.0.2)
14702
14834
  addMarkdownHighlighter(highlightFn) {
14703
14835
  this.markdownHighlighter = highlightFn;
14704
14836
  }
@@ -15077,9 +15209,6 @@ var UserConfig = class {
15077
15209
  /*
15078
15210
  * Template Formats
15079
15211
  */
15080
- _normalizeTemplateFormats() {
15081
- throw new Error("The internal _normalizeTemplateFormats() method was removed in Eleventy 3.0");
15082
- }
15083
15212
  setTemplateFormats(templateFormats) {
15084
15213
  this.templateFormats = templateFormats;
15085
15214
  }
@@ -15133,14 +15262,6 @@ var UserConfig = class {
15133
15262
  setUseGitIgnore(enabled) {
15134
15263
  this.useGitIgnore = !!enabled;
15135
15264
  }
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
15265
  addWatchTarget(additionalWatchTargets, options = {}) {
15145
15266
  if (options.resetConfig) {
15146
15267
  this.watchTargetsConfigReset.add(additionalWatchTargets);
@@ -15157,12 +15278,6 @@ var UserConfig = class {
15157
15278
  this.serverOptions = (0, import_eleventy_utils26.DeepCopy)(this.serverOptions, options);
15158
15279
  }
15159
15280
  }
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
15281
  setChokidarConfig(options = {}) {
15167
15282
  this.chokidarConfig = options;
15168
15283
  }
@@ -15374,9 +15489,6 @@ var UserConfig = class {
15374
15489
  configureErrorReporting(options = {}) {
15375
15490
  Object.assign(this.errorReporting, options);
15376
15491
  }
15377
- configureTemplateHandling(options = {}) {
15378
- throw new Error("Internal configuration API method `configureTemplateHandling` was removed.");
15379
- }
15380
15492
  /*
15381
15493
  * Collections
15382
15494
  */
@@ -15454,7 +15566,6 @@ var UserConfig = class {
15454
15566
  useGitIgnore: this.useGitIgnore,
15455
15567
  ignores: this.ignores,
15456
15568
  watchIgnores: this.watchIgnores,
15457
- dataDeepMerge: this.dataDeepMerge,
15458
15569
  watchJavaScriptDependencies: this.watchJavaScriptDependencies,
15459
15570
  additionalWatchTargets: this.additionalWatchTargets,
15460
15571
  watchTargetsConfigReset: this.watchTargetsConfigReset,
@@ -15489,6 +15600,31 @@ var UserConfig = class {
15489
15600
  }
15490
15601
  return obj;
15491
15602
  }
15603
+ // Removed features
15604
+ get DateTime() {
15605
+ throw new Error(
15606
+ 'Luxon\u2019s DateTime property in configuration was removed in Eleventy v4. Please `import { DateTime } from "luxon"` directly.'
15607
+ );
15608
+ }
15609
+ _normalizeTemplateFormats() {
15610
+ throw new Error("The internal _normalizeTemplateFormats() method was removed in Eleventy v3");
15611
+ }
15612
+ setBrowserSyncConfig() {
15613
+ this._attemptedBrowserSyncUse = true;
15614
+ debug19(
15615
+ "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."
15616
+ );
15617
+ }
15618
+ configureTemplateHandling(options = {}) {
15619
+ throw new Error("Internal configuration API method `configureTemplateHandling` was removed.");
15620
+ }
15621
+ setDataDeepMerge(deepMerge) {
15622
+ if (Boolean(deepMerge) === false) {
15623
+ throw new Error(
15624
+ "The `setDataDeepMerge(false)` Configuration API feature was removed in Eleventy v4. Read more at https://github.com/11ty/eleventy/issues/3937"
15625
+ );
15626
+ }
15627
+ }
15492
15628
  // No-op functions for backwards compat
15493
15629
  addHandlebarsHelper() {
15494
15630
  }
@@ -15500,6 +15636,10 @@ var UserConfig = class {
15500
15636
  }
15501
15637
  addPairedHandlebarsShortcode() {
15502
15638
  }
15639
+ // Used by the Upgrade Helper Plugin v1 (no longer relevant)
15640
+ // https://github.com/11ty/eleventy-upgrade-help/blob/v1.x/src/data-deep-merge.js#L5-L9
15641
+ isDataDeepMergeModified() {
15642
+ }
15503
15643
  };
15504
15644
  var UserConfig_default = UserConfig;
15505
15645
 
@@ -15512,38 +15652,42 @@ var ExistsCache = class {
15512
15652
  constructor() {
15513
15653
  this.lookupCount = 0;
15514
15654
  }
15655
+ reset() {
15656
+ this.#exists = /* @__PURE__ */ new Map();
15657
+ this.#dirs = /* @__PURE__ */ new Map();
15658
+ }
15515
15659
  get size() {
15516
15660
  return this.#exists.size;
15517
15661
  }
15518
- has(path11) {
15519
- return this.#exists.has(path11);
15662
+ has(path9) {
15663
+ return this.#exists.has(path9);
15520
15664
  }
15521
- set(path11, isExist) {
15522
- this.#exists.set(import_eleventy_utils27.TemplatePath.addLeadingDotSlash(path11), Boolean(isExist));
15665
+ set(path9, isExist) {
15666
+ this.#exists.set(import_eleventy_utils27.TemplatePath.addLeadingDotSlash(path9), Boolean(isExist));
15523
15667
  }
15524
15668
  // Not yet needed
15525
15669
  // setDirectory(path, isExist) {}
15526
15670
  // Relative paths (to root directory) expected (but not enforced due to perf costs)
15527
- exists(path11) {
15528
- if (!this.#exists.has(path11)) {
15529
- let exists = existsSync(path11);
15671
+ exists(path9) {
15672
+ if (!this.#exists.has(path9)) {
15673
+ let exists = existsSync(path9);
15530
15674
  this.lookupCount++;
15531
- this.#exists.set(path11, Boolean(exists));
15675
+ this.#exists.set(path9, Boolean(exists));
15532
15676
  return exists;
15533
15677
  }
15534
- return this.#exists.get(path11);
15678
+ return this.#exists.get(path9);
15535
15679
  }
15536
- isDirectory(path11) {
15537
- if (!this.exists(path11)) {
15680
+ isDirectory(path9) {
15681
+ if (!this.exists(path9)) {
15538
15682
  return false;
15539
15683
  }
15540
- if (!this.#dirs.has(path11)) {
15541
- let isDir = statSync(path11).isDirectory();
15684
+ if (!this.#dirs.has(path9)) {
15685
+ let isDir = statSync(path9).isDirectory();
15542
15686
  this.lookupCount++;
15543
- this.#dirs.set(path11, isDir);
15687
+ this.#dirs.set(path9, isDir);
15544
15688
  return isDir;
15545
15689
  }
15546
- return this.#dirs.get(path11);
15690
+ return this.#dirs.get(path9);
15547
15691
  }
15548
15692
  };
15549
15693
  var ExistsCache_default = ExistsCache;
@@ -15676,6 +15820,7 @@ var TemplateConfig = class {
15676
15820
  #existsCache = new ExistsCache_default();
15677
15821
  #usesGraph;
15678
15822
  #previousBuildModifiedFile;
15823
+ #activeConfigPath;
15679
15824
  constructor(customRootConfig, projectConfigPath) {
15680
15825
  this.overrides = {};
15681
15826
  if (projectConfigPath !== void 0) {
@@ -15759,7 +15904,7 @@ var TemplateConfig = class {
15759
15904
  */
15760
15905
  getLocalProjectConfigFile() {
15761
15906
  let configFiles = this.getLocalProjectConfigFiles();
15762
- let configFile = configFiles.find((path11) => path11 && existsSync(path11));
15907
+ let configFile = configFiles.find((path9) => path9 && this.existsCache.exists(path9));
15763
15908
  if (configFile) {
15764
15909
  return configFile;
15765
15910
  }
@@ -15767,10 +15912,16 @@ var TemplateConfig = class {
15767
15912
  getLocalProjectConfigFiles() {
15768
15913
  let paths = this.projectConfigPaths;
15769
15914
  if (paths?.length > 0) {
15770
- return import_eleventy_utils28.TemplatePath.addLeadingDotSlashArray(paths.filter((path11) => Boolean(path11)));
15915
+ return import_eleventy_utils28.TemplatePath.addLeadingDotSlashArray(paths.filter((path9) => Boolean(path9)));
15771
15916
  }
15772
15917
  return [];
15773
15918
  }
15919
+ getActiveConfigPath() {
15920
+ if (!this.#activeConfigPath) {
15921
+ this.#activeConfigPath = this.getLocalProjectConfigFile();
15922
+ }
15923
+ return this.#activeConfigPath;
15924
+ }
15774
15925
  setProjectUsingEsm(isEsmProject) {
15775
15926
  this.isEsm = !!isEsmProject;
15776
15927
  this.usesGraph.setIsEsm(isEsmProject);
@@ -15782,6 +15933,7 @@ var TemplateConfig = class {
15782
15933
  * Resets the configuration.
15783
15934
  */
15784
15935
  async reset() {
15936
+ this.#existsCache.reset();
15785
15937
  debugDev5("Resetting configuration: TemplateConfig and UserConfig.");
15786
15938
  this.userConfig.reset();
15787
15939
  this.usesGraph.reset();
@@ -15802,6 +15954,7 @@ var TemplateConfig = class {
15802
15954
  * Async-friendly init method
15803
15955
  */
15804
15956
  async init(overrides) {
15957
+ this.#activeConfigPath = void 0;
15805
15958
  await this.initializeRootConfig();
15806
15959
  if (overrides) {
15807
15960
  this.appendToRootConfig(overrides);
@@ -15832,10 +15985,10 @@ var TemplateConfig = class {
15832
15985
  *
15833
15986
  * @param {String} path - The new config path.
15834
15987
  */
15835
- async setProjectConfigPath(path11) {
15988
+ async setProjectConfigPath(path9) {
15836
15989
  this.#configManuallyDefined = true;
15837
- if (path11 !== void 0) {
15838
- this.projectConfigPaths = [path11];
15990
+ if (path9 !== void 0) {
15991
+ this.projectConfigPaths = [path9];
15839
15992
  } else {
15840
15993
  this.projectConfigPaths = [];
15841
15994
  }
@@ -15928,16 +16081,16 @@ var TemplateConfig = class {
15928
16081
  async requireLocalConfigFile() {
15929
16082
  let localConfig = {};
15930
16083
  let exportedConfig = {};
15931
- let path11 = this.projectConfigPaths.filter((path12) => path12).find((path12) => existsSync(path12));
15932
- if (this.projectConfigPaths.length > 0 && this.#configManuallyDefined && !path11) {
16084
+ let path9 = this.getActiveConfigPath();
16085
+ if (this.projectConfigPaths.length > 0 && this.#configManuallyDefined && !path9) {
15933
16086
  throw new EleventyConfigError(
15934
16087
  "A configuration file was specified but not found: " + this.projectConfigPaths.join(", ")
15935
16088
  );
15936
16089
  }
15937
- debug21(`Merging default config with ${path11}`);
15938
- if (path11) {
16090
+ debug21(`Merging default config with ${path9}`);
16091
+ if (path9) {
15939
16092
  try {
15940
- let { default: configDefaultReturn, config: exportedConfigObject } = await dynamicImportRaw(path11, this.isEsm ? "esm" : "cjs");
16093
+ let { default: configDefaultReturn, config: exportedConfigObject } = await dynamicImportRaw(path9, this.isEsm ? "esm" : "cjs");
15941
16094
  exportedConfig = exportedConfigObject || {};
15942
16095
  if (this.directories && Object.keys(exportedConfigObject?.dir || {}).length > 0) {
15943
16096
  debug21(
@@ -15955,7 +16108,7 @@ var TemplateConfig = class {
15955
16108
  let isModuleError = err instanceof Error && (err?.message || "").includes("Cannot find module");
15956
16109
  return Promise.reject(
15957
16110
  new EleventyConfigError(
15958
- `Error in your Eleventy config file '${path11}'.` + (isModuleError ? chalk_client_default.cyan(" You may need to run `npm install`.") : ""),
16111
+ `Error in your Eleventy config file '${path9}'.` + (isModuleError ? chalk_client_default.cyan(" You may need to run `npm install`.") : ""),
15959
16112
  err
15960
16113
  )
15961
16114
  );
@@ -16138,11 +16291,11 @@ var ProjectDirectories = class _ProjectDirectories {
16138
16291
  normalizeDirectoryPathRelativeToInputDirectory(filePath) {
16139
16292
  return _ProjectDirectories.normalizeDirectory(import_node_path10.default.join(this.input, filePath));
16140
16293
  }
16141
- static addTrailingSlash(path11) {
16142
- if (path11.slice(-1) === "/") {
16143
- return path11;
16294
+ static addTrailingSlash(path9) {
16295
+ if (path9.slice(-1) === "/") {
16296
+ return path9;
16144
16297
  }
16145
- return path11 + "/";
16298
+ return path9 + "/";
16146
16299
  }
16147
16300
  // If input/output are set via CLI, they take precedence over all other configuration values.
16148
16301
  freeze() {
@@ -16194,6 +16347,9 @@ var ProjectDirectories = class _ProjectDirectories {
16194
16347
  if (!dirOrFile) {
16195
16348
  return;
16196
16349
  }
16350
+ if (import_node_path10.default.isAbsolute(dirOrFile)) {
16351
+ dirOrFile = import_node_path10.default.relative(".", dirOrFile);
16352
+ }
16197
16353
  let inputExists = existsSync(dirOrFile);
16198
16354
  let inputExistsAndIsDirectory = inputExists && statSync(dirOrFile).isDirectory();
16199
16355
  if (inputExistsAndIsDirectory) {
@@ -16261,6 +16417,9 @@ var ProjectDirectories = class _ProjectDirectories {
16261
16417
  }
16262
16418
  if (dir !== void 0) {
16263
16419
  this.#raw.output = dir;
16420
+ if (import_node_path10.default.isAbsolute(dir)) {
16421
+ dir = import_node_path10.default.relative(".", dir);
16422
+ }
16264
16423
  this.#dirs.output = _ProjectDirectories.normalizeDirectory(dir || "");
16265
16424
  }
16266
16425
  }