From: Kai Moritz Date: Wed, 22 Apr 2026 08:30:15 +0000 (+0200) Subject: `import-in-hugo.sh` renders current vs. archived X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=054508bf78126a4e1ccf02e38743e3557a45628b;p=maven-thymeleaf-skin `import-in-hugo.sh` renders current vs. archived --- diff --git a/src/main/resources/import-in-hugo.sh b/src/main/resources/import-in-hugo.sh index 50759ef..ee63d30 100755 --- a/src/main/resources/import-in-hugo.sh +++ b/src/main/resources/import-in-hugo.sh @@ -1,25 +1,88 @@ #!/usr/bin/env bash set -euo pipefail -if [ "$#" -lt 1 ] +if [ $# -lt 1 ] then - echo "Usage: import-in-hugo.sh []" + echo "Usage: $0 [ --current []] | --archived ] [--canonical ]" + echo + echo "--current : [DEFAULT] specifies the path inside the hugo-project" + echo " if the path is omitted, the artifact-id is used as path" + echo "--archived : specifies the base-path for an archived version" + echo " the artifact-id and the version are added to the path" + echo "--canonical: specifies the path for canonical links in front-matter" exit 1 fi SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -HUGO_ROOT="$1" -if [ "$#" -eq 2 ] -then - PATH_IN_HUGO_CONTENT="$2/" -else - PATH_IN_HUGO_CONTENT="" -fi +HUGO_ROOT="${1%%/}" +shift +CANONICAL_PATH="" +CURRENT=1 +CANONICAL=0 -command -v jq >/dev/null 2>&1 || { echo "jq is required"; exit 1; } +command -v jq >/dev/null 2>&1 || { echo "ERROR -- jq is required"; exit 1; } JSON=$(sed -n '/