Houston, we are online!

….hello? is this thing on? Hello, world!

so, yeah! this is my first post! it's written inside emacs with org mode. very cool!!

1. this should have been done ages ago!

according to the neocities stats, my site was apparently updated one month ago. what did this update bring, you may ask?? well, i had just created my account and set up this generic placeholder:

<html lang="en">
  <head>
    <title>coopi's corner of the web!</title>
  </head>
  <body>
    <h1>Welcome to my little haven!</h1>
    <img src="./avatar.png" alt="coopi's Avatar">

    <div>
      <p>Unfortunately, there's nothing here; you came here before I had a chance to decorate it.</p>
      <p>Feel free to come back later though: I can't wait to share more about my projects, interests, and more!</p>
    </div>
  </body>
</html>

…and then abandoned the site.

apparently, a hundred people saw this boring page. which is wild, honestly.

but then, ive now gotten randomly interested again, and here we are!

2. how did we get here??

the original plan
use org mode for my site. why? because i live in emacs—email, notes, code, 3am thoughts—so blogging should too. it's the only way i function.
the problem

i didn't know where to start. i knew org mode had publishing capabilities, but not what they were. and while there are packages that make org blogging easy, i thought: why not use the built-in stuff instead?

i also wanted a syndication feed, which org mode supposedly provided.

3. down the rabbit hole…

first, i needed styling. org mode's default output is just plain html. super minimal. basically what you'd expect from someone who took motherfuckingwebsite.com too seriously.

i went on a hunt for pre-existing stylesheets—something minimal and nice. i found tufte css, designed by edward tufte—​the edward tufte, master of informational design. it looked perfect. clean, minimal, elegant. but there was a catch: tufte's design uses classes; org-mode's html export doesn't use them by default. i could fix that with some elisp—org-mode is infinitely extensible after all—but that seemed like more hassle than worth it.

but i thought, "maybe i can just adapt it." so i did. my css isn't perfect, but it's functional. i basically took tufte's minimalism, tweaked it to work with org-mode output, and added a few extras.

4. emacs-side: the quest for ox-publish and ox-rss

now that css was sorted, i turned to org-mode's ox-publish. the built-in publishing tool that can:

  • scan directories for .org files
  • export them to html
  • cache timestamps (only re-exports changed files)
  • copy static assets to output

pretty solid! but then i checked on the rss feature.

turns out, org-mode used to provide ox-rss, but it got split into its own package and is barely maintained now. at first i had been like, "okay, org-mode does rss—let me just use it." but after diving in, it felt like a hassle. i wasn't feeling it.

now, i have my preferences when it comes to syndication feed formats. i like atom feeds more than rss feeds. as ive told, ox-rss just didn't have the flair i was hoping for. so, my format preferences combined with ox-rss's dismal maintenance status, i figured i'd just make something that worked the way i wanted. which is exactly what i did: this website has an atom feed for u to follow!

5. deployment to neocities

last thing i needed was deployment. neocities has an api, so it was pretty easy. the approach for straightforward: url.el for making requests, my neocities api key for authentication, and boom—automated uploads.

6. so, how does everything work?

here's the breakdown:

building the site
org-mode scans the org/ directory, looks for .org files, and exports them to public/ as html. it also grabs static assets (images, css) and sticks them there.
publishing
the site gets built in emacs, then pushed to neocities via api call. simple url.el request with my credentials, and boom, site is live.
syndication
i wrote my own atom feed generator!! it pulls from the same .org files, spits out the feed.

and yeah, i ended up writing a ~500 line publish.el package. so much for using ox-publish and not using a pipeline…

anyways, i'll upload the code soon™, but it's staying private for now. it's not clean enough yet, and i'd rather release something i'm proud of.