mjestecko/compile.sh
2024-02-23 23:29:42 +05:00

46 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set +e
# Settings:
# =========
export CC=cc
export URL=https://mjestecko.neocities.org
mkdir -p ./html/articles
./tools/main_page_generator.py ./articles | ./tools/mmd/build/multimarkdown > ./html/index.html
for d in ./articles/*/; do
if [ -d "$d" ]; then
if test -f "$d/make"; then
("$d/make")
fi
if test -d "$d/.dynamic"; then
mkdir -p "./html/articles/$(basename -- $d)"
cp -r "$d/.dynamic/." "./html/articles/$(basename -- $d)/"
fi
if test -d "$d/.static"; then
mkdir -p "./html/articles/$(basename -- $d)"
cp -r "$d/.static/." "./html/articles/$(basename -- $d)/"
fi
./tools/article_wrapper.py "$d/page.mmd" $URL | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
fi
done
mkdir -p "./html/tags/"
./tools/tag_listing_generator.py ./articles/ ./html/ | ./tools/mmd/build/multimarkdown > "./html/tags.html"
for f in ./html/tags/*.html; do
echo $(cat "$f" | ./tools/mmd/build/multimarkdown) > "$f"
done
./tools/feed_generator.py ./articles/ $URL > ./html/feed.xml
mkdir -p "./html/markdown/"
for d in ./articles/*/; do
if [ -d "$d" ]; then
cp "$d/page.mmd" "./html/markdown/$(basename $d).mdd"
fi
done