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 */
|
||||
eleventyConfig.addFilter("createAlt", (altObject) => {
|
||||
let alt;
|
||||
@@ -12,6 +13,11 @@ export default function (eleventyConfig) {
|
||||
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 */
|
||||
eleventyConfig.addFilter("randomize", function(array) {
|
||||
// Create a copy of the array to avoid modifying the original
|
||||
|
||||
Reference in new issue
Block a user