diff options
1 files changed, 15 insertions, 10 deletions
| -rwxr-xr-x | generate.sh | 25 |
diff --git a/generate.sh b/generate.sh index d2ba7f9..49096fa 100755 --- a/generate.sh +++ b/generate.sh @@ -1,8 +1,10 @@ #!/bin/bash -: ${SRC_DIR:=$PWD/src} +: ${SRC:=$PWD/src} +: ${HEADER:=$PWD/html/header.html} +: ${FOOTER:=$PWD/html/footer.html} : ${GEN_DIR:=./website} -: ${META_FILE:=meta.tsv} # Relative to SRC_DIR +: ${META_FILE:=meta.tsv} # Relative to SRC # 0 Fix hardlinks {{{ while read -r folder @@ -13,7 +15,7 @@ ln "$folder.du" "$folder/index.du" fi done << EOF -$(find "$SRC_DIR" -maxdepth 1 -type d) +$(find "$SRC" -maxdepth 1 -type d) EOF if [ ! "src/favicon.ico" -ef "src/img/favicon.ico" ] then @@ -24,22 +26,25 @@ EOF # }}} # 1. Dunbar source to HTML {{{ mkdir -p "$GEN_DIR" - cp -a "$SRC_DIR/." "$GEN_DIR" + cp -a "$SRC/." "$GEN_DIR" rm "$GEN_DIR/$META_FILE" "$GEN_DIR/."* - META="$SRC_DIR/$META_FILE" - export META GEN_DIR + META="$SRC/$META_FILE" + AWK="mawk" + export HEADER FOOTER META GEN_DIR AWK /usr/bin/env dash ./dunbar/dunbar_awk/dunbar.sh html \ - -o . \ - -e ./ext/meta.awk -e ./ext/attention.awk \ + -i \ + -e ./ext/attention.awk \ -e ./ext/heading-anchors.awk -e ./ext/pagenav.awk \ -e ./ext/icons.awk -e ./ext/presentation.awk \ - -e ./ext/contents.awk \ + -e ./ext/contents.awk -e ./ext/teaching.awk \ -wo \ - -he ./ext/header.du.html -fo ./ext/footer.du.html \ $(find "$GEN_DIR" -type f -name "*.du") # }}} +# 2. Meta handling {{{ + awk -f meta.awk $(find "$GEN_DIR" -type f -name "*.html") +# }}} # 2. Tiny version, strip away styles and other stuff {{{ # TODO # }}} |