New blog workflow: from markdown to gemtext
Previously
I was using babille[1], a python script that build a static site from markdown files. Babille is batteries included : blog, RSS, pages, sitemap, templates…
But, but, but, I don't want to write with the markdown text format anymore and I don't want to maintain a python script. Moreover, I want a Gemini capsule :P
GemText or OrgMode
I want to write my (b)log posts in the most easy and quick way. GemText[2] is some kind of very (very) light markdown. I choose that one over orgmode for its simplicity and because converting orgmode to gemtext was not as effective as I want. So, you just write and you don't bother with the formatting things because, there are none, or almost none :D.
From markdown to gemtext
I had to convert my old blog posts to fit on the gemini server. But there was more than the format, headers had to be converted too. I wrote this little script to do the job:
#!/bin/sh # # togmi.sh # # Bulk convert title.md files with header like below: # Title: your_title # Date: xxxx-xx-xx # Category: your_tag # # TO gemini gmi files date-title.gmi (required for the gemlog index) # with header below: # # your_title # reformated date in the 2nd line # No more category # Cleanup empty lines # # copy (do backup!!) your md files to the mdposts directory # You need lowdown to convert your markdown files to gemtext ones # run the script. # # LICENCE: WTFPL set -eu # .gmi files dir LOGDIR=log mkdir -p "${LOGDIR}" # move to md files dir MDFDIR=mdposts cd "${MDFDIR}" for f in *.md do D=$(grep Date ${f} | awk '{ print $2 }') sed -i -e 's/Title:/#/' -e "s/^Date.*$/${D}/" -e 's/^Category.*$//' "${f}" lowdown -Tgemini -o "${D}-${f%.md}.gmi" "${f}" done for g in *.gmi do sed -i '2d' "${g}" done mv *.gmi ../"${LOGDIR}" rm *.md cd - echo done!!!
Shinobi? Atom feed?
In the beginning I was planning to move to a shinobi website. It is a text-based, RSS focused blogging system. No more HTML, no more website in a classical way. But I thought that I couldn't force people to use a newsreader. This is why I have decided to convert my gemlog to html and to offer an atom feed based on the gemtext posts.
For the last one, I let you read prx's post, it's all that you need to build a beautiful atom feed that you can read from any web browser too.
- shinobi
- https://si3t.ch/log/2022-06-15-how-to-atom-feed.xhtml
- [BROKEN LINK: gemini://si3t.ch/log/2022-06-15-how-to-atom-feed.gmi]
From gemtext to html
For that I was planning to make a quick and dirty script first but as usual, prx[5] has already thought about it :P.
- https://si3t.ch/log/2022-09-29-gmi2xhtml-v6.xhtml
- [BROKEN LINK: gemini://si3t.ch/log/2022-09-29-gmi2xhtml-v6.gmi]
From markdown to orgmode
For the homepage, the contact page, the about one and for my writer page, I want to use orgmode and the powerfull publish emacs engine. For those fourth pages, I did the conversion to orgmode live through emacs.
Workflow
At the end, the workflow is like this:
To (b)log
- Write a post in .gmi.
- Run the capsule script to update the gemlog, the blog and the ATOM feed.
- Use git to commit and push galusik.fr (http) and capsule.galusik.fr (gemini) to SourceHut.
- https://git.sr.ht/~fredg/capsule.galusik.fr/tree/master/item/capsule.sh
Be aware that this script does the job but it can surely be improved ;).
To update the website
- Update the .org files.
- run M-x publish and let emacs do the job.
- Use git to commit and push galusik.fr to SourceHut.
TODO
- Move the capsule script to eLisp or Guile?