From 412f929e3d05619c067c8c6fe304b67e91963c83 Mon Sep 17 00:00:00 2001 From: Atlas Cove <5618106+Atlas48@users.noreply.github.com> Date: Wed, 1 Feb 2023 16:59:44 +0000 Subject: [PATCH] before I test --- src/_tape/gensmap.sh | 12 ++++++++++++ src/_tape/render.sh | 5 +++-- src/_tape/string.sh | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/_tape/gensmap.sh diff --git a/src/_tape/gensmap.sh b/src/_tape/gensmap.sh new file mode 100644 index 0000000..a9633eb --- /dev/null +++ b/src/_tape/gensmap.sh @@ -0,0 +1,12 @@ +function r {echo $@ >> sitemap.xml;} +pushd ../.. +sed -i d sitemap.xml +r '' +w '' +for i in `find *`; do +w "" +w "https://atlas48.neocities.org/$i" +w "$(date +"%Y-%M-%d" -r $i)" +r "" +done +r "" diff --git a/src/_tape/render.sh b/src/_tape/render.sh index 6e47e82..4610da8 100755 --- a/src/_tape/render.sh +++ b/src/_tape/render.sh @@ -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 diff --git a/src/_tape/string.sh b/src/_tape/string.sh index 55a1b60..1651e82 100644 --- a/src/_tape/string.sh +++ b/src/_tape/string.sh @@ -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 }