Automating Fediverse Toots for New Lume Articles, Linking Post URLs for Comment Support

Hello, this is Munou (Incompetent).
It was something that vaguely came to mind, but I was looking for various software to view Fediverse posts on the CLI, and it felt like it might work, and it did.
Don't get too excited about static site generators; I've seen many people abandon updates with SSGs or get tired of them and return to WordPress. I am one of those who are determined to use SSGs no matter what. No, actually, I'm just saying that because LumeCMS is so comfortable to use.
Rough Flow
The flow is already such that Lume's static site build is determined by change management with Git and the return value when committing, and then built.
This is quite convenient.
If you accidentally change a source file while playing around and think "Ah!", you can recover by checking the past update history with git log and then using git reset.
Anyway, I've strayed a bit from the topic, but
- Automatically detect only new articles during the build phase and auto-post them to Mastodon with a
toot. - Store the posted URL, which is available in the standard output, into a variable.
- Add necessary information to the new article using
awk, then commit and build again. - Rejoice!
I also wondered "how to detect only new articles?", but assuming that this posting behavior is performed in the directory where blog post .md files exist, I thought it would be sufficient to consider a file as new if it doesn't contain a specific string added to the .md file (indicating it's already processed), or simply if it's the newest file in the directory as identified by ls -tr | tail -1.
Aside
I still feel like there are some issues, but the source code is here.
haturatu/lumebuild
To be honest, it's not yet something that can run in other people's environments (there are no command checks either), so I need to add various things.
I haven't even updated the README...
At first, I thought it was revolutionary to be able to link Fediverse comments with blog post submissions, but it's not immediately possible to copy and paste the URL until after the article is created, and posting it was a hassle.
Honestly, I can't deny that it feels quite like a brute-force approach...
The programming language AWK, which recently had a second edition released and is getting a bit of buzz again, feels like something I should buy.
As a bonus, I found that Rust documentation, which looks like static site-based Wiki Pages, is very easy to read. It turns out it's called mdbook, and I've recently introduced it, and it's quite good.
That's all for now.
See you next time.