buncha progress

This commit is contained in:
2026-04-29 21:12:19 -07:00
parent 867f42bc1d
commit 0abf2dd167
23 changed files with 312 additions and 36 deletions

View File

@ -1,3 +1,5 @@
import { DateTime } from "luxon";
export default function(eleventyConfig) {
// Return the keys used in an object
eleventyConfig.addFilter("getKeys", target => {
@ -9,33 +11,44 @@ export default function(eleventyConfig) {
let tagline;
switch (tag) {
case "animals and the outdoors":
tagline = "grass touchin'";
tagline = "touchin' grass";
break;
case "art and crafts":
/* tagline = */
tagline = "makin' stuff";
break;
case "food and drink":
tagline = "good eatin'";
break;
case "history and science":
/* tagline = */
tagline = "book learnin'"
break;
case "home improvement and diy":
case "repair and diy":
tagline = "fixin' stuff";
break;
case "interpersonal and life":
/* tagline = */
tagline = "better livin'";
break;
case "technology":
tagline = "computer touchin'";
break;
case "writing, editing, and literature":
/* tagline = */
case "writing editing and literature":
tagline = "wordsmithin'";
break;
};
return tagline;
});
/* For <time> elements */
eleventyConfig.addFilter("htmlDateString", (dateObj) => {
return DateTime.fromJSDate(dateObj, { zone: "utc" }).toFormat('yyyy-LL-dd');
});
/* Human-readable dates */
eleventyConfig.addFilter("readableDate", (dateObj, zone) => {
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" })
.toLocaleString(DateTime.DATE_FULL);
});
/* Filter out structural tags */
eleventyConfig.addFilter("removeCoreTags", (tags) => {
return tags.filter(tag => ["all"].indexOf(tag) === -1);