One day after deploying my website, what's next?
Published on
Yesterday, I spent a good chunk of my day off deploying my new website and getting it online, replacing the old functionality entirely. Previously, my website was hosted on Cloudflare Pages, a CDN service provided by CF for (pretty much) free. Now, as of yesterday, it’s served on my own hardware, leveraging Cloudflare tunnels for proxying traffic.
After release and review from a small group of people, I found some issues to crack down on. The deployment process was something else, thanks to Cloudflare’s mystery box DNS that was annoying painful to figure out why it wasn’t working. Yesterday was effectively my v0.1
release of Zeus for my own personal use, now to start working gradually towards a v0.2
, but not before some patching.
I don’t quite get RSS, but functionally I compare my site to many popular, functioning websites who I read on a daily basis, and try to draw how it works from there. There’s effectively two problems I suffer from right now:
One is a simple template change on the rss.xml
template I have, so not a big deal there, hopefully it’ll go away. The other part involves fixing how timestamps are generated from my page rendering section. Normally, I don’t include anything much fancier than month/day/year, but when I was last using Zola, they supported using RFC 3339 time formats as well. Using RFC 3339 would better help RSS readers with sorting my web articles, instead of … Well, guessing. I could naturally put my articles at a fixed time, but I think it makes more sense to support two formats instead of only one. I was simply too lazy to implement the regular expressions for it yesterday.
Fix one, correct the RSS feed by changing what I pulled in and making corrections. It was an oversight on my end as I did not change it when I was frantically developing yesterday. Fix two is a little more complicated, as in order for me to have more reliable time/date information for each post, I need to, unfortunately, add more time/date info for each post. All my datestamps have been simple up to this point; now I need to enhance it.
The changes for this is not as bad as one might think. The timestamp conversion code I would use is a simple regex matcher to break apart the matches and convert it into a datestamp to pass along into the build system. By tweaking the regex to include additional info like weekday name and the hour/minute/second, I can further steady the info so it’s properly sorted for downstream consumers of my RSS feed.
I still have to edit all my posts to get this new format of string.
; before
2024-06-20
; after
Thu, 20 Jun 2024 18:00:00 EDT
The start and end of the new datestamp are less important to me, and the only parts I need for Zeus to do it’s job is the actual day/month/year so it can create folder structure. I’m never going to create folders based on exact hours or anything like that. The raw datestamp string will get passed along to publishing while I’ll absorb day/month/year and pass it into the build program.
After all that work, the RSS feed is back in order, finally.
Right now, for me to make a new article, I have to manually stub it myself with all the information by hand. I need Zeus to do this for me, to save me a little effort, as well as to create the new datestamp format so I’m not plugging away at that each and every time.
Currently I only have a build command and a clean command, which is not great, but I can take advantage of the fact that I have a template system now, so I can use the templates to help me pre-fill the articles from the CLI, so I’m not having to go into Emacs and do it all myself and creating the title.
From a given template like:
+++
title: {{ new_title }}
desc:
date: {{ new_date }}
+++
Your content here
I can actually use the Publish-Template
function and load it up with data. I’ll stub the config.json
file with a new key/value like article_template
, and off I go hacking a new function. This was also a good time to re-organize the important functions of Zeus into multiple, separate functions, so my command-line
entrypoint isn’t one gigantic begin
statement to do everything. The New-Post
function looks like this, currently:
(define (New-Post Config args)
(writeln args)
(when (empty? args)
(error 'New-Post "No arguments supplied for new post"))
(unless (= 2 (length args))
(error 'New-Post "Incorrect number of arguments"))
(define source (car args))
(define title (cadr args))
(define Tstore (Build-Tstore "templates"))
(define t (trim (Hash:get-else Config 'post_template "")))
(unless (non-empty-string? t)
(error 'New-Post "No post_template defined for article creation"))
(unless (hash-has-key? Tstore t)
(error 'New-Post
(format "No template found in template folder for ~a" t)))
(define slug (Page:create-slug-from-str title))
(define cday (seconds->date (current-seconds)))
(define y (date-year cday))
(define m (date-month cday))
(define d (date-day cday))
(define p (s->p (format "~a/~a/~a-~a-~a-~a" "content" source y
(time-digit m) (time-digit d) slug)))
(make-directory* p)
(define nf (build-path p "index.md"))
(define new-post-hash
(make-immutable-hash
`((title . ,title)
(date . ,(format "~a, ~a ~a ~a ~a:~a:~a ~a"
(num->day (date-week-day cday))
d
(num->month m)
y
(time-digit (date-hour cday))
(time-digit (date-minute cday))
(time-digit (date-second cday))
(date*-time-zone-name cday))))))
(Tmpl:Publish Tstore t new-post-hash nf)
(printf "Created new post in ~a\n" nf))
About 40 lines of code, and so much of it is date/time wrangling, because it’s unfortunately a rather boring story in Lisp languages to have to constantly pull tiny numbers from structs, but it works. How do I know? I made this post with it!
I was able to grab the time when this post was initialized by Zeus, so now I don’t have to manually craft a timestamp manually, honestly saving me a bit of a headache so I don’t have to remember the format constantly. Title is stubbed out properly, and I can add additional keywords to the metadata section as needed, which I tend to do for thumbnail purposes anyway.
There’s some other non-fun changes made too, like:
Common.rkt
library for date/time wranglingThese were mostly uneventful, but hopefully now my website is more easy to read on mobile browsers. Might have to test that out later.
After a very tiring day of fixing things up, I’m ready to put the Zeus down and go relax. This was roughly 400 lines of code and content changes, and there’s some things still left to improve upon. As I continue to write new posts, port old material over and in general view my RSS feed on Feeder, I’ll see what needs to be done and make adjustments. Over time, I’d like to be able to casually write more freely on here, and I’m hoping Zeus really gets me toward that goal.
Total line count of all Zeus files is currently…
➜ ste5e.site git:(main) ✗ cat zeus/*.rkt | wc -l
1290
Not excluding any comments of course, but I’m glad it’s been relatively small, all things considered.
See you later!