(warning; lots of rambling in the first half, i'll be sure to mark the code section) so a few months ago, i read an article[0] by j3s titled "my website is one binary". to summarize, she
wrote about how her entire website is just (you guessed it) one binary. and it kind of amazed me,
in a way. well, multiple.
i suck at frontend webdev, so anything custom made without frameworks is always awesome
my public-facing blog uses a static-site generator (jekyll[1]), and i literally had no clue where id start to make one lol.
so to see a dev handroll their own webserver, and actually have a pretty neat result, i was shooketh! i found neocities, made an account, and... that was a few months ago. i didnt touch neocities for a while. now, after working at $INTERNSHIP
im a bit jaded with the whole modern tech ecosystem. i don't really know how to describe
it either, but my thoughts are kind of like this:
modern tech is filled with product-specific experts.
ex: very few people can take a website and deploy it to an actual server. instead, many people can upload it to $CLOUD_PROVIDER and are profecient in that.
simultaneously, modern tech...sucks. sort of.
like it's cool that i can technically spin up a docker container on the cloud, but so much of it is janky.
its sooo hard to find non-commercialized spaces in the modern internet
bots everywhere
the same tech that i love (programming) is simultaneously being used in the horrific way its described in dune.
(lots of spiraling here!)
i craved (or needed) a true return to form. something to center myself, feel like a 90s
c-wizard-gray-beard person. something that i truly built end-to-end, understood, wrestled with, hated,
loved, all that jazz. and then i remembered jes's article. and thus this blog was born! i didn't want to take the full plunge of self-hosting a public webserver yet, so this was a good
compromise: build a static-site-generator and host it here (on neocities, btw).
project requirements v0
my main requirements were as followed:
write pure html/css like the 90s intended
immediate backtrack
i downloaded bun/node
tried to run the basic sveltekit new project
random errors
almost threw my laptop.
(genuinely, modern frontend webdev has to be a social experiment ran by the devil.)
project requirements v1
my main requirements were as followed:
no outside dependencies (gasp) i had to program how god intended, by flipping bits
things needed to feel streamlined enough. i dont want to write raw html for every blog.
should feel fast. (after all, handling text at the scale of kb should be easy for any modern lang)
site shouldn't need js at all.
baby steps
okay! i have a project idea! i have motivation! i have caffeine! i have channeled rage! now... what do :/ so i started with the most basic "thing" i could think of: make an html template, and add a title to it
programatically. and, after relearning some parts of go (chat why is knowing what to name a module so hard), i did it!
baby leap
well, can't celebrate too early. just outputing a single html file is fun for a few seconds, but the
ghost of programming past whispered in my ear "you still have the rest of the project dummy". so, on to figuring out how to convert markdown to html! y'all, when i tell you, dont ever try to write a true markdown parser from scratch, i mean it. holy shit. i did learn some stuff![2]
apparently, funny enough, markdown was made as a way to write blogposts
the original "spec" isn't a spec at all; it's just however john gruber's perl script handled files
im as old as markdown!
but yeah, writing a markdown parser was so daunting, i was literally about to give up and find
some markdown library to do things for me lol. then, i realized: who said my posts need to be in markdown? why not just pick the easy parts of markdown
and screw the rest? thus! my custom .blog format was born. it's pretty similar to a .md, just a few differences here and there, but writing it honestly isn't bad.
(don't look at my parser code though, it makes me feel ashamed :( )
tween step
okay, so i had an html template, i had a fake markdown format, now what?
well, lots of "bookkeeping":
its great that i can gen html from a .blog file, but i need an actual build folder lol.
needed to make an archive for people to view my posts
homepage
aboutme
lots of css (honestly, ive impressed myself)
a build script
a static folder
but alas!
where we are today
this blog works? and kind of well-ish? i like the format, its easy for me to make changes,
and it's pretty fweaking fast (thanks go!). total time was about 10 hours of active dev time, so not bad i think! (if i remember to) i'll document some stuff for myself, and id love to integrate this into a webserver
binary. and, i really want to stick with this experiment of using alternative social media sites, i think
it'll be worth it. ill need to keep squashing bugs in the meantime though! anyways, lots of ramblings. stay weird! -bytes ps:
as soon as i rendered this blog, i ran into a bug and had to fix it LOL. list looked like this: