]> juplo.de Git - maven-thymeleaf-skin/commit
Clean up and align import-in-hugo.sh and import-in-astro.sh
authorKai Moritz <kai.milan.moritz@googlemail.com>
Tue, 16 Jun 2026 18:19:58 +0000 (18:19 +0000)
committerKai Moritz <kai@juplo.de>
Wed, 17 Jun 2026 20:04:00 +0000 (22:04 +0200)
commitac9d0d42d95b6449d29e637ee0f489d38a15cac4
treec018ac7819313bdbc984439ebfe9e4a3277f5660
parent4a9502150ce1cc134e8c5615f08b9108f8abb614
Clean up and align import-in-hugo.sh and import-in-astro.sh

Both scripts now share identical structure for argument parsing,
validation, JSON extraction, and the HTML file loop:
- CURRENT_BOOL variable (was: CURRENT converted to string in-place)
- jq-quoted TITLE_YAML for safe YAML output
- Skip files with no page entry (WARN + continue) in both scripts
- Consistent output messages (Content:/Static:/Routing:)
- Summary block at the end of both scripts

import-in-hugo.sh fixes:
- Remove debug output per file (echo "Found $FILE:", jq -C per entry)
- Fix URL bug in directory redirect pages ($URL was last HTML file's URL)
- Fix basename usage: basename "$SOURCE" not basename $SOURCE $SCRIPT_DIR
- Quote all variable expansions
- Fix inconsistent indentation in error blocks
- Redirect page HTML: use properly quoted echo with single/double quotes

import-in-astro.sh cleanup:
- Remove inline comments that belong in CLAUDE.md
- Simplify URL_BASE derivation to if/elif/else
- Remove ENTRY_ID intermediate variable (inline into printf directly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/main/resources/import-in-astro.sh
src/main/resources/import-in-hugo.sh [changed mode: 0644->0755]