~ecs/ecs.d2evs.net

42632d1dc2a6a386b366eda0451af3406ff8ea8d — Eyal Sawady 6 months ago 5636f62
Add feed.xml

Still TODO are the implementations of get_date and get_description.
2 files changed, 28 insertions(+), 0 deletions(-)

M _config.sh
A feed.xml.w
M _config.sh => _config.sh +9 -0
@@ 1,3 1,4 @@
title=
get_title() {
	_title="$title"
	file="$(mktemp)"


@@ 9,6 10,14 @@ get_title() {
	title="$_title"
}

get_description() {
	echo "TODO: get description"
}

get_date() {
	echo "TODO: get date"
}

case $input in
	*.md.w)
		preprocessor="markdown -f fencedcode"

A feed.xml.w => feed.xml.w +19 -0
@@ 0,0 1,19 @@
% # Loosely based on https://git.sr.ht/~sircmpwn/drewdevault.com/tree/master/feed.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>ecs's blog</title>
		<description>I do stuff, most of which does not involve writing blog posts.</description>
		<link>https://ecs.d2evs.net</link>
		<atom:link href="https://ecs.d2evs.net/feed.xml" rel="self" type="application/rss+xml" />
% for i in $(ls "$root/posts" | sort -rn | head -n10); do
%     emit '<item>'
%     emit "<title>$(get_title "$i")</title>"
%     emit "<description>$(get_description "$root/posts/$i")</description>"
%     emit "<pubDate>$(get_date "$i")</pubDate>"
%     emit "<link>https://ecs.d2evs.net/posts/${i%\.w}</link>"
%     emit "<guid isPermaLink=\"true\">https://ecs.d2evs.net/posts/${i%\.w}</guid>"
%     emit '</item>'
% done
	</channel>
</rss>