Refactor work

This commit is contained in:
Atlas Cove 2023-02-17 16:15:53 +00:00
parent 6735e712eb
commit 9087f05a34
5 changed files with 19 additions and 13 deletions

View File

@ -16,5 +16,7 @@ clean:
rm -rf out rm -rf out
build: build:
./render.sh ./render.sh
sitemap: out/sitemap.xml
./gensimap.sh
push: build push: build
rclone sync -v out/ neo:/ rclone sync -v out/ neo:/

View File

@ -1,6 +1,5 @@
divert(-1) dnl extra macros for site structure
# extra macros for site structure define(`_wrap',<$1>$2</$1>)dnl
define(`_ytv',`<iframe width="ifdef(`$3',$1,560)" height="ifdef(`$3',$3,315)" src="$1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>') define(`_a',<a href="$1">$2</a>)dnl
define(`_wrap',<$1>$2</$1>) define(`_empty',`')dnl
define(`_empty',`') define(`_ytv',`<iframe width="ifdef(`$3',$1,560)" height="ifdef(`$3',$3,315)" src="$1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>')dnl
divert dnl

2
m4/linkdata.m4 Normal file
View File

@ -0,0 +1,2 @@
define(`entr', `pushdef(`_LINK',$1)')dnl
entr(`/,Home')

View File

@ -1,9 +1,11 @@
dnl template.m4.html v2.0-p1 dnl template.m4.html v2.0-p1
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
ifdef(`DEBUG',`traceon')dnl ifdef(`DEBUG',`traceon')dnl
ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined') # ifdef(`_INFILE',`dnl ',`errprint(`Macro _INFILE is not defined')
m4exit(1)')dnl # m4exit(1)')dnl
include(`m4/lib.m4')dnl include(`lib.m4')dnl
include(`linkdata.m4')dnl
define(`_la',`_a(`argn(`1',$1),argn(`2',$1)')
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -14,10 +16,11 @@ include(`m4/lib.m4')dnl
</head> </head>
<body> <body>
<div class="header"> <div class="header">
stack_foreach(`_LINK',`_la')
<a href="/">Home</a> <a href="/">Home</a>
</div> </div>
<div class="content"> <div class="content">
esyscmd(`./tape.sh' _INFILE) # esyscmd(`./tape.sh' _INFILE)dnl
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# render.sh: part of the tape-and-string framework. # render.sh: part of the tape-and-string framework.
# v3.4-p1 # v3.4-p2
#B: Load #B: Load
enable -f /usr/lib/bash/csv csv enable -f /usr/lib/bash/csv csv
declare -A title declare -A title
@ -35,9 +35,9 @@ function docs {
o="${i/in/out}" o="${i/in/out}"
echo "$i => $o" echo "$i => $o"
if test -z "${title[$i]}"; then 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 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 fi
done done
} }