New and Improved!

This commit is contained in:
Atlas Cove 2023-02-08 17:17:45 +00:00
parent c9f22bdc3d
commit bf8e31dbab
17 changed files with 34 additions and 29 deletions

View File

@ -1,9 +1,8 @@
function r { echo $@ >> sitemap.xml; } function r { echo $@ >> out/sitemap.xml; }
pushd ../.. test -d out/sitemap.xml && sed -i d sitemap.xml
sed -i d sitemap.xml
r '<?xml version="1.0" encoding="UTF-8"?>' r '<?xml version="1.0" encoding="UTF-8"?>'
r '<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">' r '<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 for i in `find in -type f -name '*.html'`; do
r "<url>" r "<url>"
r "<loc>https://atlas48.neocities.org/$i</loc>" r "<loc>https://atlas48.neocities.org/$i</loc>"
r "<lastmod>$(date +"%Y-%M-%d" -r $i)</lastmod>" r "<lastmod>$(date +"%Y-%M-%d" -r $i)</lastmod>"

View File

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 214 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,6 +1,6 @@
dnl template.m4.html v1.2 dnl template.m4.html v1.2
dnl Part of the tape-and-string suite used to construct the website dnl Part of the tape-and-string suite used to construct the website
include(LIB)dnl include(`lib.m4')dnl
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>

View File

@ -1,7 +1,12 @@
#!/bin/bash #!/bin/bash
# render.sh: part of the tape-and-string framework. # render.sh: part of the tape-and-string framework.
# v3.0 # 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 <title.csv
function inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; } function inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; }
function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; }
function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; } function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
@ -30,21 +35,27 @@ function yn {
esac esac
done done
} }
doc=(`find . -wholename './.hg' -prune , -type f -name '*.txti' -o -name '*.org' -o -name '*.md'`) doc=(`find in -type f -name '*.txti' -o -name '*.org' -o -name '*.md'`)
sass=(`find . -wholename './.hg' -prune , -type f -name '*.sass'`) sass=(`find in -type f -name '*.sass'`)
scss=(`find . -wholename './.hg' -prune , -type f -name '*.scss'`) scss=(`find in -type f -name '*.scss'`)
rest=(`find . -wholename './.hg' -prune , -type f ! \( -name '*.org' -o -name '*.txti' -o -name '*.md' -o -name .hg \)`) rest=(`find in -type f ! \( -name '*.org' -o -name '*.txti' -o -name '*.md' -o -name .hg \)`)
dir=(`find . -wholename './.hg' -prune , -type d -not -name .hg`) dir=(`find in -type d`)
inf "Creating directory structure..." inf "Creating directory structure..."
echo ${dir[@]}
for i in ${dir[@]}; do for i in ${dir[@]}; do
echo $i o="${i/in/out}"
mkdir -p out/$i mkdir -pv $o
done done
inf "Rendering document files..." inf "Rendering document files..."
for i in ${doc[@]}; do for i in ${doc[@]}; do
echo $i o="${i/in/out}"
tape $i | m4 -DTITLE="${title[$i]}" main.html.m4 > out/${i%.*}.html 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 done
inf "Rendering sass files..." inf "Rendering sass files..."
if test -z "${sass[@]}"; then if test -z "${sass[@]}"; then
@ -52,8 +63,9 @@ if test -z "${sass[@]}"; then
unset sass unset sass
else else
for i in ${sass[@]}; do for i in ${sass[@]}; do
echo $i o="${i/in/out}"
sassc -a $i out/$i echo "$i => $o"
sassc -a $i $o
done done
fi fi
if test -z "${scss[@]}"; then if test -z "${scss[@]}"; then
@ -61,12 +73,10 @@ if test -z "${scss[@]}"; then
unset scss unset scss
else else
for i in ${scss[@]}; do for i in ${scss[@]}; do
echo $i o="${i/in/out}"
sassc $i out/$i echo "$i => $o"
sassc $i $o
done done
fi fi
inf "Copying other files..." inf "Copying other files..."
# Probably a more efficient way to do this. cp -rv 'in'/* out/
for i in ${rest[@]}; do
cp -v $i out/$i
done

2
title.csv Normal file
View File

@ -0,0 +1,2 @@
index.txti,"Atlas48's Archives"
not_found.html,"404 - Page Not Found"
1 index.txti Atlas48's Archives
2 not_found.html 404 - Page Not Found

View File

@ -1,4 +0,0 @@
declare -A titles
titles["not_found.txti"]="404 - Page Not Found"
titles["index.txti"]="Atlas48's Archives"

View File

@ -1,2 +0,0 @@
index.txti Atlas48's Archives
not_found.html 404 - Page Not Found
1 index.txti Atlas48's Archives
2 not_found.html 404 - Page Not Found