@ -53,52 +53,6 @@ get_post_title() {
cat " $1 " | perl -lne 's/#{1,3}\s+(.*)/\1/ or next; print; exit'
}
make_atom( ) {
echo "Bulding atom feed..."
atomfile = " $gemlog_feed . $RANDOM "
while [ [ -f $atomfile ] ] ; do atomfile = " $gemlog_feed . $RANDOM " ; done
{
pubdate = $( date " $date_format_8601 " )
cat << EOF
<?xml version = "1.0" encoding = "utf-8" ?>
<feed xmlns = "http://www.w3.org/2005/Atom" >
<title>$global_title </title>
<subtitle>$global_description </subtitle>
<link rel = 'self' href = '$feed_base_url$gemlog_feed' />
<link rel = 'alternate' href = '$global_url$index' />
<updated>$pubdate </updated>
<author>
<name>$global_author </name>
<email>$global_author_email </email>
<uri>$global_author_url </uri>
</author>
<id>$global_url </id>
<generator uri = '$gemlog_sh_link' >gemlog.sh</generator>
<rights>© $global_author - $global_license </rights>
EOF
n = 0
while IFS = '' read -r i; do
( ( n >= $number_of_feed_articles ) ) && break
printf "\n <entry>\n <title>"
get_post_title " $i " | tr -d '\n'
printf " </title>\n <id> $global_url ${ i # './' } </id>\n "
printf " <link rel='alternate' href=' $global_url ${ i # './' } '/>\n <updated> "
echo " $i " | perl -ne '/^(\d{4}-\d{2}-\d{2}).*/; print $1' | date " $date_format_8601_timeless " -f - | tr -d '\n'
# change or remove the <summary></summary> block if you want a different description or no description at all
printf " </updated>\n <summary>You need a gemini client to view this post. If you have one installed, here is the link to the post: $global_url ${ i # './' } </summary>\n </entry>\n "
n = $(( n + 1 ))
done < <( ls -r [ [ :digit:] ] *.gmi)
printf '</feed>'
} 3>& 1 >" $atomfile "
mv " $atomfile " " $gemlog_feed "
chmod 644 " $gemlog_feed "
}
build_entries( ) {
echo "Building index..."
@ -185,6 +139,5 @@ toot() {
}
make_globals
make_atom
build_entries