implement RSS, some cleanup

trunk
vilmibm 2024-05-19 22:07:40 +00:00
parent 8ed4d2bc15
commit 36816074e3
12 changed files with 72 additions and 20 deletions

12
feed.tmpl.xml 100644
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>the web log of vilmibm</title>
<link>https://tilde.town/~vilmibm/blog</link>
<description>the personal blog of tilde.town admin, poet, programmer vilmibm</description>
<language>en-us</language>
<webMaster>vilmibm@pm.me (vilmibm)</webMaster>
<managingEditor>vilmibm@pm.me (vilmibm)</managingEditor>
<generator>https://git.tilde.town/vilmibm/blog</generator>
<atom:link href="https://tilde.town/~vilmibm/blog/feed.xml" rel="self" type="application/rss+xml" />

View File

@ -3,6 +3,7 @@
<head>
<title>the web log of vilmibm</title>
<meta charset="UTF-8">
<link rel="alternate" type="application/rss+xml" href="feed.xml" title="the web log of vilmibm">
<style>
body {
background-color: #070e0f;

69
make.sh
View File

@ -1,7 +1,6 @@
#!/bin/bash
set -e
mkdir -p "${HOME}/public_gopher/blog" > /dev/null
mkdir -p "${HOME}/public_gemini/blog" > /dev/null
mkdir -p "${HOME}/public_html/blog" > /dev/null
@ -10,7 +9,6 @@ srcDir=$HOME/blog
postDir=$srcDir/posts
htmlIndexTmpl=$srcDir/index.tmpl.html
htmlDir=$HOME/public_html/blog
htmlIndex=$HOME/public_html/blog/index.html
gopherPath=$HOME/public_gopher/blog
@ -19,6 +17,9 @@ gopherIndex="${gopherPath}/gophermap"
geminiPath=$HOME/public_gemini/blog
geminiIndex="${geminiPath}/index.gmi"
rssIndexTmpl=$srcDir/feed.tmpl.xml
rssIndex=$HOME/public_html/blog/feed.xml
# attempt compilation
if [ ! -e "linkpost" ]
then
@ -33,7 +34,14 @@ then
cp $htmlIndex "${htmlIndex}.bak"
fi
# backup RSS feed
if [ -e "${rssIndex}" ]
then
cp $rssIndex "${rssIndex}.bak"
fi
cp $htmlIndexTmpl $htmlIndex
cp $rssIndexTmpl $rssIndex
# Remove old gopher and gemini posts
rm -f ${gopherPath}/*
@ -47,43 +55,66 @@ echo >> $gopherIndex
echo "the gemblog of vilmibm as it were" > $geminiIndex
echo >> $geminiIndex
# Initialize rss
rfc822pubDate="$(date +'%a, %d %b %Y %H:%M:%S %Z')"
printf " <pubDate>%s</pubDate>\n" "${rfc822pubDate}" >> $rssIndex
printf " <lastBuildDate>%s</lastBuildDate>\n" "${rfc822pubDate}" >> $rssIndex
cd $postDir > /dev/null
metadataKeys="pubdate:|title:|slug:|summary:"
for p in $(ls *.md | sort -r)
do
pubdate=$(grep "pubdate:" $p | sed 's/pubdate: //')
title=$(grep "title:" $p | sed 's/title: //')
slug=$(grep "slug:" $p | sed 's/slug: //' | tr -d \[:blank:\])
if [ -z "$pubdate" ] || [ -z "$title" ] || [ -z "$slug" ]
summary=$(grep "summary:" $p | sed 's/summary: //' | tr -d \[:blank:\])
httpLink="https://tilde.town/~vilmibm/blog#${slug}"
if [ -z "$pubdate" ] || [ -z "$title" ] || [ -z "$slug" ] || [ -z "$summary" ]
then
echo "warning: missing at least one of: pubdate, slug, title in ${p}"
echo "warning: missing at least one of: pubdate, slug, title, summary in ${p}"
else
# HTML
echo "<div class=\"title\">" >> $htmlIndex
echo "<h2>${title}<a name=\"${slug}\"></a></h2>" >> $htmlIndex
echo "<a class=\"pubdate\" href=\"https://tilde.town/~vilmibm/blog#${slug}\">${pubdate}</a>" >> $htmlIndex
echo "</div>" >> $htmlIndex
echo "<div class=\"post\">" >> $htmlIndex
grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "html" | pandoc -fmarkdown -thtml >> $htmlIndex
echo "</div>" >> $htmlIndex
echo "<div class=\"title\">" >> $htmlIndex
echo " <h2>${title}<a name=\"${slug}\"></a></h2>" >> $htmlIndex
echo " <a class=\"pubdate\" href=\"${httpLink}\">${pubdate}</a>" >> $htmlIndex
echo "</div>" >> $htmlIndex
echo "<div class=\"post\">" >> $htmlIndex
grep -Ev "$metadataKeys" $p | $lp --mode "html" | pandoc -fmarkdown -thtml >> $htmlIndex
echo "</div>" >> $htmlIndex
# Gopher
echo "0${title} ${slug}.txt" >> $gopherIndex
gopherPostPath="${gopherPath}/${slug}.txt"
echo "# ${title}" > $gopherPostPath
echo >> $gopherPostPath
echo "_published ${pubdate}_" >> $gopherPostPath
grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "gopher" >> $gopherPostPath
echo "# ${title}" > $gopherPostPath
echo >> $gopherPostPath
echo "_published ${pubdate}_" >> $gopherPostPath
grep -Ev "$metadataKeys" $p | $lp --mode "gopher" >> $gopherPostPath
# Gemini
echo "=> gemini://tilde.town/~vilmibm/blog/${slug}.gmi ${title}" >> $geminiIndex
geminiPostPath="${geminiPath}/${slug}.gmi"
echo "# ${title}" > $geminiPostPath
echo >> $geminiPostPath
echo "_published ${pubdate}_" >> $geminiPostPath
grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "gemini" >> $geminiPostPath
echo "# ${title}" > $geminiPostPath
echo >> $geminiPostPath
echo "_published ${pubdate}_" >> $geminiPostPath
grep -Ev "$metadataKeys" $p | $lp --mode "gemini" >> $geminiPostPath
# RSS
echo " <item>" >> $rssIndex
echo " <title>${title}</title>" >> $rssIndex
echo " <link>${httpLink}</link>" >> $rssIndex
echo " <guid>${httpLink}</guid>" >> $rssIndex
echo " <pubDate>${rfc822pubDate}</pubDate>" >> $rssIndex
echo " <description>${summary}</description>" >> $rssIndex
echo " </item>" >> $rssIndex
fi
done
# Finalize HTML
echo "</body></html>" >> $htmlIndex
# Finalize RSS
echo " </channel>" >> $rssIndex
echo "</rss>" >> $rssIndex

View File

@ -1,6 +1,7 @@
pubdate: Sat May 21 13:25:37 UTC 2022
title: new blog
slug: newblog
summary: being a post about this new blog; motivations, plans, et cetera
I made a blog. I haven't had one in years. When I did it was mostly for dream logging and poetry. I was always pretty self conscious about what I put there. I published my town `feels` posts as a "blog" for a while, but that never felt right. My `feels` content was overly personal, diaristic, and vulnerable. I used to think you could either be authentic (vulnerable to a fault) or inauthentic (crafting a personal brand), but now think often of a phrase I heard an actor use in an interview about learning to be "private in public." I interpreted that as being forthcoming with yourself in the public eye -- which we're all in, now, thanks to the internet -- but being defensive about what you share.

View File

@ -1,5 +1,6 @@
pubdate: Fri Jun 10 21:04:50 UTC 2022
title: dark steps
slug: darksteps
summary: being a nonsense jumble
taking dark steps and eating half the breadcrumbs is how i live. i no longer try to find the exit, just remember the rooms. meal time with the minotaur. the maze has it all: a trade in lunacy, nickelodeons, international coinage, soliloquies, eulogies, biscuits. when the imagery gets vivid i don't depart in death--it's just imperative to keep moving. it's imperative to keep moving and not get stuck in the windowless room that sometimes forgets its own door. there is an infinity of better rooms than that. there's the screaming room where ears can't be covered eyes can't be closed and in every direction the worst thing you ever beheld. there is the room of soft walls always yielding but never suffocating full of dry warmth and lavender. the library smelling of book mold and dark woods. the study with green glass lamps and green felt desk beds and pens and pens. the dark room where there is nothing. most critically, the foyer with the umbrella bucket and the coat pegs and the wash stand with the white marble. there's a chair in the foyer and i'll sit here when i don't know which door to open. the chair is made of wood and has a creak to it.

View File

@ -1,6 +1,7 @@
pubdate: Thu Sep 8 18:06:00 UTC 2022
title: berkeoffe
slug: berkeoffe
summary: being ruminations on coffee establishments after relocating to the bay area
i have moved to berkeley. of chief importance is finding the coffee. the following is the result of initial recon bike rides.

View File

@ -1,6 +1,7 @@
pubdate: Thu Sep 8 18:23:31 UTC 2022
title: the wall drug cinematic universe
slug: wall-drug-cinematic-universe
summary: being reflections on a hypothetical cinematic universe for wall drug
driving from chicago to berkeley we chose to go through south dakota because to my friend and me it was a mysterious, unvisited place. the wall drug signs begin soon after crossing the border on 80. i was unfamiliar, but my friend filled me in: a place that exists self-referentially. it doesn't offer services beyond that of any typical rest stop, and the draw to go there is the chance to experience what amounts to a meme (in the classical sense). in other words, a tourist trap.

View File

@ -1,6 +1,7 @@
pubdate: Sat Jan 7 02:34:49 UTC 2023
title: announcing Hermeticum (formerly tildemush)
slug: announcing-hermeticum
summary: being an announcment of a MUSH project
## tl;dr

View File

@ -1,6 +1,7 @@
pubdate: Thu Mar 31 04:37:31 UTC 2023
title: book marks
slug: bookmarks
summary: being a motley round-up of some bookmarks i found; some thoughts on computers i have owned.
I got a new computer. It's a thinkpad (x1 carbon gen10) and came with Ubuntu preinstalled. I often say this about new computers, but I really like it. I tend to get to a point when I'm mad at the new computer and then all feels lost until the next one. This one feels different; it feels like home. This is a blog post about bookmarks but first: a tour through computing disappointments from the thinkpad I had in 2010 to today:

View File

@ -1,6 +1,7 @@
pubdate: Thu Apr 13 05:06:39 UTC 2023
title: smudge
slug: smudge
summary: being an announcement of a new piece of artware.
I made a new piece of (LINK https://github.com/vilmibm/smudge software) . It's a command line piece of art.

View File

@ -1,6 +1,7 @@
pubdate: Fri Jul 14 04:52:12 UTC 2023
title: blackout.tilde.town
slug: blackout
summary: being an announcement of a new site for blackout poetry.
I made a new thing: a website for making blackout poetry with over nine million chunks of text extracted from Project Gutenberg. It's here at (LINK https://blackout.tilde.town blackout.tilde.town) .

View File

@ -1,7 +1,7 @@
pubdate: Thu Aug 31 19:38:25 UTC 2023
title: The MUD That's In My Mind
slug: mud-mind
summary: being an essay about mind palaces and mental health.
(content warning: suicide)