Files
NoteNextra-origin/distribute/prebuild.sh
Trance-0 7091378d35 updates?
2025-11-24 15:42:04 -06:00

29 lines
731 B
Bash

# This is pre-build script that cleans up resources and compiles for selected pages, then finally you may combine those subdirectories into one via nginx.
export KEEP_PAGES="Math3200"
echo "Currently compiling pages: ${KEEP_PAGES}"
# Rewrite base _meta.js and next.config.js for export pages
echo "Rewrite base _meta.js and keeping ${KEEP_PAGES}"
cp ./${KEEP_PAGES}/_meta.js ../content/_meta.js
# remove other subdirectories
for dir in ../content/; do
if [ "$dir" != "${KEEP_PAGES}/" ]; then
rm -rf $dir
fi
done
# remove public directory
for dir in ../public/; do
if [ "$dir" != "${KEEP_PAGES}/" ]; then
rm -rf $dir
fi
done
echo "Done clearing up resources and compiling for ${KEEP_PAGES}"