Another gemlog script
Published: 2026-05-12
Sava.Rocks has just published a transmission on how they create new gemlog posts and the shell script they wrote for this purpose.
gemini://sava.rocks/blog/how-i-create-new-blog-posts/
This reminded me that I'm still a little bit annoyed every time I write something, I have to choose a filename, put the link, datestamp and title into the index.gmi, check that it works, correct my typo in the link, correct it again, etc. So I should write a script for this since my gemlog structure is slightly different. And writing it myself was a 10 minute job, having no error handling because that's just how I roll. If anything breaks I can just fix it by hand.
My gemlogs are structured the same way:
- A gemlog per topic (3 in my case)
- one folder per gemlog, containing an index.gmi and the transmissions in the same folder
The script is called from the directory I wanna post in and it requires an index.gmi already existing with at least valid post in it (This is needed in order to find the right line in the file). I simply keep it in the root folder of my gemsite.
A simple call to
../newpost.sh
Does the following things:
- create a tempfile
- get the date
- fill the tempfile with a bit of text to have a template
- open the editor to edit the tempfile, now looking like
# Title
Published: 2026-05-12
Write text here....
=> mailto:Rania%20al-Harisa<sojuz@v-tr.org>?subject=RE:%20RE:%20sava.rocks%20-%20Another%20gemlog%20script Reply
=> ./index.gmi Back to Gemlog
- After leaving the editor (don't forget to save), a filename is created from the title line, the publishing date is inserted as well as the subject field in the reply link.
- Last but not least, the script looks for the first line that matches a date stamp and inserts a new line there like this
=> filename.gmi date title
You can also download the full script here:
../newpost.sh
Reply
Back to Gemlog