From: Kai Moritz Date: Mon, 15 Jun 2026 18:27:00 +0000 (+0000) Subject: Add import-in-astro.sh for importing Maven site output into Astro X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=1e158b10c43ca9adf8fa026521883b93597deda1;p=maven-thymeleaf-skin Add import-in-astro.sh for importing Maven site output into Astro Replaces import-in-hugo.sh for the new Astro-based website. Key differences vs. the Hugo version: - Content → src/content/projects/PROJECT/VERSION/ (HTML + YAML frontmatter) - Routing → src/pages/PROJECT/ (current) or src/pages/projects/P/V/ (archived) - Static → public/projects/PROJECT/VERSION/ - No Hugo shortcode transformation for
 blocks
- Relative generated-doc dir links (apidocs/, xref/ etc.) are rewritten
  to absolute /projects/X/Y/DIR/index.html URLs, because these dirs always
  live under /projects/ regardless of whether the content page is served
  from the visible (//) or archived (/projects/X/Y/) URL

Co-Authored-By: Claude Sonnet 4.6 
---

diff --git a/src/main/resources/import-in-astro.sh b/src/main/resources/import-in-astro.sh
new file mode 100755
index 0000000..942504e
--- /dev/null
+++ b/src/main/resources/import-in-astro.sh
@@ -0,0 +1,236 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+USAGE=$(
+  echo "Usage: $0  [--project ] [ [--current []] | [--archived [] [--canonical ]] ]";
+  cat << EOF
+
+  Imports a Maven site generated with the sili-skin into an Astro project.
+  Run this script from the Maven site output directory (where index.html lives).
+
+--project   : Overrides the project name used for URL and directory paths
+              (Default: artifactId from the Maven project metadata).
+--current   : [DEFAULT]
+              Marks this version as the current (visible) release.
+              Content URL: //page.html
+              Routing:     src/pages//
+              If  is given, it overrides the URL base (default: //).
+--archived  : Marks this version as archived/snapshot (not visible by default).
+              Content URL: /projects///page.html
+              Routing:     src/pages/projects///
+              params.canonical points to the corresponding page of the current version.
+              If  is given, it overrides the URL base.
+--canonical : Explicitly sets the canonical URL base for --archived mode.
+              Default: /
+              Only valid with --archived.
+EOF
+)
+
+if [ $# -lt 1 ]; then
+  echo "$USAGE"
+  exit 1
+fi
+
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+
+ASTRO_ROOT="${1%%/}"
+shift
+
+PROJECT=""
+CURRENT=0
+ARCHIVED=0
+URL_BASE=""
+CANONICAL=""
+
+command -v jq >/dev/null 2>&1 || { echo "ERROR -- jq is required"; exit 1; }
+
+if [[ ! -f "$ASTRO_ROOT/package.json" ]]; then
+  echo "ERROR -- $ASTRO_ROOT does not look like an Astro project root (no package.json found)"
+  exit 1
+fi
+
+JSON=$(sed -n '/