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