#!/bin/bash set -eo pipefail # Set locale to C.UTF-8 export "LANG=C.UTF-8" export "LC_LOCALE=${LANG}" # Create and cd into 'out' directory if [ -n "${LINKGEN_TRASH_OUT_DIR}" ]; then echo ":: Removing \"out\" directory" rm -rf out mkdir -p out elif [ ! -d "out" ]; then echo ":: Creating \"out\" directory" mkdir -p out fi cd out if [ -n "${LINKGEN_VERBOSE}" ]; then echo ":: Enabling verbose output" set -x fi # Function to generate a link function generate-link() { echo ":: Creating link '${1}' titled '${2}' redirecting to '${3}'" cp ../template.html "${1}.html" sed -i "s/\_TITLE\_/${2//\//\\/}/g" "${1}.html" sed -i "s/\_RDURL\_/${3//\//\\/}/g" "${1}.html" } if [ -z "${LINKGEN_NO_DEFAULT}" ]; then # LINKGEN_NO_DEFAULT is undefined, generate default links echo ":: Generating StarOpenSource's default links" # Index cat << EOF > index.html Redirecting to nowhere

Hello! You've landed on StarOpenSource's redirection website.

You can visit the source code for this website here.


Here are some links you can try out:

[website] [status] [/fs/] [repos]

EOF # Robots cat << EOF > robots.txt User-Agent: * Disallow: / EOF # General generate-link "website" "StarOpenSource's website" "https://staropensource.de" generate-link "status" "StarOpenSource Infrastructure Status" "https://status.staropensource.de" generate-link "filesystem" "StarOpenSource /fs/" "https://fs.staropensource.de" generate-link "git" "sos!git" "https://git.staropensource.de" generate-link "fedi" "sos!fly" "https://fly.staropensource.de" generate-link "piped" "sos!piped" "https://piped.staropensource.de" # Social generate-link "social-fedi" "StarOpenSource's fediverse profile" "https://fly.staropensource.de/@StarOpenSource" # Policies generate-link "constitution" "StarOpenSource's Project Constitution" "https://docs.staropensource.de/policies/constitution/" generate-link "tos" "StarOpenSource's General Terms of Service" "https://docs.staropensource.de/category/terms-of-service/" generate-link "tos-general" "StarOpenSource's General Terms of Service" "https://docs.staropensource.de/policies/tos/general/" generate-link "tos-git" "sos!git's Terms of Service" "https://docs.staropensource.de/policies/tos/git/" generate-link "tos-fedi" "sos!fly's Terms of Service" "https://docs.staropensource.de/policies/tos/fly/" # Repositories # -> Main generate-link "repos" "StarOpenSource's repositories" "https://docs.staropensource.de/projects/" generate-link "repos-engine" "StarOpenSource Engine repository" "https://git.staropensource.de/StarOpenSource/Engine" generate-link "repos-enginemc" "StarOpenSource Engine Minecraft port repository" "https://git.staropensource.de/StarOpenSource/EngineMC" generate-link "repos-bashutils" "bashutils repository" "https://git.staropensource.de/StarOpenSource/bashutils" # -> Infrastructure generate-link "repos-ciimage" "StarOpenSource's CI docker image" "https://git.staropensource.de/StarOpenSource-Infrastructure/actions-docker" generate-link "repos-redirector" "StarOpenSource's link redirector" "https://git.staropensource.de/StarOpenSource-Infrastructure/website-redirector" # -> Archived or unmaintained generate-link "repos-core" "CORE Framework repository" "https://git.staropensource.de/StarOpenSource/CORE" generate-link "repos-sui" "StarOpenSource UI repository" "https://git.staropensource.de/StarOpenSource/SUI" generate-link "repos-besseretests" "Bessere Tests repository" "https://git.staropensource.de/StarOpenSource/BessereTests" generate-link "repos-server-kernel" "StarOpenSource's server kernel repository" "https://git.staropensource.de/Archive/server-kernel" # Documentation generate-link "docs" "StarOpenSource's documentation" "https://docs.staropensource.de" generate-link "docs-engine" "StarOpenSource Engine documentation" "https://engine.staropensource.de" generate-link "docs-enginemc" "StarOpenSource EngineMC documentation" "https://git.staropensource.de/StarOpenSource/EngineMC/src/branch/develop/README.md" generate-link "docs-bashutils" "bashutils documentation" "https://bashutils.staropensource.de" generate-link "docs-core" "The CORE Framework documentation" "https://core.staropensource.de" generate-link "docs-sui" "StarOpenSource UI documentation" "https://sui.staropensource.de" # Specifications generate-link "spec" "StarOpenSource's specifications" "https://docs.staropensource.de/specifications/" generate-link "spec-versioning" "the StarOpenSource Versioning Specification" "https://docs.staropensource.de/specifications/versioning/about/" generate-link "spec-versioning-v1" "the 1st version of the StarOpenSource Versioning Specification" "https://docs.staropensource.de/specifications/versioning/versions/1/" generate-link "spec-versioning-v2" "the 2nd version of the StarOpenSource Versioning Specification" "https://docs.staropensource.de/specifications/versioning/versions/2/" generate-link "spec-logging" "the StarOpenSource Logging Specification" "https://docs.staropensource.de/specifications/logging/about/" generate-link "spec-logging-v1" "the 1st version of the StarOpenSource Logging Specification" "https://docs.staropensource.de/specifications/logging/versions/1/" generate-link "spec-logging-v2" "the 2nd version of the StarOpenSource Logging Specification" "https://docs.staropensource.de/specifications/logging/versions/2/" # Miscellaneous generate-link "join" "the joining guide" "https://docs.staropensource.de/joining/" else # LINKGEN_NO_DEFAULT is defined, generate custom link if [ -z "${3}" ]; then # Not enough arguments, display help echo ":: At least three arguments are required." echo " Usage: ./build.sh \ \ \" else # Enough arguments, generate link generate-link "${1}" "${2}" "${3}" fi fi