All Work and Derivative Works in Source or Object form are licensed per Apache-2.0. Unless stated otherwise, all text, media and other content is licensed under the CC BY-SA 4.0 license.
runhaskell src/Site.hs
touch pages/* posts/*
find posts/*.md \
-exec yq '.url = ("/{}" | sub("/\d{4}-\d\d-\d\d-", "/") | sub("\.md$", ""))' -f extract '{}' ';'
maid -q meta | \
yq ea -oxml '(
{ "+p_xml": "version=\"1.0\" encoding=\"utf-8\""
, "feed":
{ "+@xmlns": "http://www.w3.org/2005/Atom"
, "title": "rini blog"
, "link":
[ { "+@href": "http://rinici.de/" }
, { "+@href": "http://rinici.de/posts/atom.xml"
, "+@rel": "self"
}
]
, "icon": "/ico.png"
, "rights": "© 2024 rini"
, "id": "https://rinici.de/"
, "updated": now | tz("UTC")
, "entry":
[.] | sort_by(.date) | reverse[] |
{ "title": .title
, "author":
( .author |
( select(type == "!!seq").0 // . ) |
{ "name": .name, "uri": .url }
)
, "link": { "+@href": .url }
, "id": "https://rinici.de" + .url
, "updated": .date | with_dtf("Jan. 2, 2006"; format_datetime("2006-01-02T15:04:05Z07:00"))
, "content": { "+@src": .url, "+@type": "html" }
, "summary": .subtitle
}
}
})'
set -o noclobber
post=posts/$(yq -n 'now | format_datetime("2006-01-02")')-"$3".md
cat >$post <<EOF
---
title: ${3}
subtitle: Subtitle
$(yq "{\"author\":.$2}" authors.yml)
date: $(yq -n 'now | format_datetime("Jan 02, 2006")')
---
EOF
echo "Created $post"
maid -w . generate &
live-server --middleware=$(realpath mw.js) --host=0.0.0.0 _site &
wait
rsync -avz --delete _site "$(cabal list-bin server)" rinici.de:web