aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-10-14 21:28:19 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-10-14 21:28:19 +0200
commit8158f66bb4842defd222b0989af3a6f621be212b (patch)
tree5564e440dde2fe491acf265a30234252bece4989 /build.sh
parent63d34b144553b7a5c683125588912bea075ef6a9 (diff)
downloadsebastiano.tronto.net-8158f66bb4842defd222b0989af3a6f621be212b.tar.gz
sebastiano.tronto.net-8158f66bb4842defd222b0989af3a6f621be212b.zip
Added Alta Via 2 pages (hidden)
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh24
1 files changed, 22 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 93f0294..b0ebde7 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3basedir="$(pwd)"
4
3recursivebuild() { 5recursivebuild() {
4 local destdir=$(echo "$1" | sed 's|^src|http|') 6 local destdir=$(echo "$1" | sed 's|^src|http|')
5 mkdir -p "$destdir" 7 mkdir -p "$destdir"
@@ -13,17 +15,35 @@ recursivebuild() {
13 done 15 done
14} 16}
15 17
18# This function is currently unused, but we keep it in case we need to
19# preprocess some m4 files.
20mdpreprocess() {
21 file="$1"
22 if [ "$(echo "$file" | sed 's/.*\.//')" = "m4" ]; then
23 printf 'm4_include(macros.m4)m4_dnl\n%s\n' "$(cat "$file")" | \
24 m4 -P -I "$basedir/utils"
25 else
26 cat "$file"
27 fi
28}
29
16copyfile() { 30copyfile() {
17 file=$1 31 file=$1
18 dest=$2 32 dest=$2
19 ind=$dest/index.html 33 ind=$dest/index.html
20 extension=$(echo "$file" | sed 's/.*\.//') 34 extension=$(echo "$file" | sed 's/.*\.//')
21 case "$extension" in 35 case "$extension" in
36 # m4 preprocess is currently disabled
37 #m4)
38 # noext=$(echo "$file" | sed 's/\..*//')
39 # mdpreprocess "$file" > $noext.md
40 # ;;
22 md) 41 md)
23 t="$(markdowntitle "$file")" 42 t="$(markdowntitle "$file")"
24 sed "s/TITLE/$t/" < top.html > "$ind" 43 sed "s/TITLE/$t/" < top.html > "$ind"
25 lowdown --html-no-skiphtml --html-no-escapehtml \ 44 mdpreprocess "$file" | \
26 "$file" >> "$ind" 45 lowdown --html-no-skiphtml --html-no-escapehtml \
46 >> "$ind"
27 cat bottom.html >> "$ind" 47 cat bottom.html >> "$ind"
28 ;; 48 ;;
29 html) 49 html)

Generated with cgit - Back to sebastiano.tronto.net