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>