#!/bin/sh
now () {
date --rfc-3339=seconds | sed 's/ /T/'
}
meta () {
perl -nle '// && print $1' "$2"
}
dates () {
local published=$(meta "published-on" "$1")
if [ -z "$published" ]; then
published=$(git rev-list --no-commit-header --pretty=%aI HEAD -- "$1" | tail -n1)
fi
local modified=$(git rev-list --after="2024-01-23 02:00+01:00" -1 --no-commit-header --pretty=%aI HEAD -- "$1")
[ -z "$modified" ] && modified=$(meta "last-modified-on" "$1")
[ -z "$modified" ] && modified=$published
echo "$modified"
echo "$published"
}
cat <
~aki
https://ignore.pl/
$(now)
https://ignore.pl/favicon.png
Aki
please@ignore.pl
HEADER
for article in [^_]*.html; do
if [ "$article" != "index.html" ]; then
cat <<-ENTRY
$(grep "" $article)
https://ignore.pl/$article
$(dates $article)
ENTRY
fi
done
echo ""