💾 Archived View for capsule.galusik.fr › log › 2022-10-23-new-blog-workflow.gmi captured on 2024-08-31 at 12:27:27. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-26)

-=-=-=-=-=-=-

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

https://git.sr.ht/~fredg/babille[1

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.

GemText specs

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!!!

`----

https://git.sr.ht/~fredg/capsule.galusik.fr/tree/master/item/togmi.sh

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

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

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

Be aware that this script does the job but it can surely be improved ;).

https://git.sr.ht/~fredg/capsule.galusik.fr/tree/master/item/capsule.sh

To update the website

TODO