1 parent
63ced4bddf
commit
61dc9603a2
3 files changed
+11
-3
No files matched your search
+7
-1
@@ -1,5 +1,6 @@
|
|||||||
export default function (eleventyConfig) {
|
import { DateTime } from "luxon";
|
||||||
|
|
||||||
|
export default function (eleventyConfig) {
|
||||||
/* Create a single alt string from a multi-string alt object */
|
/* Create a single alt string from a multi-string alt object */
|
||||||
eleventyConfig.addFilter("createAlt", (altObject) => {
|
eleventyConfig.addFilter("createAlt", (altObject) => {
|
||||||
let alt;
|
let alt;
|
||||||
@@ -12,6 +13,11 @@ export default function (eleventyConfig) {
|
|||||||
return alt;
|
return alt;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* For <time> elements */
|
||||||
|
eleventyConfig.addFilter("htmlDateString", (dateObj) => {
|
||||||
|
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat("yyyy-LL-dd");
|
||||||
|
});
|
||||||
|
|
||||||
/* What it says on the tin */
|
/* What it says on the tin */
|
||||||
eleventyConfig.addFilter("randomize", function(array) {
|
eleventyConfig.addFilter("randomize", function(array) {
|
||||||
// Create a copy of the array to avoid modifying the original
|
// Create a copy of the array to avoid modifying the original
|
||||||
|
|||||||
Generated
+2
-1
@@ -12,7 +12,8 @@
|
|||||||
"@11ty/eleventy": "^3.1.5",
|
"@11ty/eleventy": "^3.1.5",
|
||||||
"@11ty/eleventy-img": "^6.0.4",
|
"@11ty/eleventy-img": "^6.0.4",
|
||||||
"@11ty/eleventy-navigation": "^1.0.5",
|
"@11ty/eleventy-navigation": "^1.0.5",
|
||||||
"@mdit/plugin-attrs": "^0.25.1"
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
|
"luxon": "^3.7.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@11ty/dependency-tree": {
|
"node_modules/@11ty/dependency-tree": {
|
||||||
|
|||||||
+2
-1
@@ -13,6 +13,7 @@
|
|||||||
"@11ty/eleventy": "^3.1.5",
|
"@11ty/eleventy": "^3.1.5",
|
||||||
"@11ty/eleventy-img": "^6.0.4",
|
"@11ty/eleventy-img": "^6.0.4",
|
||||||
"@11ty/eleventy-navigation": "^1.0.5",
|
"@11ty/eleventy-navigation": "^1.0.5",
|
||||||
"@mdit/plugin-attrs": "^0.25.1"
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
|
"luxon": "^3.7.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user