@11ty/client 4.0.0-alpha.3 → 4.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eleventy.core.js +698 -591
- package/dist/eleventy.js +7885 -8011
- package/dist/formats/eleventy-liquid.js +81 -51
- package/dist/formats/eleventy-markdown.js +1 -1
- package/dist/formats/eleventy-nunjucks.js +94 -82
- package/dist/plugins/eleventy-plugin-i18n.js +2 -2
- package/package.json +6 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.5 (@11ty/client/liquid Engine Bundle) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1519,7 +1519,7 @@ var GLOBAL_FS_NAME, fs2, mkdir, existsSync2, mkdirSync, readFileSync2, statSync,
|
|
|
1519
1519
|
var init_shim_consume_fs = __esm({
|
|
1520
1520
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
1521
1521
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
1522
|
-
fs2 = window[GLOBAL_FS_NAME] || globalThis[GLOBAL_FS_NAME];
|
|
1522
|
+
fs2 = typeof window !== "undefined" && window[GLOBAL_FS_NAME] || typeof globalThis !== "undefined" && globalThis[GLOBAL_FS_NAME];
|
|
1523
1523
|
if (!fs2) {
|
|
1524
1524
|
let noopError = function() {
|
|
1525
1525
|
throw new Error("This function was not included in your Eleventy bundle. Make sure you load memfs.js before using the virtual file system.");
|
|
@@ -2278,7 +2278,7 @@ var Drop = class {
|
|
|
2278
2278
|
static {
|
|
2279
2279
|
__name(this, "Drop");
|
|
2280
2280
|
}
|
|
2281
|
-
liquidMethodMissing(key) {
|
|
2281
|
+
liquidMethodMissing(key, context) {
|
|
2282
2282
|
return void 0;
|
|
2283
2283
|
}
|
|
2284
2284
|
};
|
|
@@ -2343,8 +2343,7 @@ function toValue(value) {
|
|
|
2343
2343
|
}
|
|
2344
2344
|
__name(toValue, "toValue");
|
|
2345
2345
|
function toNumber(value) {
|
|
2346
|
-
|
|
2347
|
-
return isNaN(value) ? 0 : value;
|
|
2346
|
+
return +toValue(value) || 0;
|
|
2348
2347
|
}
|
|
2349
2348
|
__name(toNumber, "toNumber");
|
|
2350
2349
|
function isNumber(value) {
|
|
@@ -2456,6 +2455,12 @@ function argumentsToValue(fn) {
|
|
|
2456
2455
|
};
|
|
2457
2456
|
}
|
|
2458
2457
|
__name(argumentsToValue, "argumentsToValue");
|
|
2458
|
+
function argumentsToNumber(fn) {
|
|
2459
|
+
return function(...args) {
|
|
2460
|
+
return fn.call(this, ...args.map(toNumber));
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
__name(argumentsToNumber, "argumentsToNumber");
|
|
2459
2464
|
function escapeRegExp(text) {
|
|
2460
2465
|
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2461
2466
|
}
|
|
@@ -3223,12 +3228,12 @@ var Limiter = class {
|
|
|
3223
3228
|
this.limit = limit2;
|
|
3224
3229
|
}
|
|
3225
3230
|
use(count) {
|
|
3226
|
-
count =
|
|
3231
|
+
count = +count || 0;
|
|
3227
3232
|
assert(this.base + count <= this.limit, this.message);
|
|
3228
3233
|
this.base += count;
|
|
3229
3234
|
}
|
|
3230
3235
|
check(count) {
|
|
3231
|
-
count =
|
|
3236
|
+
count = +count || 0;
|
|
3232
3237
|
assert(count <= this.limit, this.message);
|
|
3233
3238
|
}
|
|
3234
3239
|
};
|
|
@@ -5339,7 +5344,7 @@ var Context = class _Context {
|
|
|
5339
5344
|
if (isString(paths))
|
|
5340
5345
|
paths = paths.split(".");
|
|
5341
5346
|
for (let i = 0; i < paths.length; i++) {
|
|
5342
|
-
scope = yield readProperty(scope, paths[i]
|
|
5347
|
+
scope = yield this.readProperty(scope, paths[i]);
|
|
5343
5348
|
if (strictVariables && isUndefined(scope)) {
|
|
5344
5349
|
throw new InternalUndefinedVariableError(paths.slice(0, i + 1).join("."));
|
|
5345
5350
|
}
|
|
@@ -5375,28 +5380,27 @@ var Context = class _Context {
|
|
|
5375
5380
|
return this.environments;
|
|
5376
5381
|
return this.globals;
|
|
5377
5382
|
}
|
|
5383
|
+
readProperty(obj, key) {
|
|
5384
|
+
obj = toLiquid(obj);
|
|
5385
|
+
key = toValue(key);
|
|
5386
|
+
if (isNil(obj))
|
|
5387
|
+
return obj;
|
|
5388
|
+
if (isArray(obj) && key < 0)
|
|
5389
|
+
return obj[obj.length + +key];
|
|
5390
|
+
const value = readJSProperty(obj, key, this.ownPropertyOnly);
|
|
5391
|
+
if (value === void 0 && obj instanceof Drop)
|
|
5392
|
+
return obj.liquidMethodMissing(key, this);
|
|
5393
|
+
if (isFunction(value))
|
|
5394
|
+
return value.call(obj);
|
|
5395
|
+
if (key === "size")
|
|
5396
|
+
return readSize(obj);
|
|
5397
|
+
else if (key === "first")
|
|
5398
|
+
return readFirst(obj);
|
|
5399
|
+
else if (key === "last")
|
|
5400
|
+
return readLast(obj);
|
|
5401
|
+
return value;
|
|
5402
|
+
}
|
|
5378
5403
|
};
|
|
5379
|
-
function readProperty(obj, key, ownPropertyOnly) {
|
|
5380
|
-
obj = toLiquid(obj);
|
|
5381
|
-
key = toValue(key);
|
|
5382
|
-
if (isNil(obj))
|
|
5383
|
-
return obj;
|
|
5384
|
-
if (isArray(obj) && key < 0)
|
|
5385
|
-
return obj[obj.length + +key];
|
|
5386
|
-
const value = readJSProperty(obj, key, ownPropertyOnly);
|
|
5387
|
-
if (value === void 0 && obj instanceof Drop)
|
|
5388
|
-
return obj.liquidMethodMissing(key);
|
|
5389
|
-
if (isFunction(value))
|
|
5390
|
-
return value.call(obj);
|
|
5391
|
-
if (key === "size")
|
|
5392
|
-
return readSize(obj);
|
|
5393
|
-
else if (key === "first")
|
|
5394
|
-
return readFirst(obj);
|
|
5395
|
-
else if (key === "last")
|
|
5396
|
-
return readLast(obj);
|
|
5397
|
-
return value;
|
|
5398
|
-
}
|
|
5399
|
-
__name(readProperty, "readProperty");
|
|
5400
5404
|
function readJSProperty(obj, key, ownPropertyOnly) {
|
|
5401
5405
|
if (ownPropertyOnly && !hasOwnProperty.call(obj, key) && !(obj instanceof Drop))
|
|
5402
5406
|
return void 0;
|
|
@@ -5429,28 +5433,23 @@ var BlockMode;
|
|
|
5429
5433
|
BlockMode2[BlockMode2["OUTPUT"] = 0] = "OUTPUT";
|
|
5430
5434
|
BlockMode2[BlockMode2["STORE"] = 1] = "STORE";
|
|
5431
5435
|
})(BlockMode || (BlockMode = {}));
|
|
5432
|
-
var abs =
|
|
5433
|
-
var at_least =
|
|
5434
|
-
var at_most =
|
|
5435
|
-
var ceil =
|
|
5436
|
-
var divided_by =
|
|
5437
|
-
var floor =
|
|
5438
|
-
var minus =
|
|
5439
|
-
var
|
|
5440
|
-
var
|
|
5436
|
+
var abs = argumentsToNumber(Math.abs);
|
|
5437
|
+
var at_least = argumentsToNumber(Math.max);
|
|
5438
|
+
var at_most = argumentsToNumber(Math.min);
|
|
5439
|
+
var ceil = argumentsToNumber(Math.ceil);
|
|
5440
|
+
var divided_by = argumentsToNumber((dividend, divisor, integerArithmetic = false) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor);
|
|
5441
|
+
var floor = argumentsToNumber(Math.floor);
|
|
5442
|
+
var minus = argumentsToNumber((v, arg) => v - arg);
|
|
5443
|
+
var plus = argumentsToNumber((lhs, rhs) => lhs + rhs);
|
|
5444
|
+
var modulo = argumentsToNumber((v, arg) => v % arg);
|
|
5445
|
+
var times = argumentsToNumber((v, arg) => v * arg);
|
|
5441
5446
|
function round(v, arg = 0) {
|
|
5442
|
-
v =
|
|
5443
|
-
arg =
|
|
5447
|
+
v = toNumber(v);
|
|
5448
|
+
arg = toNumber(arg);
|
|
5444
5449
|
const amp = Math.pow(10, arg);
|
|
5445
5450
|
return Math.round(v * amp) / amp;
|
|
5446
5451
|
}
|
|
5447
5452
|
__name(round, "round");
|
|
5448
|
-
function plus(v, arg) {
|
|
5449
|
-
v = toValue(v);
|
|
5450
|
-
arg = toValue(arg);
|
|
5451
|
-
return Number(v) + Number(arg);
|
|
5452
|
-
}
|
|
5453
|
-
__name(plus, "plus");
|
|
5454
5453
|
var mathFilters = /* @__PURE__ */ Object.freeze({
|
|
5455
5454
|
__proto__: null,
|
|
5456
5455
|
abs,
|
|
@@ -5460,10 +5459,10 @@ var mathFilters = /* @__PURE__ */ Object.freeze({
|
|
|
5460
5459
|
divided_by,
|
|
5461
5460
|
floor,
|
|
5462
5461
|
minus,
|
|
5462
|
+
plus,
|
|
5463
5463
|
modulo,
|
|
5464
5464
|
times,
|
|
5465
|
-
round
|
|
5466
|
-
plus
|
|
5465
|
+
round
|
|
5467
5466
|
});
|
|
5468
5467
|
var url_decode = /* @__PURE__ */ __name((x) => decodeURIComponent(stringify(x)).replace(/\+/g, " "), "url_decode");
|
|
5469
5468
|
var url_encode = /* @__PURE__ */ __name((x) => encodeURIComponent(stringify(x)).replace(/%20/g, "+"), "url_encode");
|
|
@@ -6075,7 +6074,32 @@ var stringFilters = /* @__PURE__ */ Object.freeze({
|
|
|
6075
6074
|
number_of_words,
|
|
6076
6075
|
array_to_sentence_string
|
|
6077
6076
|
});
|
|
6078
|
-
|
|
6077
|
+
function base64Encode(str) {
|
|
6078
|
+
return btoa(String.fromCharCode(...new TextEncoder().encode(str)));
|
|
6079
|
+
}
|
|
6080
|
+
__name(base64Encode, "base64Encode");
|
|
6081
|
+
function base64Decode(str) {
|
|
6082
|
+
return new TextDecoder().decode(Uint8Array.from(atob(str), (c) => c.charCodeAt(0)));
|
|
6083
|
+
}
|
|
6084
|
+
__name(base64Decode, "base64Decode");
|
|
6085
|
+
function base64_encode(value) {
|
|
6086
|
+
const str = stringify(value);
|
|
6087
|
+
this.context.memoryLimit.use(str.length);
|
|
6088
|
+
return base64Encode(str);
|
|
6089
|
+
}
|
|
6090
|
+
__name(base64_encode, "base64_encode");
|
|
6091
|
+
function base64_decode(value) {
|
|
6092
|
+
const str = stringify(value);
|
|
6093
|
+
this.context.memoryLimit.use(str.length);
|
|
6094
|
+
return base64Decode(str);
|
|
6095
|
+
}
|
|
6096
|
+
__name(base64_decode, "base64_decode");
|
|
6097
|
+
var base64Filters = /* @__PURE__ */ Object.freeze({
|
|
6098
|
+
__proto__: null,
|
|
6099
|
+
base64_encode,
|
|
6100
|
+
base64_decode
|
|
6101
|
+
});
|
|
6102
|
+
var filters = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, htmlFilters), mathFilters), urlFilters), arrayFilters), dateFilters), stringFilters), base64Filters), misc);
|
|
6079
6103
|
var AssignTag = class extends Tag {
|
|
6080
6104
|
static {
|
|
6081
6105
|
__name(this, "AssignTag");
|
|
@@ -7512,9 +7536,10 @@ var Liquid2 = class _Liquid extends TemplateEngine {
|
|
|
7512
7536
|
root: [this.dirs.includes, this.dirs.input],
|
|
7513
7537
|
// supplemented in compile with inputPath below
|
|
7514
7538
|
extname: ".liquid",
|
|
7515
|
-
strictFilters: true
|
|
7516
|
-
// TODO?
|
|
7539
|
+
strictFilters: true,
|
|
7517
7540
|
// cache: true,
|
|
7541
|
+
jsTruthy: true
|
|
7542
|
+
// Breaking in v4 #3507
|
|
7518
7543
|
};
|
|
7519
7544
|
let options = Object.assign(defaults, this.liquidOptions || {});
|
|
7520
7545
|
return options;
|
|
@@ -7712,6 +7737,11 @@ var Liquid2 = class _Liquid extends TemplateEngine {
|
|
|
7712
7737
|
}
|
|
7713
7738
|
return async function(data) {
|
|
7714
7739
|
let tmpl = await tmplReady;
|
|
7740
|
+
options.globals = {
|
|
7741
|
+
page: data?.page,
|
|
7742
|
+
eleventy: data?.eleventy,
|
|
7743
|
+
collections: data?.collections
|
|
7744
|
+
};
|
|
7715
7745
|
return engine.render(tmpl, data, options);
|
|
7716
7746
|
};
|
|
7717
7747
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.5 (@11ty/client/md Engine Bundle) */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
var __export = (target, all) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.5 (@11ty/client/njk Engine Bundle) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -966,7 +966,7 @@ var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, wr
|
|
|
966
966
|
var init_shim_consume_fs = __esm({
|
|
967
967
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
968
968
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
969
|
-
fs = window[GLOBAL_FS_NAME] || globalThis[GLOBAL_FS_NAME];
|
|
969
|
+
fs = typeof window !== "undefined" && window[GLOBAL_FS_NAME] || typeof globalThis !== "undefined" && globalThis[GLOBAL_FS_NAME];
|
|
970
970
|
if (!fs) {
|
|
971
971
|
let noopError = function() {
|
|
972
972
|
throw new Error("This function was not included in your Eleventy bundle. Make sure you load memfs.js before using the virtual file system.");
|
|
@@ -2277,7 +2277,7 @@ var require_lexer = __commonJS({
|
|
|
2277
2277
|
};
|
|
2278
2278
|
}
|
|
2279
2279
|
__name(token, "token");
|
|
2280
|
-
var Tokenizer = /* @__PURE__ */ function() {
|
|
2280
|
+
var Tokenizer = /* @__PURE__ */ (function() {
|
|
2281
2281
|
function Tokenizer2(str, opts) {
|
|
2282
2282
|
this.str = str;
|
|
2283
2283
|
this.index = 0;
|
|
@@ -2605,7 +2605,7 @@ var require_lexer = __commonJS({
|
|
|
2605
2605
|
return this.str.charAt(this.index - 1);
|
|
2606
2606
|
}, "previous");
|
|
2607
2607
|
return Tokenizer2;
|
|
2608
|
-
}();
|
|
2608
|
+
})();
|
|
2609
2609
|
module.exports = {
|
|
2610
2610
|
lex: /* @__PURE__ */ __name(function lex(src, opts) {
|
|
2611
2611
|
return new Tokenizer(src, opts);
|
|
@@ -3097,7 +3097,7 @@ var require_object = __commonJS({
|
|
|
3097
3097
|
lib.keys(props).forEach(function(k) {
|
|
3098
3098
|
props[k] = parentWrap(cls.prototype[k], props[k]);
|
|
3099
3099
|
});
|
|
3100
|
-
var subclass = /* @__PURE__ */ function(_cls) {
|
|
3100
|
+
var subclass = /* @__PURE__ */ (function(_cls) {
|
|
3101
3101
|
_inheritsLoose(subclass2, _cls);
|
|
3102
3102
|
function subclass2() {
|
|
3103
3103
|
return _cls.apply(this, arguments) || this;
|
|
@@ -3110,12 +3110,12 @@ var require_object = __commonJS({
|
|
|
3110
3110
|
}, "get")
|
|
3111
3111
|
}]);
|
|
3112
3112
|
return subclass2;
|
|
3113
|
-
}(cls);
|
|
3113
|
+
})(cls);
|
|
3114
3114
|
lib._assign(subclass.prototype, props);
|
|
3115
3115
|
return subclass;
|
|
3116
3116
|
}
|
|
3117
3117
|
__name(extendClass, "extendClass");
|
|
3118
|
-
var Obj = /* @__PURE__ */ function() {
|
|
3118
|
+
var Obj = /* @__PURE__ */ (function() {
|
|
3119
3119
|
function Obj2() {
|
|
3120
3120
|
this.init.apply(this, arguments);
|
|
3121
3121
|
}
|
|
@@ -3137,8 +3137,8 @@ var require_object = __commonJS({
|
|
|
3137
3137
|
}, "get")
|
|
3138
3138
|
}]);
|
|
3139
3139
|
return Obj2;
|
|
3140
|
-
}();
|
|
3141
|
-
var EmitterObj = /* @__PURE__ */ function(_EventEmitter) {
|
|
3140
|
+
})();
|
|
3141
|
+
var EmitterObj = /* @__PURE__ */ (function(_EventEmitter) {
|
|
3142
3142
|
_inheritsLoose(EmitterObj2, _EventEmitter);
|
|
3143
3143
|
function EmitterObj2() {
|
|
3144
3144
|
var _this2;
|
|
@@ -3165,7 +3165,7 @@ var require_object = __commonJS({
|
|
|
3165
3165
|
}, "get")
|
|
3166
3166
|
}]);
|
|
3167
3167
|
return EmitterObj2;
|
|
3168
|
-
}(EventEmitter);
|
|
3168
|
+
})(EventEmitter);
|
|
3169
3169
|
module.exports = {
|
|
3170
3170
|
Obj,
|
|
3171
3171
|
EmitterObj
|
|
@@ -3235,7 +3235,7 @@ var require_nodes = __commonJS({
|
|
|
3235
3235
|
}
|
|
3236
3236
|
}
|
|
3237
3237
|
__name(traverseAndCheck, "traverseAndCheck");
|
|
3238
|
-
var Node = /* @__PURE__ */ function(_Obj) {
|
|
3238
|
+
var Node = /* @__PURE__ */ (function(_Obj) {
|
|
3239
3239
|
_inheritsLoose(Node2, _Obj);
|
|
3240
3240
|
function Node2() {
|
|
3241
3241
|
return _Obj.apply(this, arguments) || this;
|
|
@@ -3278,8 +3278,8 @@ var require_nodes = __commonJS({
|
|
|
3278
3278
|
});
|
|
3279
3279
|
}, "iterFields");
|
|
3280
3280
|
return Node2;
|
|
3281
|
-
}(Obj);
|
|
3282
|
-
var Value = /* @__PURE__ */ function(_Node) {
|
|
3281
|
+
})(Obj);
|
|
3282
|
+
var Value = /* @__PURE__ */ (function(_Node) {
|
|
3283
3283
|
_inheritsLoose(Value2, _Node);
|
|
3284
3284
|
function Value2() {
|
|
3285
3285
|
return _Node.apply(this, arguments) || this;
|
|
@@ -3297,8 +3297,8 @@ var require_nodes = __commonJS({
|
|
|
3297
3297
|
}, "get")
|
|
3298
3298
|
}]);
|
|
3299
3299
|
return Value2;
|
|
3300
|
-
}(Node);
|
|
3301
|
-
var NodeList = /* @__PURE__ */ function(_Node2) {
|
|
3300
|
+
})(Node);
|
|
3301
|
+
var NodeList = /* @__PURE__ */ (function(_Node2) {
|
|
3302
3302
|
_inheritsLoose(NodeList2, _Node2);
|
|
3303
3303
|
function NodeList2() {
|
|
3304
3304
|
return _Node2.apply(this, arguments) || this;
|
|
@@ -3323,7 +3323,7 @@ var require_nodes = __commonJS({
|
|
|
3323
3323
|
}, "get")
|
|
3324
3324
|
}]);
|
|
3325
3325
|
return NodeList2;
|
|
3326
|
-
}(Node);
|
|
3326
|
+
})(Node);
|
|
3327
3327
|
var Root = NodeList.extend("Root");
|
|
3328
3328
|
var Literal = Value.extend("Literal");
|
|
3329
3329
|
var _Symbol = Value.extend("Symbol");
|
|
@@ -3355,7 +3355,7 @@ var require_nodes = __commonJS({
|
|
|
3355
3355
|
var Import = Node.extend("Import", {
|
|
3356
3356
|
fields: ["template", "target", "withContext"]
|
|
3357
3357
|
});
|
|
3358
|
-
var FromImport = /* @__PURE__ */ function(_Node3) {
|
|
3358
|
+
var FromImport = /* @__PURE__ */ (function(_Node3) {
|
|
3359
3359
|
_inheritsLoose(FromImport2, _Node3);
|
|
3360
3360
|
function FromImport2() {
|
|
3361
3361
|
return _Node3.apply(this, arguments) || this;
|
|
@@ -3377,7 +3377,7 @@ var require_nodes = __commonJS({
|
|
|
3377
3377
|
}, "get")
|
|
3378
3378
|
}]);
|
|
3379
3379
|
return FromImport2;
|
|
3380
|
-
}(Node);
|
|
3380
|
+
})(Node);
|
|
3381
3381
|
var FunCall = Node.extend("FunCall", {
|
|
3382
3382
|
fields: ["name", "args"]
|
|
3383
3383
|
});
|
|
@@ -3588,7 +3588,7 @@ var require_parser = __commonJS({
|
|
|
3588
3588
|
var nodes = require_nodes();
|
|
3589
3589
|
var Obj = require_object().Obj;
|
|
3590
3590
|
var lib = require_lib();
|
|
3591
|
-
var Parser = /* @__PURE__ */ function(_Obj) {
|
|
3591
|
+
var Parser = /* @__PURE__ */ (function(_Obj) {
|
|
3592
3592
|
_inheritsLoose(Parser2, _Obj);
|
|
3593
3593
|
function Parser2() {
|
|
3594
3594
|
return _Obj.apply(this, arguments) || this;
|
|
@@ -4493,7 +4493,7 @@ var require_parser = __commonJS({
|
|
|
4493
4493
|
return new nodes.Root(0, 0, this.parseNodes());
|
|
4494
4494
|
}, "parseAsRoot");
|
|
4495
4495
|
return Parser2;
|
|
4496
|
-
}(Obj);
|
|
4496
|
+
})(Obj);
|
|
4497
4497
|
module.exports = {
|
|
4498
4498
|
parse: /* @__PURE__ */ __name(function parse(src, extensions, opts) {
|
|
4499
4499
|
var p = new Parser(lexer.lex(src, opts));
|
|
@@ -4685,7 +4685,7 @@ var require_runtime = __commonJS({
|
|
|
4685
4685
|
var lib = require_lib();
|
|
4686
4686
|
var arrayFrom = Array.from;
|
|
4687
4687
|
var supportsIterators = typeof Symbol === "function" && Symbol.iterator && typeof arrayFrom === "function";
|
|
4688
|
-
var Frame = /* @__PURE__ */ function() {
|
|
4688
|
+
var Frame = /* @__PURE__ */ (function() {
|
|
4689
4689
|
function Frame2(parent, isolateWrites) {
|
|
4690
4690
|
this.variables = /* @__PURE__ */ Object.create(null);
|
|
4691
4691
|
this.parent = parent;
|
|
@@ -4743,7 +4743,7 @@ var require_runtime = __commonJS({
|
|
|
4743
4743
|
return this.parent;
|
|
4744
4744
|
}, "pop");
|
|
4745
4745
|
return Frame2;
|
|
4746
|
-
}();
|
|
4746
|
+
})();
|
|
4747
4747
|
function makeMacro(argNames, kwargNames, func) {
|
|
4748
4748
|
return /* @__PURE__ */ __name(function macro() {
|
|
4749
4749
|
for (var _len = arguments.length, macroArgs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -5053,7 +5053,7 @@ var require_compiler = __commonJS({
|
|
|
5053
5053
|
"<=": "<=",
|
|
5054
5054
|
">=": ">="
|
|
5055
5055
|
};
|
|
5056
|
-
var Compiler = /* @__PURE__ */ function(_Obj) {
|
|
5056
|
+
var Compiler = /* @__PURE__ */ (function(_Obj) {
|
|
5057
5057
|
_inheritsLoose(Compiler2, _Obj);
|
|
5058
5058
|
function Compiler2() {
|
|
5059
5059
|
return _Obj.apply(this, arguments) || this;
|
|
@@ -5942,7 +5942,7 @@ var require_compiler = __commonJS({
|
|
|
5942
5942
|
return this.codebuf.join("");
|
|
5943
5943
|
}, "getCode");
|
|
5944
5944
|
return Compiler2;
|
|
5945
|
-
}(Obj);
|
|
5945
|
+
})(Obj);
|
|
5946
5946
|
module.exports = {
|
|
5947
5947
|
compile: /* @__PURE__ */ __name(function compile(src, asyncFilters, extensions, name, opts) {
|
|
5948
5948
|
if (opts === void 0) {
|
|
@@ -6515,7 +6515,7 @@ var require_loader = __commonJS({
|
|
|
6515
6515
|
var path = require_path();
|
|
6516
6516
|
var _require = require_object();
|
|
6517
6517
|
var EmitterObj = _require.EmitterObj;
|
|
6518
|
-
module.exports = /* @__PURE__ */ function(_EmitterObj) {
|
|
6518
|
+
module.exports = /* @__PURE__ */ (function(_EmitterObj) {
|
|
6519
6519
|
_inheritsLoose(Loader, _EmitterObj);
|
|
6520
6520
|
function Loader() {
|
|
6521
6521
|
return _EmitterObj.apply(this, arguments) || this;
|
|
@@ -6529,7 +6529,7 @@ var require_loader = __commonJS({
|
|
|
6529
6529
|
return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
|
|
6530
6530
|
}, "isRelative");
|
|
6531
6531
|
return Loader;
|
|
6532
|
-
}(EmitterObj);
|
|
6532
|
+
})(EmitterObj);
|
|
6533
6533
|
}
|
|
6534
6534
|
});
|
|
6535
6535
|
|
|
@@ -6552,7 +6552,7 @@ var require_precompiled_loader = __commonJS({
|
|
|
6552
6552
|
}
|
|
6553
6553
|
__name(_setPrototypeOf, "_setPrototypeOf");
|
|
6554
6554
|
var Loader = require_loader();
|
|
6555
|
-
var PrecompiledLoader = /* @__PURE__ */ function(_Loader) {
|
|
6555
|
+
var PrecompiledLoader = /* @__PURE__ */ (function(_Loader) {
|
|
6556
6556
|
_inheritsLoose(PrecompiledLoader2, _Loader);
|
|
6557
6557
|
function PrecompiledLoader2(compiledTemplates) {
|
|
6558
6558
|
var _this;
|
|
@@ -6575,7 +6575,7 @@ var require_precompiled_loader = __commonJS({
|
|
|
6575
6575
|
return null;
|
|
6576
6576
|
}, "getSource");
|
|
6577
6577
|
return PrecompiledLoader2;
|
|
6578
|
-
}(Loader);
|
|
6578
|
+
})(Loader);
|
|
6579
6579
|
module.exports = {
|
|
6580
6580
|
PrecompiledLoader
|
|
6581
6581
|
};
|
|
@@ -6606,7 +6606,7 @@ var require_node_loaders = __commonJS({
|
|
|
6606
6606
|
var _require = require_precompiled_loader();
|
|
6607
6607
|
var PrecompiledLoader = _require.PrecompiledLoader;
|
|
6608
6608
|
var chokidar;
|
|
6609
|
-
var FileSystemLoader2 = /* @__PURE__ */ function(_Loader) {
|
|
6609
|
+
var FileSystemLoader2 = /* @__PURE__ */ (function(_Loader) {
|
|
6610
6610
|
_inheritsLoose(FileSystemLoader3, _Loader);
|
|
6611
6611
|
function FileSystemLoader3(searchPaths, opts) {
|
|
6612
6612
|
var _this;
|
|
@@ -6669,8 +6669,8 @@ var require_node_loaders = __commonJS({
|
|
|
6669
6669
|
return source;
|
|
6670
6670
|
}, "getSource");
|
|
6671
6671
|
return FileSystemLoader3;
|
|
6672
|
-
}(Loader);
|
|
6673
|
-
var NodeResolveLoader = /* @__PURE__ */ function(_Loader2) {
|
|
6672
|
+
})(Loader);
|
|
6673
|
+
var NodeResolveLoader = /* @__PURE__ */ (function(_Loader2) {
|
|
6674
6674
|
_inheritsLoose(NodeResolveLoader2, _Loader2);
|
|
6675
6675
|
function NodeResolveLoader2(opts) {
|
|
6676
6676
|
var _this2;
|
|
@@ -6722,7 +6722,7 @@ var require_node_loaders = __commonJS({
|
|
|
6722
6722
|
return source;
|
|
6723
6723
|
}, "getSource");
|
|
6724
6724
|
return NodeResolveLoader2;
|
|
6725
|
-
}(Loader);
|
|
6725
|
+
})(Loader);
|
|
6726
6726
|
module.exports = {
|
|
6727
6727
|
FileSystemLoader: FileSystemLoader2,
|
|
6728
6728
|
PrecompiledLoader,
|
|
@@ -7021,7 +7021,7 @@ var require_environment = __commonJS({
|
|
|
7021
7021
|
}, "root")
|
|
7022
7022
|
}
|
|
7023
7023
|
};
|
|
7024
|
-
var Environment2 = /* @__PURE__ */ function(_EmitterObj) {
|
|
7024
|
+
var Environment2 = /* @__PURE__ */ (function(_EmitterObj) {
|
|
7025
7025
|
_inheritsLoose(Environment3, _EmitterObj);
|
|
7026
7026
|
function Environment3() {
|
|
7027
7027
|
return _EmitterObj.apply(this, arguments) || this;
|
|
@@ -7265,8 +7265,8 @@ var require_environment = __commonJS({
|
|
|
7265
7265
|
return _waterfall(tasks, callback, forceAsync);
|
|
7266
7266
|
}, "waterfall");
|
|
7267
7267
|
return Environment3;
|
|
7268
|
-
}(EmitterObj);
|
|
7269
|
-
var Context = /* @__PURE__ */ function(_Obj) {
|
|
7268
|
+
})(EmitterObj);
|
|
7269
|
+
var Context = /* @__PURE__ */ (function(_Obj) {
|
|
7270
7270
|
_inheritsLoose(Context2, _Obj);
|
|
7271
7271
|
function Context2() {
|
|
7272
7272
|
return _Obj.apply(this, arguments) || this;
|
|
@@ -7328,8 +7328,8 @@ var require_environment = __commonJS({
|
|
|
7328
7328
|
return exported;
|
|
7329
7329
|
}, "getExported");
|
|
7330
7330
|
return Context2;
|
|
7331
|
-
}(Obj);
|
|
7332
|
-
var Template2 = /* @__PURE__ */ function(_Obj2) {
|
|
7331
|
+
})(Obj);
|
|
7332
|
+
var Template2 = /* @__PURE__ */ (function(_Obj2) {
|
|
7333
7333
|
_inheritsLoose(Template3, _Obj2);
|
|
7334
7334
|
function Template3() {
|
|
7335
7335
|
return _Obj2.apply(this, arguments) || this;
|
|
@@ -7470,7 +7470,7 @@ var require_environment = __commonJS({
|
|
|
7470
7470
|
return blocks;
|
|
7471
7471
|
}, "_getBlocks");
|
|
7472
7472
|
return Template3;
|
|
7473
|
-
}(Obj);
|
|
7473
|
+
})(Obj);
|
|
7474
7474
|
module.exports = {
|
|
7475
7475
|
Environment: Environment2,
|
|
7476
7476
|
Template: Template2
|
|
@@ -8319,10 +8319,14 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8319
8319
|
this.setEngineLib(this.njkEnv, Boolean(this.config.libraryOverrides.njk));
|
|
8320
8320
|
this.addFilters(this.config.nunjucksFilters);
|
|
8321
8321
|
this.addFilters(this.config.nunjucksAsyncFilters, true);
|
|
8322
|
-
this.addPairedShortcode(
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8322
|
+
this.addPairedShortcode(
|
|
8323
|
+
"setAsync",
|
|
8324
|
+
async function(content, variableName) {
|
|
8325
|
+
this.ctx[variableName] = content;
|
|
8326
|
+
return "";
|
|
8327
|
+
},
|
|
8328
|
+
true
|
|
8329
|
+
);
|
|
8326
8330
|
this.addCustomTags(this.config.nunjucksTags);
|
|
8327
8331
|
this.addAllShortcodes(this.config.nunjucksShortcodes);
|
|
8328
8332
|
this.addAllShortcodes(this.config.nunjucksAsyncShortcodes, true);
|
|
@@ -8458,28 +8462,28 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8458
8462
|
_getPairedShortcodeFn(shortcodeName, shortcodeFn, isAsync = false) {
|
|
8459
8463
|
return /* @__PURE__ */ __name(function PairedShortcodeFunction() {
|
|
8460
8464
|
this.tags = [shortcodeName];
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8465
|
+
if (isAsync) {
|
|
8466
|
+
this.parse = function(parser, nodes) {
|
|
8467
|
+
var tok = parser.nextToken();
|
|
8468
|
+
var args = parser.parseSignature(true, true);
|
|
8469
|
+
parser.advanceAfterBlockEnd(tok.value);
|
|
8470
|
+
var body = parser.parseUntilBlocks("end" + shortcodeName);
|
|
8471
|
+
parser.advanceAfterBlockEnd();
|
|
8472
|
+
return new nodes.CallExtensionAsync(this, "run", args, [body]);
|
|
8473
|
+
};
|
|
8474
|
+
this.run = function(...args) {
|
|
8475
|
+
let resolve = args.pop();
|
|
8476
|
+
let body = args.pop();
|
|
8477
|
+
let [context, ...argArray] = args;
|
|
8478
|
+
body(function(e, bodyContent) {
|
|
8479
|
+
if (e) {
|
|
8480
|
+
resolve(
|
|
8481
|
+
new EleventyNunjucksError(
|
|
8482
|
+
`Error with Nunjucks paired shortcode \`${shortcodeName}\``,
|
|
8483
|
+
e
|
|
8484
|
+
)
|
|
8485
|
+
);
|
|
8486
|
+
}
|
|
8483
8487
|
let ret = shortcodeFn.call(
|
|
8484
8488
|
_Nunjucks.normalizeContext(context),
|
|
8485
8489
|
bodyContent,
|
|
@@ -8503,25 +8507,33 @@ var Nunjucks = class _Nunjucks extends TemplateEngine {
|
|
|
8503
8507
|
);
|
|
8504
8508
|
}
|
|
8505
8509
|
);
|
|
8506
|
-
}
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8510
|
+
});
|
|
8511
|
+
};
|
|
8512
|
+
} else {
|
|
8513
|
+
this.parse = function(parser, nodes) {
|
|
8514
|
+
var tok = parser.nextToken();
|
|
8515
|
+
var args = parser.parseSignature(true, true);
|
|
8516
|
+
parser.advanceAfterBlockEnd(tok.value);
|
|
8517
|
+
var body = parser.parseUntilBlocks("end" + shortcodeName);
|
|
8518
|
+
parser.advanceAfterBlockEnd();
|
|
8519
|
+
return new nodes.CallExtension(this, "run", args, [body]);
|
|
8520
|
+
};
|
|
8521
|
+
this.run = function(...args) {
|
|
8522
|
+
let body = args.pop();
|
|
8523
|
+
let [context, ...argArray] = args;
|
|
8524
|
+
let bodyContent = body();
|
|
8525
|
+
try {
|
|
8526
|
+
return new import_nunjucks.default.runtime.SafeString(
|
|
8527
|
+
shortcodeFn.call(_Nunjucks.normalizeContext(context), bodyContent, ...argArray)
|
|
8528
|
+
);
|
|
8529
|
+
} catch (e) {
|
|
8530
|
+
throw new EleventyNunjucksError(
|
|
8531
|
+
`Error with Nunjucks paired shortcode \`${shortcodeName}\``,
|
|
8532
|
+
e
|
|
8533
|
+
);
|
|
8522
8534
|
}
|
|
8523
|
-
}
|
|
8524
|
-
}
|
|
8535
|
+
};
|
|
8536
|
+
}
|
|
8525
8537
|
}, "PairedShortcodeFunction");
|
|
8526
8538
|
}
|
|
8527
8539
|
addShortcode(shortcodeName, shortcodeFn, isAsync = false) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Eleventy v4.0.0-alpha.
|
|
1
|
+
/*! Eleventy v4.0.0-alpha.5 (i18n Plugin) */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1758,7 +1758,7 @@ var GLOBAL_FS_NAME, fs, mkdir, existsSync, mkdirSync, readFileSync, statSync, wr
|
|
|
1758
1758
|
var init_shim_consume_fs = __esm({
|
|
1759
1759
|
"../../node_modules/@11ty/package-bundler/shims/shim-consume-fs.js"() {
|
|
1760
1760
|
GLOBAL_FS_NAME = "eleventyFileSystem";
|
|
1761
|
-
fs = window[GLOBAL_FS_NAME] || globalThis[GLOBAL_FS_NAME];
|
|
1761
|
+
fs = typeof window !== "undefined" && window[GLOBAL_FS_NAME] || typeof globalThis !== "undefined" && globalThis[GLOBAL_FS_NAME];
|
|
1762
1762
|
if (!fs) {
|
|
1763
1763
|
let noopError = function() {
|
|
1764
1764
|
throw new Error("This function was not included in your Eleventy bundle. Make sure you load memfs.js before using the virtual file system.");
|