#!/bin/sh blog_domain='https://lucy.moe/' output() { echo "$1" >> dist/posts-table.html } output_rss() { echo "$1" >> dist/rss.xml } add_header() { output '' output_rss ' Lucy Lucys blog' output_rss " $(date --iso-8601=seconds) https://lucy.moe/rss.xml " } add_footer() { html_entry "https://asagi.moe" "before July 2020" "Old site" output '
title date
' output_rss '' } html_entry() { output '' webpath="$1" time="$2" title="$3" output "$title" output "$time" } rss_entry() { # this is made to represent what heise.de has done with # their rss/atom feeds and doesn't need any escaping output_rss " $1 $(date --iso-8601=seconds -d $4) $(date --iso-8601=seconds -r $3) $blog_domain$2 $(grep -h '^

' "dist/$2" | head -n 1 | sed 's/

//;s/<\/p>//;/