From 9087f05a34b5c3fecbfbea405c0484d2ca5cf467 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Fri, 17 Feb 2023 16:15:53 +0000 Subject: [PATCH] Refactor work --- Makefile | 2 ++ m4/lib.m4 | 11 +++++------ m4/linkdata.m4 | 2 ++ m4/main.html.m4 | 11 +++++++---- render.sh | 6 +++--- 5 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 m4/linkdata.m4 diff --git a/Makefile b/Makefile index a38b41b..2411429 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,7 @@ clean: rm -rf out build: ./render.sh +sitemap: out/sitemap.xml + ./gensimap.sh push: build rclone sync -v out/ neo:/ diff --git a/m4/lib.m4 b/m4/lib.m4 index 46841d6..a89e069 100644 --- a/m4/lib.m4 +++ b/m4/lib.m4 @@ -1,6 +1,5 @@ -divert(-1) -# extra macros for site structure -define(`_ytv',`') -define(`_wrap',<$1>$2) -define(`_empty',`') -divert dnl +dnl extra macros for site structure +define(`_wrap',<$1>$2)dnl +define(`_a',$2)dnl +define(`_empty',`')dnl +define(`_ytv',`')dnl diff --git a/m4/linkdata.m4 b/m4/linkdata.m4 new file mode 100644 index 0000000..7f56e1b --- /dev/null +++ b/m4/linkdata.m4 @@ -0,0 +1,2 @@ +define(`entr', `pushdef(`_LINK',$1)')dnl +entr(`/,Home') diff --git a/m4/main.html.m4 b/m4/main.html.m4 index 429fadf..ea83fdc 100644 --- a/m4/main.html.m4 +++ b/m4/main.html.m4 @@ -1,9 +1,11 @@ dnl template.m4.html v2.0-p1 dnl Part of the tape-and-string suite used to construct the website ifdef(`DEBUG',`traceon')dnl -ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') -m4exit(1)')dnl -include(`m4/lib.m4')dnl +# ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') +# m4exit(1)')dnl +include(`lib.m4')dnl +include(`linkdata.m4')dnl +define(`_la',`_a(`argn(`1',$1),argn(`2',$1)') @@ -14,10 +16,11 @@ include(`m4/lib.m4')dnl
+stack_foreach(`_LINK',`_la') Home
-esyscmd(`./tape.sh' _INFILE) +# esyscmd(`./tape.sh' _INFILE)dnl
diff --git a/render.sh b/render.sh index 08570f9..3bcbdad 100755 --- a/render.sh +++ b/render.sh @@ -1,6 +1,6 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. -# v3.4-p1 +# v3.4-p2 #B: Load enable -f /usr/lib/bash/csv csv declare -A title @@ -35,9 +35,9 @@ function docs { o="${i/in/out}" echo "$i => $o" if test -z "${title[$i]}"; then - m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html + m4 -I m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") m4/main.html.m4 > ${o%.*}.html else - m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html + m4 -I m4 -D_INFILE="$i" -DCSSI=$(awk -f get_sd.awk <<< "$i") -DTITLE="${title[$i]}" m4/main.html.m4 > ${o%.*}.html fi done }