put back the old script
This commit is contained in:
40
build.sh
40
build.sh
@@ -1,26 +1,46 @@
|
|||||||
#/bin/bash
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
||||||
cd ${BASE_DIR}
|
|
||||||
|
|
||||||
|
|
||||||
echo "Starting build..."
|
echo "Starting build..."
|
||||||
|
|
||||||
hero installers -n zola
|
# TODO: Check if current version is latest to avoid redundant installation
|
||||||
|
if [[ -f "tailwindcss" ]]
|
||||||
|
then
|
||||||
|
echo "Tailwind installed"
|
||||||
|
else
|
||||||
|
# rm tailwindcss
|
||||||
|
# checks os and architecture for correct release
|
||||||
|
# https://stackoverflow.com/a/8597411
|
||||||
|
echo "Installing & building tailwind..."
|
||||||
|
ASSET="tailwindcss"
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
|
ASSET="$ASSET-linux"
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
ASSET="$ASSET-macos"
|
||||||
|
fi
|
||||||
|
if [[ "$(uname -m)" == "x86_64"* ]]; then
|
||||||
|
ASSET="$ASSET-x64"
|
||||||
|
elif [[ "$(uname -m)" == "arm64"* ]]; then
|
||||||
|
ASSET="$ASSET-arm64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/${ASSET}"
|
||||||
|
chmod +x $ASSET
|
||||||
|
mv $ASSET tailwindcss
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# initialized and configures tailwind if not configured
|
# initialized and configures tailwind if not configured
|
||||||
echo "Initializing tailwind..."
|
echo "Initializing tailwind..."
|
||||||
if [[ ! -f "tailwind.config.js" ]]
|
if [[ ! -f "tailwind.config.js" ]]
|
||||||
then
|
then
|
||||||
tailwindcss init
|
./tailwindcss init
|
||||||
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
|
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# compiles tailwind css for prod & builds project
|
# compiles tailwind css for prod & builds project
|
||||||
echo "Compiling tailwindcss and building zola project..."
|
echo "Compiling tailwindcss and building zola project..."
|
||||||
rm -rf public static/css
|
rm -rf public static/css
|
||||||
tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||||
zola build
|
zola build
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
# The URL the site will be built for
|
# The URL the site will be built for
|
||||||
# base_url = "https://dev.threefold.io"
|
# base_url = "https://dev.threefold.io"
|
||||||
base_url = "http://localhost:1111"
|
|
||||||
# Change this to your own URL! Please note this variable **must** be uncommented .
|
# Change this to your own URL! Please note this variable **must** be uncommented .
|
||||||
|
|
||||||
title = "ThreeFold"
|
title = "ThreeFold"
|
||||||
|
|||||||
52
start.sh
52
start.sh
@@ -1,30 +1,48 @@
|
|||||||
#/bin/bash
|
set +ex
|
||||||
set -ex
|
# Check if tailwindcss is already installed
|
||||||
|
if command -v tailwindcss &> /dev/null; then
|
||||||
|
echo "tailwindcss is already installed."
|
||||||
|
else
|
||||||
|
# checks OS and architecture for correct release
|
||||||
|
echo "Installing & building tailwind..."
|
||||||
|
|
||||||
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
ASSET="tailwindcss"
|
||||||
cd ${BASE_DIR}
|
|
||||||
|
|
||||||
hero installers -n zola
|
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
|
ASSET="$ASSET-linux"
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
ASSET="$ASSET-macos"
|
||||||
|
fi
|
||||||
|
if [[ "$(uname -m)" == "x86_64"* ]]; then
|
||||||
|
ASSET="$ASSET-x64"
|
||||||
|
elif [[ "$(uname -m)" == "arm64"* ]]; then
|
||||||
|
ASSET="$ASSET-arm64"
|
||||||
|
fi
|
||||||
|
pushd /tmp
|
||||||
|
curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/${ASSET}"
|
||||||
|
chmod +x $ASSET
|
||||||
|
mv $ASSET /usr/local/bin/tailwindcss
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
source ./env.sh
|
||||||
# initialized and configures tailwind if not configured
|
# initialized and configures tailwind if not configured
|
||||||
if [ ! -f "tailwind.config.js" ]
|
if [ ! -f "tailwind.config.js" ]
|
||||||
then
|
then
|
||||||
tailwindcss init
|
./tailwindcss init
|
||||||
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
|
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# compiles tailwind css & launches locally
|
# compiles tailwind css & launches locally
|
||||||
rm -rf public static/css
|
# rm -rf public static/css
|
||||||
tailwindcss -i css/index.css -o ./static/css/index.css --watch & zola serve &
|
# ./tailwindcss -i css/index.css -o ./static/css/index.css --watch
|
||||||
|
# zola serve &
|
||||||
# compiles tailwind css for prod & builds project
|
# compiles tailwind css for prod & builds project
|
||||||
tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
# ./tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||||
|
# zola build
|
||||||
killall zola
|
|
||||||
|
|
||||||
zola serve
|
|
||||||
|
|
||||||
# # kills zola and tw bg processes on interrupt
|
# # kills zola and tw bg processes on interrupt
|
||||||
# trap 'kill $(jobs -p); exit 1' INT
|
# trap 'kill $(jobs -p); exit 1' INT
|
||||||
# wait
|
# wait
|
||||||
|
rm -rf public static/css
|
||||||
|
tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||||
|
zola build -o ~/Documents/web/$NAME/
|
||||||
|
open ~/Documents/web/$NAME/index.html
|
||||||
Reference in New Issue
Block a user