This page temporarily redirects to gemini://si3t.ch/code/atom.awk/.

atom.awk

TL;DR

mkdir posts
vi posts/entry1.txt
# write something, 
#    first line is title,
#    second line is post's date you can get with "date +'%Y-%m-%dT%TZ'"
$ awk -f atom.awk \
    -v domain="mydomain.tld" \
    -v author="batman.tld" \
    posts/ > atom.xml

# upload atom.xml on your server

Description

Whether you write files in plain text, markdown or any other markup language, you may want to create an atom feed. An atom feed with html content is a pain and restrictive. atom.awk let you publish your posts without any changes, in plain text as example. Doing so, you can publish an ATOM feed only blog such as suggested on shinobi.website.

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 "]]>" in your pages, it will be escaped.

Each post 1st line is the title. Post's 2nd line is publication date. Date format must be "%Y-%m-%dT%TZ". Use ''date +%Y-%m-%dT%TZ''.

atom.awk is an awk script, available on most unix-like.

Options

Use ''-v flag'' when calling atom.awk to adjust the following options:

Of course, you can edit source code to add more elements to the header, such as '''' tag or ''''.

Full example

Call atom.awk with minimal variables :

awk -f atom.awk -v domain="si3t.ch" -v author="prx" -v feedtitle="prx's blog" posts/

Or if you want to setup all options. Notice it will give the exact same output as above :

awk -f atom.awk \
    -v max=100 \
        -v protocol="https" \
    -v domain="si3t.ch" \
    -v feedurl="https://si3t.ch/posts/atom.xml"
    -v author="prx"\
    -v email="prx@si3t.ch"\
    -v feedtitle="prx's blog"\
    posts/

Download

=> atom.awk

See also

=> https://shinobi.website/index.txt


=> /

Proxy Information
Original URL
gemini://si3t.ch/code/atom.awk
Status Code
Success (20)
Meta
text/gemini;lang=fr
Capsule Response Time
978.72654 milliseconds
Gemini-to-HTML Time
0.991713 milliseconds

This content has been proxied by September (3851b).