Merge branch 'development' of https://github.com/threefoldfoundation/www_threefold_io into development
This commit is contained in:
19
README.md
19
README.md
@@ -13,6 +13,7 @@ Staging: www2.threefold.io (development branch)
|
|||||||
Last Updated: May 2023
|
Last Updated: May 2023
|
||||||
|
|
||||||
## Administrators
|
## Administrators
|
||||||
|
|
||||||
[ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin)
|
[ThreeFold's Web Admins](https://github.com/orgs/threefoldfoundation/teams/team_web_admin)
|
||||||
|
|
||||||
## Contribution Procedure
|
## Contribution Procedure
|
||||||
@@ -47,8 +48,22 @@ To do that, the following prerequisites are needed:
|
|||||||
|
|
||||||
Then clone the repository recursively to also pull in contents of `threefold_data`:
|
Then clone the repository recursively to also pull in contents of `threefold_data`:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
git clone --recursive https://github.com/threefoldfoundation/www_threefold_io.git
|
#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
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Now run `build.sh` to download Tailwind, build the CSS, and also build the site with Zola:
|
Now run `build.sh` to download Tailwind, build the CSS, and also build the site with Zola:
|
||||||
|
|||||||
40
build.sh
40
build.sh
@@ -1,46 +1,26 @@
|
|||||||
|
#/bin/bash
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
cd ${BASE_DIR}
|
||||||
|
|
||||||
|
|
||||||
echo "Starting build..."
|
echo "Starting build..."
|
||||||
|
|
||||||
# TODO: Check if current version is latest to avoid redundant installation
|
hero installers -n zola
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
18
start.sh
18
start.sh
@@ -1,22 +1,24 @@
|
|||||||
# builds if executable isn't foound
|
#/bin/bash
|
||||||
if [ ! -f "tailwindcss" ]
|
set -ex
|
||||||
then
|
|
||||||
sh build.sh
|
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
fi
|
cd ${BASE_DIR}
|
||||||
|
|
||||||
|
hero installers -n zola
|
||||||
|
|
||||||
# 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
|
zola build
|
||||||
|
|
||||||
# kills zola and tw bg processes on interrupt
|
# kills zola and tw bg processes on interrupt
|
||||||
|
|||||||
Reference in New Issue
Block a user