gemini index

trunk
vilmibm 2022-05-21 05:14:52 +00:00
parent 9353b63496
commit b5129139f5
1 changed files with 10 additions and 5 deletions

15
make.sh
View File

@ -1,5 +1,4 @@
#!/bin/bash
set -e
# global
@ -14,7 +13,10 @@ htmlIndexTmpl=/home/vilmibm/blog/index.tmpl.html
htmlIndex=/home/vilmibm/public_html/blog/index.html
gopherPath=/home/vilmibm/public_gopher/blog
gopherIndex="${gopherPath}/gophermap"
geminiPath=/home/vilmibm/public_gemini/blog
geminiIndex="${geminiPath}/index.gmi"
cd $postDir > /dev/null
@ -30,10 +32,13 @@ cp $htmlIndexTmpl $htmlIndex
rm ${gopherPath}/*
# Initialize blog gophermap
gopherIndex="${gopherPath}/gophermap"
echo "!the phlog of vilmibm as it were" > $gopherIndex
echo >> $gopherIndex
# Initialize blog index for gemini
echo "the gemblog of vilmibm as it were" > $geminiIndex
echo >> $geminiIndex
for p in $(ls *.md)
do
pubdate=$($g "pubdate:" $p | $sed 's/pubdate: //')
@ -58,14 +63,14 @@ do
echo "_published ${pubdate}_" >> $gopherPostPath
$g -v "pubdate:" $p | $g -v "title:" | $g -v "slug:" >> $gopherPostPath
# TODO index for gemini
# Gemini
echo "=> gemini://tilde.town/~vilmibm/blog/${slug}.gmi ${title}" >> $geminiIndex
geminiPostPath="${geminiPath}/${slug}.gmi"
echo "# ${title}" > $geminiPostPath
echo >> $geminiPostPath
echo "_published ${pubdate}_" >> $geminiPostPath
$g -v "pubdate:" $p | $g -v "title:" | $g -v "slug:" >> $geminiPostPath
fi
echo "</body></html>" >> $htmlIndex
done
echo "</body></html>" >> $htmlIndex