#!/bin/sh atom_xml() { cat < Ледяной автобус в Нифльхейм $(date --iso=seconds) Лиэс. tag:default-atom-feed EOF for i in $1/*.gmi; do if [ -n "$(echo "$i" | grep -Eo 'atom|index')" ]; then continue; fi raw_id=$(echo "$i" | rev | cut -d'/' -f 1 | rev) title=$(head -n 1 $i | tr -d '#') created=$(date -r $i --iso-8601=seconds) updated=$created if [ "$created" = "draft" ]; then continue; fi day=$(echo "$created" | sed 's/T.*//') #content=$($MARKDOWN "$f" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') cat < $title tag:$day:$raw_id $created $updated EOF done echo '' } uri="pub.phreedom.club/~localhost/Lies_dybr/" atom_xml $1