diff --git a/gensmap.sh b/gensmap.sh index 3abe7cb..afeed85 100755 --- a/gensmap.sh +++ b/gensmap.sh @@ -1,9 +1,8 @@ -function r { echo $@ >> sitemap.xml; } -pushd ../.. -sed -i d sitemap.xml +function r { echo $@ >> out/sitemap.xml; } +test -d out/sitemap.xml && sed -i d sitemap.xml r '' r '' -for i in `find *`; do +for i in `find in -type f -name '*.html'`; do r "" r "https://atlas48.neocities.org/$i" r "$(date +"%Y-%M-%d" -r $i)" diff --git a/css/main.css b/in/css/main.css similarity index 100% rename from css/main.css rename to in/css/main.css diff --git a/dnd/minions.org b/in/dnd/minions.org similarity index 100% rename from dnd/minions.org rename to in/dnd/minions.org diff --git a/dnd/template.org b/in/dnd/template.org similarity index 100% rename from dnd/template.org rename to in/dnd/template.org diff --git a/dnd/villains.org b/in/dnd/villains.org similarity index 100% rename from dnd/villains.org rename to in/dnd/villains.org diff --git a/dnd/xaviard.org b/in/dnd/xaviard.org similarity index 100% rename from dnd/xaviard.org rename to in/dnd/xaviard.org diff --git a/img/av.png b/in/img/av.png similarity index 100% rename from img/av.png rename to in/img/av.png diff --git a/img/ucbanner.gif b/in/img/ucbanner.gif similarity index 100% rename from img/ucbanner.gif rename to in/img/ucbanner.gif diff --git a/index.txti b/in/index.txti similarity index 100% rename from index.txti rename to in/index.txti diff --git a/neocities.png b/in/neocities.png similarity index 100% rename from neocities.png rename to in/neocities.png diff --git a/not_found.html b/in/not_found.html similarity index 100% rename from not_found.html rename to in/not_found.html diff --git a/robots.txt b/in/robots.txt similarity index 100% rename from robots.txt rename to in/robots.txt diff --git a/main.html.m4 b/main.html.m4 index 6e32c83..bd9408f 100644 --- a/main.html.m4 +++ b/main.html.m4 @@ -1,6 +1,6 @@ dnl template.m4.html v1.2 dnl Part of the tape-and-string suite used to construct the website -include(LIB)dnl +include(`lib.m4')dnl diff --git a/render.sh b/render.sh index c7e4651..2aeed09 100755 --- a/render.sh +++ b/render.sh @@ -1,7 +1,12 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. # v3.0 -. titles.sh +enable -f /usr/lib/bash/csv csv +declare -A title +while read -r ii; do + csv -a i "$ii" + title[in/${i[0]}]=${i[1]} +done out/${i%.*}.html + o="${i/in/out}" + echo "$i => $o" + if test -z "${title[$i]}"; then + tape $i | m4 main.html.m4 > ${o%.*}.html + else + tape $i | m4 -DTITLE="${title[$i]}" main.html.m4 > ${o%.*}.html + fi done inf "Rendering sass files..." if test -z "${sass[@]}"; then @@ -52,8 +63,9 @@ if test -z "${sass[@]}"; then unset sass else for i in ${sass[@]}; do - echo $i - sassc -a $i out/$i + o="${i/in/out}" + echo "$i => $o" + sassc -a $i $o done fi if test -z "${scss[@]}"; then @@ -61,12 +73,10 @@ if test -z "${scss[@]}"; then unset scss else for i in ${scss[@]}; do - echo $i - sassc $i out/$i + o="${i/in/out}" + echo "$i => $o" + sassc $i $o done fi inf "Copying other files..." -# Probably a more efficient way to do this. -for i in ${rest[@]}; do - cp -v $i out/$i -done +cp -rv 'in'/* out/ diff --git a/title.csv b/title.csv new file mode 100644 index 0000000..5df20d9 --- /dev/null +++ b/title.csv @@ -0,0 +1,2 @@ +index.txti,"Atlas48's Archives" +not_found.html,"404 - Page Not Found" diff --git a/titles.sh b/titles.sh deleted file mode 100644 index 99c9460..0000000 --- a/titles.sh +++ /dev/null @@ -1,4 +0,0 @@ -declare -A titles -titles["not_found.txti"]="404 - Page Not Found" -titles["index.txti"]="Atlas48's Archives" - diff --git a/titles.tsv b/titles.tsv deleted file mode 100644 index 095a29c..0000000 --- a/titles.tsv +++ /dev/null @@ -1,2 +0,0 @@ -index.txti Atlas48's Archives -not_found.html 404 - Page Not Found