From 8158f66bb4842defd222b0989af3a6f621be212b Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 14 Oct 2025 21:28:19 +0200 Subject: Added Alta Via 2 pages (hidden) --- build.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 93f0294..b0ebde7 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,7 @@ #!/bin/sh +basedir="$(pwd)" + recursivebuild() { local destdir=$(echo "$1" | sed 's|^src|http|') mkdir -p "$destdir" @@ -13,17 +15,35 @@ recursivebuild() { done } +# This function is currently unused, but we keep it in case we need to +# preprocess some m4 files. +mdpreprocess() { + file="$1" + if [ "$(echo "$file" | sed 's/.*\.//')" = "m4" ]; then + printf 'm4_include(macros.m4)m4_dnl\n%s\n' "$(cat "$file")" | \ + m4 -P -I "$basedir/utils" + else + cat "$file" + fi +} + copyfile() { file=$1 dest=$2 ind=$dest/index.html extension=$(echo "$file" | sed 's/.*\.//') case "$extension" in + # m4 preprocess is currently disabled + #m4) + # noext=$(echo "$file" | sed 's/\..*//') + # mdpreprocess "$file" > $noext.md + # ;; md) t="$(markdowntitle "$file")" sed "s/TITLE/$t/" < top.html > "$ind" - lowdown --html-no-skiphtml --html-no-escapehtml \ - "$file" >> "$ind" + mdpreprocess "$file" | \ + lowdown --html-no-skiphtml --html-no-escapehtml \ + >> "$ind" cat bottom.html >> "$ind" ;; html) -- cgit v1.3