My Neocities Page is fucking bonkers dude. It's very wild to work with this thing.
My goal was to have a place on the internet where I could essentially just post. When cohost was going under, there were a bunch of people talking about what it means to make your own website, and one quote really stood out to me as advice for all the people who were making their own websites.
I interpreted that person's take as like: "It's great that a lot of people want to make their own websites. But if you're making a website to replace posting, remember that you need to design your system so that it's as easy and frictionless as hitting post on twitter."
In service to that goal, I've built a clunky-as-fuck junker car of a website. I've created an elaborately organized walk-in closet of a website. What I have done here is absolutely silly. Can I tell you about it?
Goal: 1) Make a site where I can publish disposable, throwaway posts super easily whenever I want. 2) If I want to share a link to a post, that should also be easy. 3) Also, I'll be using Neocities for some reason, instead of one of the many major social media platforms that already do this.
Neocities has limitations. There isn't really a way to plug in a backend to run tasks or logic, so you not making a dynamic web page the way most people conceive of it. To simplify, Neocities allows you to host static HTML, CSS, and Javascript. The bedrock. The base layer of making a website.
This means that the task: "publish a post", becomes a list of tasks.
So I started fuckin around and testing stuff.
First I figured out how I wanted to structure the files and what was going to work best for me. I knew I wanted to make really simple files for each separate post, that are basically just text files with HTML for general formatting, and worked backward from that concept.
I wrote one generic template for the whole website. I wrote a few sub-templates for different sections of the website, and I played around with using iframes to nest the templates inside of each other. That didn't work very well. It looked weird, and things like scrollbars behaved in really weird ways.
So then, I pulled in the jQuery library, to make it really easy to write code for playing around with HTML "DOM elements". I used that to write some functions that could grab html snippets out of my various template files and automatically plug them into each other. That way I could get around the awkwardness of how iframes were acting.
But the problem I was running into after that, was that you could click around from the home page and find my blog posts that way, but if you hit forward or backward, none of the navigation elements actually worked, because you weren't actually navigating the page. Worse, it wasn't possible to send working links to individual blog posts. You could only link people to the home page.
So I pulled in a javascript library called Navigo, and I learned how to make routers with that, which could fix the navigation and linking problems, et voila! So then, I could write posts and have them automatically get inserted into the page. The only part I was still doing was manually adding in links for each new post.
So I wrote a little more jquery, to look at my posts folder and automatically make a list of all my blog posts. It worked great in my testing. But a problem came up once I uploaded it all to Neocities. Basically, Neocities (and most of the internet) doesn't let code inside of a live webpage look at arbitrary other files and folders on the server around where that webpage lives. This probably makes sense to the big web security heads out there.
Which was fine for a bit. I was posting, I was adding navigation links, and making it work. I had gotten it to a point where I only had to work with my small template files, which was a psychological improvement over copy/pasting HTML boilerplates and inserting my posts into those over and over. (What if I wanna change something on one page! Do I have to change it on all of them??? Not anymore, sucker! Thank you templates!)
Uploading files to neocities by logging into the website was annoying me, and editing there was awful, so I learned how to use the terminal, and wrote a little shell script that could automatically upload my files via a Node function that calls the Neocities API. That was cool. Now it was easier than ever to publish posts.
So I had automated most - but not all - of the task and I was like "ughhhhh, I want to have fun only. I only want to make posts. I don't want to have to fiddle with extra bullshit (this was me lying to myself, I did want to fiddle with extra bullshit, but I chose my extra bullshit to be "spending a huge amount of time writing automations" instead of "spending a small amount of time every now and then adding links to navigation lists")".
So at that point I was like, okay, so to get around this security feature, I need to manually provide a specific link to each file, hmmm... hmmm...., well. what if I had one file, call it a phone book or a site map... that had a list of where to find all the other files! Okay! Great! Now if I need to know where some other file lives, I don't have to ask the server (which won't tell me), I can just manually link to the site map, and have the site map tell me.
So I made a file that showed where everything lived. And I was like: "Great, now instead of updating the navigation template, I just need to update sitemap.json. This isn't better at all, this is the same, I'm an idiot." Except it wasn't the same, because then I went back to my shell script from earlier, and I added a part in that could update the sitemap, every time I uploaded to Neocities.
Then I learned about cron jobs, which are shell scripts that you put on a timer to run regularly. Now, I can write plain text diary entries in a folder on my computer, and dump them there. And every six hours, my cron job grabs any files that have changed, and uses my shell script to upload them to Neocities, where they they are served to you on a static HTML page using a clunky mix of jquery and navigo. :)
Wow! Yay! HTML (DOM Elements), iframes, CSS (variable fonts & grid layouts), Javascript (Custom elements & typescript someday?), jquery (DOM manipulation, FOUC fixes), Navigo (routing), bash/zsh commands (tree, jq, tee to auto-update the routing file), Node.js (to call out to the:), Neocities API, and finally cron (for scheduling)! If you're crazy, you can do anything!