diff --git a/build.sh b/build.sh index da22f93..3e11e8e 100755 --- a/build.sh +++ b/build.sh @@ -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 + diff --git a/config.toml b/config.toml index 223393e..391be21 100644 --- a/config.toml +++ b/config.toml @@ -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 diff --git a/content/header/_index.md b/content/header/_index.md index 283c89c..ad61dfb 100644 --- a/content/header/_index.md +++ b/content/header/_index.md @@ -10,6 +10,6 @@ extra: - [HOME]("/") - [BLOGS]("/blog") -- [USE CASES]("/") +- [USE CASES]("/use-cases") - [TECH]("/") - [GET IN TOUCH]("mailto:info@ourverse.tf") diff --git a/start.sh b/start.sh index c0d36a0..ac927fd 100755 --- a/start.sh +++ b/start.sh @@ -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 diff --git a/tailwindcss b/tailwindcss new file mode 100755 index 0000000..0393f83 Binary files /dev/null and b/tailwindcss differ