From e34603dc5061619c8e339c8d96062c312e7fdd31 Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 10:09:12 +0400 Subject: [PATCH 1/6] ... --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e0bf30b1..10d3f42f6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Staging: www2.threefold.io (development branch) Last Updated: May 2023 ## Administrators + [ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin) ## Contribution Procedure @@ -47,8 +48,13 @@ To do that, the following prerequisites are needed: Then clone the repository recursively to also pull in contents of `threefold_data`: -``` -git clone --recursive https://github.com/threefoldfoundation/www_threefold_io.git +```bash +#if you don't have hero installed yet, run the following commands +curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/install_hero.sh > /tmp/hero_install.sh +bash /tmp/hero_install.sh +#get this repo +hero git pull -u https://github.com/threefoldfoundation/www_threefold_io -b development -pr + ``` Now run `build.sh` to download Tailwind, build the CSS, and also build the site with Zola: From ebfb6843855299da4c0831c1289e75509bb9a6ae Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 10:20:51 +0400 Subject: [PATCH 2/6] ... --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 10d3f42f6..4e918a2c7 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,12 @@ Then clone the repository recursively to also pull in contents of `threefold_dat #if you don't have hero installed yet, run the following commands curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/install_hero.sh > /tmp/hero_install.sh bash /tmp/hero_install.sh -#get this repo + +#get this repo be careful --pr will remove all local changes hero git pull -u https://github.com/threefoldfoundation/www_threefold_io -b development -pr +#cd to the directory +eval $(git cd -u https://github.com/threefoldfoundation/www_threefold_io) + ``` From cee756c02dc2c183838da5354f8abc22a0d6271a Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 10:40:44 +0400 Subject: [PATCH 3/6] ... --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e918a2c7..c30657880 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,12 @@ Then clone the repository recursively to also pull in contents of `threefold_dat curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/install_hero.sh > /tmp/hero_install.sh bash /tmp/hero_install.sh -#get this repo be careful --pr will remove all local changes +#get this repo be careful --pr will remove all local changes (pull reset) hero git pull -u https://github.com/threefoldfoundation/www_threefold_io -b development -pr + #cd to the directory -eval $(git cd -u https://github.com/threefoldfoundation/www_threefold_io) +eval $(hero git cd -u https://github.com/threefoldfoundation/www_threefold_io) + ``` From f1f1092e2d967f2ac8a2f23f1ddcd545fb1de4a8 Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 11:25:27 +0400 Subject: [PATCH 4/6] ... --- .gitignore | 1 + README.md | 7 +++++-- build.sh | 36 ++++++------------------------------ start.sh | 15 +++++++-------- 4 files changed, 19 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 415604bf8..80c0ca7f1 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ install* public static/css tailwindcss +tailwindcss* \ No newline at end of file diff --git a/README.md b/README.md index c30657880..5651b7cf6 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,16 @@ Then clone the repository recursively to also pull in contents of `threefold_dat curl https://raw.githubusercontent.com/freeflowuniverse/crystallib/development/scripts/install_hero.sh > /tmp/hero_install.sh bash /tmp/hero_install.sh -#get this repo be careful --pr will remove all local changes (pull reset) +#install zola & tailwind +hero installers -n zola + +#get this repo be careful --pr will remove all local changes (pull reset), -b development means we are on the development branch hero git pull -u https://github.com/threefoldfoundation/www_threefold_io -b development -pr #cd to the directory eval $(hero git cd -u https://github.com/threefoldfoundation/www_threefold_io) - +bash build.sh ``` diff --git a/build.sh b/build.sh index d4e42ff48..51ae957b2 100755 --- a/build.sh +++ b/build.sh @@ -1,46 +1,22 @@ +#/bin/bash +set -ex + echo "Starting build..." -# 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 - - +hero installers -n zola # initialized and configures tailwind if not configured echo "Initializing tailwind..." 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 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 +tailwindcss -i css/index.css -o ./static/css/index.css --minify zola build diff --git a/start.sh b/start.sh index 4a8094af7..ef6e714bb 100755 --- a/start.sh +++ b/start.sh @@ -1,22 +1,21 @@ -# builds if executable isn't foound -if [ ! -f "tailwindcss" ] -then - sh build.sh -fi +#/bin/bash +set -ex + +hero installers -n zola # initialized and configures tailwind if not configured 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 From 5ca148abd9f5390340116ebecd8bf4fb318e28d6 Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 11:25:50 +0400 Subject: [PATCH 5/6] ... --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 80c0ca7f1..415604bf8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,3 @@ install* public static/css tailwindcss -tailwindcss* \ No newline at end of file From dc1ab5a37658dc2ef073133f2a25f5ade07efe40 Mon Sep 17 00:00:00 2001 From: despiegk Date: Thu, 19 Sep 2024 11:29:43 +0400 Subject: [PATCH 6/6] ... --- build.sh | 4 ++++ start.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/build.sh b/build.sh index 51ae957b2..ce2bbbe51 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,10 @@ #/bin/bash set -ex +BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd ${BASE_DIR} + + echo "Starting build..." hero installers -n zola diff --git a/start.sh b/start.sh index ef6e714bb..4d1fa66f1 100755 --- a/start.sh +++ b/start.sh @@ -1,6 +1,9 @@ #/bin/bash set -ex +BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +cd ${BASE_DIR} + hero installers -n zola # initialized and configures tailwind if not configured