Files
NoteNextra-origin/distribute/prebuild.sh
Trance-0 d62bbff1f0 backup
2025-11-24 15:44:18 -06:00

33 lines
800 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}"
echo "modify next.config.js"
cp ./next.config.js ../next.config.js