Break time

Break time

WARNING: BORING NERD TOPIC AHOY

I had mentioned on my Neocities profile that I would look into re-writing my website fairly soon right after pushing an update out. Took a bit longer than I would've liked honestly, but it's here!

Actually, it had been mostly finished for a while (since July 1), but I hit a couple of roadblocks (mainly date conversion) that demoralized me from working more on it at the time, as well as some lifestyle changes, like spending less time on the PC and exercising often.

The most notable things about my site re-write off the top of my head are:

I have no some idea what I'm doing

For starters, porting a website (at least one that's paw-written by yours truly) to a static site generator like Eleventy was definitely something, having only dabbled with editing .html and .css files without hosting a local server.

Initially I went looking around for a base (as to not start from complete scratch) to use and found Smol 11ty Starter by 5t3ph and set it up.

I was very eager to start working on it, and because I decided to do so late at night, I didn't consult any documentation and thus felt like it would be impossible to learn Nunjucks (one of the templating languages used in Eleventy) got upset, and as a result I settled down and slept.

You're telling me that Java scripted this?

I still don't understand JavaScript that well, got stumped on a couple of things, and as a result I took some time off working on the re-write.

Regardless, I had ported over the base layout and most pages, which would be around 90% of the work done within the first couple of days. The last 10% that was left being: having to tackle date conversion with Luxon, setting custom filters for Eleventy to use them and forgetting to port a few page elements to .json data tables.

Currently, my filters are handled really shittily, but they work whenever I build my site.

Here's how I currently have my filters set up for dates in my .eleventy.js file, if you also happen to struggle with this:

const { DateTime } = require("luxon");

module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("postDate", (dateObj) => {
    return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-MM-dd');
  });
  eleventyConfig.addFilter("galleryDate", (dateObj) => {
    return DateTime.fromISO(dateObj, { zone: 'utc' }).toLocaleString(DateTime.DATE_FULL);
  });
  eleventyConfig.addFilter("readableDate", (dateObj) => {
    return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toLocaleString(DateTime.DATE_FULL);
  });
};

Before you ask: No, I couldn't condense it into two filters, I tried. I'm far too stupid.

...For some unknown reason (to me) I don't know what causes the dates to get jumbled up whenever I used postDate for dates on my artworks, but I had to make a seperate filter that would read it as an ISO date. Vice versa with blog post dates. Genuinely clueless.

{ % endfor % }

Despite my struggles, I think Eleventy is a great piece of software, it's just that I'm not knowledgeable enough to leverage its strengths to the fullest.

The fault point here is not even Eleventy itself, but just a popular JavaScript library for dealing with time.

Invalid DateTime. ha, got you.