48 lines
1.1 KiB
Bash
Executable File
48 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
echo "🧹 Cleaning build folders..."
|
|
rm -rf public static/css
|
|
|
|
echo "⬇️ Downloading TailwindCSS CLI..."
|
|
if [[ -f "tailwindcss" ]]; then
|
|
rm tailwindcss
|
|
fi
|
|
|
|
ASSET="tailwindcss-linux-x64"
|
|
curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/${ASSET}"
|
|
mv ${ASSET} tailwindcss
|
|
chmod +x tailwindcss
|
|
|
|
# Ensure correct config
|
|
if [[ ! -f "tailwind.config.js" ]]; then
|
|
echo "⚙️ Creating tailwind.config.js"
|
|
echo "module.exports = {
|
|
content: ['./templates/**/*.html'],
|
|
theme: { extend: {} },
|
|
plugins: [],
|
|
}" > tailwind.config.js
|
|
fi
|
|
|
|
# Build Tailwind CSS
|
|
echo "🎨 Building Tailwind CSS..."
|
|
./tailwindcss -i css/index.css -o static/css/index.css --minify
|
|
|
|
if [[ ! -f "static/css/index.css" ]]; then
|
|
echo "❌ Tailwind CSS not generated."
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Tailwind CSS built at static/css/index.css"
|
|
|
|
# Build Zola site
|
|
echo "🏗 Building site with Zola..."
|
|
zola build
|
|
|
|
# Final check
|
|
if [[ -f "public/css/index.css" ]]; then
|
|
echo "✅ CSS successfully copied to public/"
|
|
else
|
|
echo "❌ CSS NOT copied to public/. Check Zola static settings."
|
|
fi
|