Summary Files Commits Branches @commit @diff @stats
path: root / generate.sh
diff options
context:
space:
mode:
1 files changed, 20 insertions, 12 deletions
-rwxr-xr-xgenerate.sh32
diff --git a/generate.sh b/generate.sh
index 9f3c681..43023af 100755
--- a/generate.sh
+++ b/generate.sh
@@ -5,6 +5,24 @@
: ${GEN_TINY_FOLDER:=./website.tiny}
: ${AWK_FOLDER:=./awk-edits}
+# 0 Fix hardlinks {{{
+ while read -r folder
+ do
+ if [ -f "$folder.md" ] && [ ! "$folder.md" -ef "$folder/index.md" ]
+ then
+ rm "$folder/index.md" >/dev/null 2>&1
+ ln "$folder.md" "$folder/index.md"
+ fi
+ done << EOF
+$(find "$REPO_FOLDER/src" -maxdepth 1 -type d)
+EOF
+ if [ ! "src/favicon.ico" -ef "src/img/favicon.ico" ]
+ then
+ rm "src/favicon.ico" >/dev/null 2>&1
+ ln "src/img/favicon.ico" "src/favicon.ico"
+ fi
+ echo "[Stage 0] Fixed folder/index.md hardlinks"
+# }}}
# 1. Markdown source to HTML {{{
[ $# -eq 0 -a "$(id -u -n)" != "www-data" ] && echo "[Warning] Running in \"production\" by a user that isn't www-root!"
@@ -13,17 +31,7 @@
/usr/bin/env dash ./csg/csg "$REPO_FOLDER/src" "$GEN_FOLDER" '& \\&mdash; Syndamia' 'https://syndamia.com' "$AWK_FOLDER"
# }}}
-# 2. CSMA to CSS {{{
- echo "[Stage 3] CSMA"
- while read -r stylesheet
- do
- /usr/bin/env -S awk -f './csma/csmap.awk' "$stylesheet" > "${stylesheet:0: -4}css"
- rm "$stylesheet"
- done << EOF
-$(find "$GEN_FOLDER" -type f -name "*.csma")
-EOF
-# }}}
-# 3. Tiny version, strip away styles and other stuff {{{
+# 2. Tiny version, strip away styles and other stuff {{{
[ ! -d "$GEN_TINY_FOLDER" ] && mkdir "$GEN_TINY_FOLDER"
[ $# -eq 0 -a "$(stat -c %U "$GEN_TINY_FOLDER")" != "www-data" ] && echo "[Warning] Running in \"production\" while $GEN_TINY_FOLDER isn't owned by www-data!"
@@ -45,7 +53,7 @@ EOF
done
}
- echo "[Stage 4] Tiny website"
+ echo "[Stage 3] Tiny website"
if [ $# -eq 0 ]; then
improveForTINY