]> juplo.de Git - maven-thymeleaf-skin/commitdiff
import-in-astro.sh: description aus stili-json ins Frontmatter schreiben
authorKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 16 Oct 2026 08:46:21 +0000 (08:46 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Fri, 16 Oct 2026 08:46:21 +0000 (08:46 +0000)
Für die Einstiegsseite (index.html → _index.html) wird das Feld
`description` aus dem stili-json extrahiert und — sofern vorhanden —
als top-level-Frontmatter-Feld `description:` in die Content-Datei
geschrieben. Für alle anderen Seiten bleibt das Feld leer/weggelassen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/main/resources/import-in-astro.sh

index 0c973c023adcdc1d47201a000a98e55f08150f68..86433a9d74d4e22dfa41e67e5c4df71b79fb419f 100755 (executable)
@@ -165,12 +165,14 @@ for SOURCE in $(find "$SCRIPT_DIR" -maxdepth 1 -mindepth 1 -type f -name '*.html
     else
       TITLE_YAML=$(echo "$JSON" | jq '.project')
     fi
+    DESCRIPTION_YAML=$(echo "$JSON" | jq '.description // empty')
     CONTENT_REL="_index.html"
     PAGE_URL="${URL_BASE}/"
     ROUTING_FILE="index.astro"
     CANONICAL_URL="${CANONICAL}/"
   else
     TITLE_YAML=$(echo "$PAGE" | jq '.name')
+    DESCRIPTION_YAML=""
     HREF="$FILE"
     if [[ "$NUM_CHILDS" -gt 0 ]]; then
       CONTENT_REL="${PATH_PREFIX}${HREF%.html}/_index.html"
@@ -190,6 +192,7 @@ for SOURCE in $(find "$SCRIPT_DIR" -maxdepth 1 -mindepth 1 -type f -name '*.html
     echo "title: $TITLE_YAML"
     echo "weight: $WEIGHT"
     echo "url: $PAGE_URL"
+    [[ -n "$DESCRIPTION_YAML" ]] && echo "description: $DESCRIPTION_YAML"
     echo "params:"
     echo "  current: $CURRENT_BOOL"
     [[ "$CURRENT_BOOL" == "false" ]] && echo "  canonical: $CANONICAL_URL"