aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cmc.pub>2025-03-20 22:25:41 -0500
committerChristian Cleberg <hello@cmc.pub>2025-03-20 22:25:41 -0500
commit28f8b61032c390ef1b781bb56f17cdedd6417148 (patch)
tree3e685d16507e5e4fd2010383602c2e7bf50fe5c2
parentaff8a6e68fdb48da6744f775ce2af72f74252299 (diff)
downloadcleberg.net-28f8b61032c390ef1b781bb56f17cdedd6417148.tar.gz
cleberg.net-28f8b61032c390ef1b781bb56f17cdedd6417148.tar.bz2
cleberg.net-28f8b61032c390ef1b781bb56f17cdedd6417148.zip
minify css before building site
-rwxr-xr-xbuild.sh26
1 files changed, 13 insertions, 13 deletions
diff --git a/build.sh b/build.sh
index aabf154..537954a 100755
--- a/build.sh
+++ b/build.sh
@@ -9,10 +9,10 @@ if [[ "$answer" =~ ^[Yy]$ ]]; then
# Check if the environment flag is set to PROD
if [[ "$ENV" == "prod" ]]; then
echo "Environment: Production"
-
+
# Check if publishing via LAN or remotely
printf "Publishing on remote or LAN? [r|l] "
-
+
# Update ubuntu_server variable based on answer
read method
if [[ "$method" =~ ^[Rr]$ ]]; then
@@ -23,30 +23,30 @@ if [[ "$answer" =~ ^[Yy]$ ]]; then
echo "Invalid input. Assuming LAN (ubuntu)"
ubuntu_server="ubuntu"
fi
-
+
# Remove previous build
rm -rf .build/*
-
- # Run publishing script
- emacs --script publish.el &>/dev/null
-
+
# Minify CSS
minify -o theme/static/styles.min.css theme/static/styles.css
-
+
+ # Run publishing script
+ emacs --script publish.el &>/dev/null
+
# Deploy changes
rsync -r --delete-before .build/* $ubuntu_server:/var/www/cmc.pub/
else
echo "Environment: Development"
-
+
# Remove previous build
rm -rf .build/*
-
- # Run publishing script
- emacs --script publish.el
-
+
# Minify CSS
minify -o theme/static/styles.min.css theme/static/styles.css
+ # Run publishing script
+ emacs --script publish.el
+
# Launch development web server
cd .build/
python3 -m http.server