diff --git a/build.sh b/build.sh index 670ff80..e13c72e 100755 --- a/build.sh +++ b/build.sh @@ -1,34 +1,33 @@ +PREFIX="mycelium" + echo "Starting build..." SOURCE=${BASH_SOURCE[0]} DIR_OF_THIS_SCRIPT="$( dirname "$SOURCE" )" ABS_DIR_OF_SCRIPT="$( realpath $DIR_OF_THIS_SCRIPT )" -# TODO: Check if current version is latest to avoid redundant installation -if [[ -f "tailwindcss" ]] -then - rm tailwindcss -fi +# Check if tailwindcss executable exists, if not, download and install it +if [[ ! -f "tailwindcss" ]]; then + echo "Installing & building tailwind..." + ASSET="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 -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - ASSET="$ASSET-linux" -elif [[ "$OSTYPE" == "darwin"* ]]; then - ASSET="$ASSET-macos" + curl -sLO "https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/${ASSET}" + chmod +x $ASSET + mv $ASSET tailwindcss +else + echo "tailwindcss already exists, skipping installation." 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/download/v3.4.17/${ASSET}" -chmod +x $ASSET -mv $ASSET tailwindcss # initialized and configures tailwind if not configured @@ -43,6 +42,15 @@ fi echo "Compiling tailwindcss and building zola project..." rm -rf public static/css ./tailwindcss -i css/index.css -o ./static/css/index.css --minify -zola --root $ABS_DIR_OF_SCRIPT build -rsync -rav --delete public/ ${HOME}/hero/var/www/mycelium/ \ No newline at end of file + +# echo "Building without prefix..." +# sed 's|base_url = "BASEURL"|base_url = "https://www.mycelium.threefold.io/"|' config.templ.toml > config.toml +# zola --root $ABS_DIR_OF_SCRIPT build +# rsync -avz --delete public/ "root@threefold.info:/root/hero/www/info/$PREFIX/" + +echo "Building with prefix: /$PREFIX/" +sed 's|base_url = "BASEURL"|base_url = "/mycelium/"|' config.templ.toml > config.toml +zola --root $ABS_DIR_OF_SCRIPT build +rsync -rav --delete public/ "${HOME}/hero/var/www/$PREFIX/" +rsync -avz --delete public/ "root@threefold.info:/root/hero/www/info/$PREFIX/" diff --git a/config.templ.toml b/config.templ.toml new file mode 100644 index 0000000..0cc2756 --- /dev/null +++ b/config.templ.toml @@ -0,0 +1,99 @@ +# The URL the site will be built for +base_url = "BASEURL" + +title = "Mycelium" +description = "Our global digital backbone" + +# When set to "true", a feed is automatically generated. +# generate_feed = true + +# The filename to use for the feed. Used as the template filename, too. +# Defaults to "atom.xml", which has a built-in template that renders an Atom 1.0 feed. +# There is also a built-in template "rss.xml" that renders an RSS 2.0 feed. +# feed_filename = "atom.xml" + +# The number of articles to include in the feed. All items are included if +# this limit is not set (the default). +# feed_limit = 10 + +# Whether to automatically compile all Sass files in the sass directory +compile_sass = false + +# When set to "true", the generated HTML files are minified. +# minify_html = true +# I'm keeping off for now -- buggy -- 2021-02-05 (@keats says it'll be fixed 0.14.0) + +# Whether to build a search index to be used later on by a JavaScript library +build_search_index = false + +[markdown] +# Whether to do syntax highlighting +# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola +highlight_code = true +highlight_theme = "visual-studio-dark" + +# When set to "true", emoji aliases translated to their corresponding +# Unicode emoji equivalent in the rendered Markdown files. (e.g.: :smile: => 😄) +render_emoji = false + +# Whether external links are to be opened in a new tab +# If this is true, a `rel="noopener"` will always automatically be added for security reasons +# external_links_target_blank = false + +# Whether to set rel="nofollow" for all external links +external_links_no_follow = true + +# Whether to set rel="noreferrer" for all external links +external_links_no_referrer = true + +# Whether smart punctuation is enabled (changing quotes, dashes, dots in their typographic form) +# For example, `...` into `…`, `"quote"` into `“curly”` etc +smart_punctuation = true + +#[build] +#not_found = "404.md" + +[[taxonomies]] +name = "categories" +feed = true +paginate_by = 6 +paginate_path = "blog-posts" + +[[taxonomies]] +name = "partners-category" +feed = true +paginate_by = 6 +paginate_path = "partner-card" + +[[taxonomies]] +name = "news-category" +feed = true +paginate_by = 6 +paginate_path = "news-card" + +[[taxonomies]] +name = "roles" +feed = true +paginate_by = 2 +paginate_path = "join-us" + +[[taxonomies]] +name = "tags" +feed = true +paginate_by = 9 +paginate_path = "tags" + +[[taxonomies]] +name = "people" +feed = false +paginate_by = 9 +paginate_path = "people" + +[[taxonomies]] +name = "memberships" +feed = false +paginate_by = 8 +paginate_path = "people/memberships" + +[extra] +# Put all your custom variables here diff --git a/config.toml b/config.toml index 39b5ecd..d86dca9 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,5 @@ # The URL the site will be built for -base_url = "https://www2.mycelium.threefold.io/" -# Change this to your own URL! Please note this variable **must** be uncommented . +base_url = "/mycelium/" title = "Mycelium" description = "Our global digital backbone"