atom.awk : Generate an atom feed from plaintext blog posts
2022-05-09T12:45:44Z
TL;DR
mkdir site cd site mkdir blog vi blog/entry1.txt # write something, first line is title date +'%Y-%m-%dT%TZ' > blog/entry1.txt.pubdate $ find blog/ | awk -v domain="domain.tld" -v max=100 -v template=template.xml -f atom.awk > atom.xml
Description
Whether you write files in plaint text, markdown or any other markup language, you may want to create an atom feed.
That's actually what is proposed on shinobi.website.
You can even publish a whole blog only using ATOM feed.
This tool take a list of file as input and will generate an atom feed with the content of each fil as description.
No need for html escape or any conversion : it is plain text in a CDATA tag.
You can even write "<![CDATA[" in your pages, it will be escaped (not with shinobi.website's script for now, not sure how to reach the author to tell).
In order to include a file "blogentry.txt" in the feed, another file with the publication date must be next with the extension "blogentry.txt.pubdate". Date should be formatted '%Y-%m-%dT%TZ' (see strftime).
atom.awk is an awk script, available on most unix-like.
Download
Options
- "max" : maximum of item in the feed.
- "domain" : domain name of your feed.
- "template" : template file, the header of your atom feed. See template.xml as example.
Example
$ find blog/ | awk -v domain="domain.tld" -v max=100 -v template=template.xml -f atom.awk > atom.xml
Now publish atom.xml file.
See also
https://shinobi.website/index.txt 🌐