2024-02-16 11:53:21 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-05-22 09:11:10 +00:00
|
|
|
|
2023-05-22 13:30:16 +00:00
|
|
|
set +e
|
|
|
|
|
2024-02-16 11:47:50 +00:00
|
|
|
# Settings:
|
|
|
|
# =========
|
|
|
|
export CC=cc
|
2024-02-16 11:53:21 +00:00
|
|
|
export URL=https://mjestecko.neocities.org
|
2024-02-16 11:47:50 +00:00
|
|
|
|
2023-05-22 09:11:10 +00:00
|
|
|
mkdir -p ./html/articles
|
|
|
|
|
|
|
|
./tools/main_page_generator.py ./articles | ./tools/mmd/build/multimarkdown > ./html/index.html
|
|
|
|
|
2023-05-25 14:06:05 +00:00
|
|
|
for d in ./articles/*/; do
|
2023-05-22 09:11:10 +00:00
|
|
|
if [ -d "$d" ]; then
|
2023-05-25 14:06:05 +00:00
|
|
|
if test -f "$d/make"; then
|
2024-02-16 11:47:50 +00:00
|
|
|
("$d/make")
|
2023-05-25 14:06:05 +00:00
|
|
|
fi
|
|
|
|
if test -d "$d/.dynamic"; then
|
|
|
|
mkdir -p "./html/articles/$(basename -- $d)"
|
|
|
|
cp -r "$d/.dynamic/." "./html/articles/$(basename -- $d)/"
|
|
|
|
fi
|
2023-05-25 18:45:44 +00:00
|
|
|
if test -d "$d/.static"; then
|
|
|
|
mkdir -p "./html/articles/$(basename -- $d)"
|
|
|
|
cp -r "$d/.static/." "./html/articles/$(basename -- $d)/"
|
|
|
|
fi
|
2024-02-16 11:53:21 +00:00
|
|
|
./tools/article_wrapper.py "$d/page.mmd" $URL | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html"
|
2023-05-22 09:11:10 +00:00
|
|
|
fi
|
|
|
|
done
|
2023-05-22 13:29:20 +00:00
|
|
|
|
2024-02-16 13:29:50 +00:00
|
|
|
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
|
|
|
|
|
2024-02-16 11:53:21 +00:00
|
|
|
./tools/feed_generator.py ./articles/ $URL > ./html/feed.xml
|