This commit is contained in:
Ehab Hassan 2022-08-11 16:01:47 +02:00
parent 634aae9963
commit 832af9305b
5 changed files with 52 additions and 15 deletions

View File

@ -1,7 +1,44 @@
rm -rf build
# rm -rf public
npm run prod:build
rsync -rav static/ public/
echo 'see http://localhost:3000/'
node -e '(e=require("express"))().use(e.static("public")).listen(3000)'
echo "Starting build..."
# TODO: Check if current version is latest to avoid redundant installation
if [[ -f "tailwindcss" ]]
then
rm tailwindcss
fi
# 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
# initialized and configures tailwind if not configured
echo "Initializing tailwind..."
if [[ ! -f "tailwind.config.js" ]]
then
./tailwindcss init
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
fi
# compiles tailwind css for prod & builds project
echo "Compiling tailwindcss and building zola project..."
rm -rf public static/css
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
zola build

View File

@ -55,19 +55,19 @@ smart_punctuation = true
name = "categories"
feed = true
paginate_by = 2
paginate_path = "/blog-posts"
paginate_path = "blog-posts"
[[taxonomies]]
name = "roles"
feed = true
paginate_by = 2
paginate_path = "/join-us"
paginate_path = "join-us"
[[taxonomies]]
name = "tags"
feed = true
paginate_by = 2
paginate_path = "/join-us"
paginate_path = "join-us"
[extra]
# Put all your custom variables here

View File

@ -10,6 +10,6 @@ extra:
- [HOME]("/")
- [BLOGS]("/blog")
- [USE CASES]("/")
- [USE CASES]("/use-cases")
- [TECH]("/")
- [GET IN TOUCH]("mailto:info@ourverse.tf")

View File

@ -1,22 +1,22 @@
# builds if executable isn't foound
if [ ! -f "tailwindcss" ]
if [[ ! -f "tailwindcss" ]]
then
sh build.sh
fi
# initialized and configures tailwind if not configured
if [ ! -f "tailwind.config.js" ]
if [[ ! -f "tailwind.config.js" ]]
then
tailwindcss init
./tailwindcss init
sed -i '' "s| content: \\[\\],| content: \\['./templates/**/*.html'\\],|g" tailwind.config.js
fi
# compiles tailwind css & launches locally
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
tailwindcss -i css/index.css -o ./static/css/index.css --minify
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
zola build
# kills zola and tw bg processes on interrupt

BIN
tailwindcss Executable file

Binary file not shown.