Updates

OK. I caved

19 Jul 2024

I ported this website to sveltekit because I cannot be stopped apparently.

Lamentations

That being said, setting up the update log (and future other lists/logs) was still a huge pain. Especially since I decided to use svelte 5… and mdsvex (a markdown utility for svelte) did not want to cooperate with it.

But hey, it’s more easily mainatainable in the future I guess?

What does this mean?

It means that that fancy json file that I talked about in a previous update is no longer going to be used. It’s a sad day for json.

No seriously, what is sveltekit?

It’s a frontend framework! Or more simply put… it helps you build websites without having to use raw javascript. Sveltekit is built on top of svelte. Which is the framework I do basically everything in nowadays lmao. My dashboard work for pluralkit is entirely in svelte!

If you know javascript already, it’s pretty easy to get used to. Although I will say that setting up something that imports blog posts like this is a bit more tedious for a beginner, even I struggled with it a little.

Sauce?

I’m considering publishing the source code for this website somewhere. I’ll make an update post whenever that happens. Although it likely won’t be kept up to date forever! I want to keep my secrets on here.

What did you run into while doing this?

Uhh. A couple of things, here’s the main deal:

  • you’ll want to enable pre-rendering but also ignore the http errors that you get while crawling… otherwise if you have any links to non-existing pages it will fail to build the site!
  • sveltekit, by default, does some client side things that I really didn’t need here. Mainly:
    • you’ll want to remove data-sveltekit-preload-data="hover"
    • and replace this with data-sveltekit-reload
    • this will disable its client side routing and ensure you only load your pages when actually on said page. This is the closest to how a neocities site functions when using basic html/css
  • if you’re using a similar method to me (generating json files based on something like blog posts) you’ll want to name the folders containing the server.ts files something like “posts.json”. Just, include the json there. Otherwise they’ll be built as plain text files and neocities does not like that lol.
  • make sure you specify a fallback called “not_found.html”, since that’s what neocities uses for pages that don’t exist.

In the end I figured it out but I’m not sure if any of these would be too obvious to a beginner >_> oh well.

© Fulmine 2024 - All Rights Reserved 🫐🐉