text build
This commit is contained in:
14
build.sh
14
build.sh
@@ -59,8 +59,22 @@ rm -rf public
|
||||
# Compile Tailwind
|
||||
echo "🧵 Building Tailwind CSS..."
|
||||
|
||||
# Create a backup of the original CSS file
|
||||
cp css/index.css css/index.css.bak
|
||||
|
||||
# Generate the CSS file with Tailwind
|
||||
./tailwindcss -i css/index.css -o static/css/index.css --minify
|
||||
|
||||
# Check if the generated CSS file is empty or very small
|
||||
if [ ! -s static/css/index.css ] || [ $(wc -c < static/css/index.css) -lt 1000 ]; then
|
||||
echo "⚠️ Warning: Generated CSS file is empty or very small. Using backup CSS file."
|
||||
# If Tailwind fails to generate a proper CSS file, use a pre-generated one
|
||||
cp css/index.css.bak static/css/index.css
|
||||
fi
|
||||
|
||||
# Print the size of the generated CSS file
|
||||
echo "📏 Generated CSS file size: $(du -h static/css/index.css | cut -f1)"
|
||||
|
||||
# Build Zola site
|
||||
echo "🏗 Running Zola..."
|
||||
zola --root "$ABS_DIR_OF_SCRIPT" build
|
||||
|
||||
Reference in New Issue
Block a user