From: Kai Moritz Date: Sun, 3 May 2026 09:08:53 +0000 (+0200) Subject: Added a switch to overwrite the artifact-id X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=7a23dac2ec5fe85a6049870e92bddce8d1721706;p=maven-thymeleaf-skin Added a switch to overwrite the artifact-id --- diff --git a/src/main/resources/import-in-hugo.sh b/src/main/resources/import-in-hugo.sh index e3b8fe7..1ff2c34 100644 --- a/src/main/resources/import-in-hugo.sh +++ b/src/main/resources/import-in-hugo.sh @@ -2,13 +2,16 @@ set -euo pipefail USAGE=$( - echo "Usage: $0 [--base ] [--separator ] [ [ --current []] | [--archived []] ]"; + echo "Usage: $0 [--base ] [--project ] [--separator ] [ [ --current []] | [--archived []] ]"; cat << EOF --base : Specifies the base-path for the rendered site. If not specifed, the site is rendered as a root section. The artifact-id and the version are always added to the path. +--project : Specifies the name of the project for path and url + (Default: ). + artifact-id and the version (Default: "/"). --current : [DEFAULT] Adds "url: //" to front-matter. If "" is not specified, "//" @@ -33,6 +36,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) HUGO_ROOT="${1%%/}" shift +PROJECT="" CURRENT=0 ARCHIVED=0 CANONICAL="" @@ -59,6 +63,16 @@ while [[ $# -gt 0 ]]; do fi shift 2 ;; + --project) + if [[ $# -lt 2 ]] + then + echo "ERROR -- Parameter for --project is missing!" + exit 1 + fi + PROJECT="${2%%/}" + PROJECT="${PROJECT##/}" + shift 2 + ;; --current) CURRENT=1 if [[ $# -lt 2 ]] @@ -106,7 +120,10 @@ fi echo "$JSON" | jq -C . -PROJECT=$(echo "$JSON" | jq -r '.artifactId') +if [[ -z "$PROJECT" ]] +then + PROJECT=$(echo "$JSON" | jq -r '.artifactId') +fi VERSION=$(echo "$JSON" | jq -r '.version') if [[ -n "$CANONICAL" ]]