before I test

This commit is contained in:
Atlas Cove 2023-02-01 16:59:44 +00:00
parent 7eb4c3104d
commit 412f929e3d
3 changed files with 17 additions and 3 deletions

12
src/_tape/gensmap.sh Normal file
View File

@ -0,0 +1,12 @@
function r {echo $@ >> sitemap.xml;}
pushd ../..
sed -i d sitemap.xml
r '<?xml version="1.0" encoding="UTF-8"?>'
w '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
for i in `find *`; do
w "<url>"
w "<loc>https://atlas48.neocities.org/$i</loc>"
w "<lastmod>$(date +"%Y-%M-%d" -r $i)</lastmod>"
r "</url>"
done
r "</urlset>"

View File

@ -1,8 +1,9 @@
#!/bin/bash
# render.sh: part of the tape-and-string framework.
# v2.0
source string.sh
cd ..
files=(`find -not -path '_*'`)
files=(`find -not -path './_*'`)
for i in ${files[@]}; do
if test -d $i; then
if test -d ../$i; then
@ -10,7 +11,7 @@ for i in ${files[@]}; do
else continue
fi
elif test -f $i; then
tape $i | m4 -DTITLE=`${prog[title]}` ${prog[m4]} < $i ../$i
tape $i | m4 -DTITLE=`${prog[title]}` ${prog[m4]} < $i > ../$i
else
echo "Skipping $i, unknown file type"
fi

View File

@ -1,11 +1,12 @@
declare -A prog
prog[m4]=`readlink -f main.html`
prog[m4]=`readlink -f main.html.m4`
prog[title]=`readlink -f titlelookup`
function tape {
case $1 in
*.txti) redcloth $1 ;;
*.org) org-ruby --translate html $1 ;;
*.md) comrak --gfm $1 ;;
*.html) cat $1
*) pandoc --cols 168 -t html $i || echo "Unable to render $i, unknown format" ;;
esac
}