set -euo pipefail
USAGE=$(
- echo "Usage: $0 <HUGO_ROOT> [--base <path>] [ [ --current [<url>]] | [--archived [<url>] [--canonical <url>]] ]";
+ echo "Usage: $0 <HUGO_ROOT> [--base <path>] [--project <name>][ [ --current [<url>]] | [--archived [<url>] [--canonical <url>]] ]";
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 of the maven-project).
+ artifact-id and the version (Default: "/").
--current : [DEFAULT]
Sets "url: /<url>/<path_in_site>", "params.current=true"
and "params.canonical = <url>/<path_in_site>" in
HUGO_ROOT="${1%%/}"
shift
+PROJECT=""
CURRENT=0
ARCHIVED=0
URL=""
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 ]]
--canonical)
if [[ $# -lt 2 ]]
then
- echo "ERROR -- Parameter for --project is missing!"
+ echo "ERROR -- Parameter for --canonical is missing!"
exit 1
fi
CANONICAL="${2%%/}"
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 "$URL" ]]