Kai Moritz [Wed, 17 Jun 2026 16:09:02 +0000 (16:09 +0000)]
Fix three regressions introduced by the previous simplification
1. URL normalization: "/${VAR##//}" strips the leading slash when the
input already starts with "/". Fix: strip trailing and leading slash
separately, then prepend "/": VAR="${2%%/}"; VAR="/${VAR##/}".
Affects --current, --archived, and --canonical in both scripts.
Consequences: missing leading "/" in frontmatter url/canonical fields
(Hugo+Astro) and in the static-copy destination path (Hugo).
2. Root page title (Hugo+Astro): TITLE_YAML was unified to use
$PAGE | jq '.name' for all pages. For index.html the Maven project
name must come from $JSON | jq '.project', not from the site.xml
page name. Moved TITLE_YAML assignment into the if/else branches.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kai Moritz [Tue, 16 Jun 2026 18:19:58 +0000 (18:19 +0000)]
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>
Kai Moritz [Mon, 15 Jun 2026 18:27:00 +0000 (18:27 +0000)]
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 <pre> 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 (/<project>/) or archived (/projects/X/Y/) URL
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kai Moritz [Wed, 29 Apr 2026 09:37:05 +0000 (11:37 +0200)]
`import-in-hugo.sh` renders _only_ current _or_ archived
* The artifact-id and the version of the project are _always_ added to the
specified base-path.
* If a *current* version is copied the version is dropped from the path
that is added as `url` to front-matter.
* If a *archived* version is copied, the path of the current version is
added as `params.canonical` to front-matter.
Kai Moritz [Tue, 3 Feb 2026 08:44:57 +0000 (09:44 +0100)]
Only valid HTML is rendered into the generated pages
- The *page title* is rendered inside a `<h1>`-tag at the beginning of a
generated page. This tag can be easily referenced from CSS and HTML by
its `id`-attribute *sili-title*, or replaced with the help of `sed` in
a post-processing script.
- The *page body* is rendered insied a `<div>`-tag with the `id`
*sili-body*.
- The generated JSON, that captures the project meta-data and the site
structure, is rendered insiede a `<script>`-tag with the `id`
*sili-json*.
Kai Moritz [Sun, 28 Feb 2021 16:23:17 +0000 (17:23 +0100)]
Prevented the override of the entry-page with the changed title "About"
* The maven-site-plugin includes an entry for the index.html in the root
of the documentation in the subdirectory "Project Info".
* This entry must be droped, because it overrides the correct definition
for that page with a false title ("About") and path (the page is added
as a child of the submenu "Project Info").
Kai Moritz [Sun, 28 Feb 2021 16:21:00 +0000 (17:21 +0100)]
The index.html from the documentation-root is explicitly added as page
* Before, it was only added to the stack as a starting point for the
computation of all available pages
* The effective entry for the page was only generated, becaus the
maven-site-plugin also adds this page as part of the submenu "Project Info"
Kai Moritz [Sat, 16 Jul 2016 20:02:42 +0000 (22:02 +0200)]
Fixed problems with the page-title
The <title>-tag of the page is taken from the velocity-variable tile, if
the variable shortTitle is set. For XHTML-templates, this is the case, if
the <title>-tag on the input-xhtml is set. If the variable is not set, the
page-title is constructed from the project-name and the name of the page,
that was found in the menu-data.
A leading head in the content is not generated automatically, because the
pages, that are generated automatically by maven differ to much. Hence, the
leading head in the content must be specified by hand in the content.
Kai Moritz [Fri, 8 Jul 2016 09:23:26 +0000 (11:23 +0200)]
Relative URI's and breadcrumb-paths can be converted into absolute ones
Defined custom variables custom.path and custom.crumbs in site.xml, that
can be used to convert the relative URI's and breadcrumb-paths into absolute
ones.
Kai Moritz [Fri, 8 Jul 2016 08:58:01 +0000 (10:58 +0200)]
Read in extra-info from site.xml
The attributes "title", "alt" and "img" for the tags <menu> and <item>
of the site.xml are read in. For <item>-tags, these entries are made
available in the page-definition. For the manually defined menu (the one
without a name!), as top-level variables "site_title", "site_alt" and
"site_img".
Kai Moritz [Fri, 8 Jul 2016 08:10:23 +0000 (10:10 +0200)]
Rendering page-data as JSON
* The JSON-data is now generated from the read in page-data.
* The data is passed to the thymeleaf-dialect "juplo:variables".
* The old breadcrumb-macro was removed.
Kai Moritz [Fri, 8 Jul 2016 07:04:46 +0000 (09:04 +0200)]
Reworked the processing of the page-data
Automatically generated pages can be overwriten in the manually defined
menu. Overwriting a URI will result in the changing of the name of the
page. Child-pages be kept in place, if present. If an automatically
generated page is overwriten in the manually defined menu, it will not
be removed form the original menu, but its breadcrumb-data will reflect
the position of the manually defined entry.
Implementation:
The data is read into a map. The unnamed menus will be read in last,
because this are usually the manually defined menus. If an URI is encountered
again, the last read version of the defined page will win and overwrite the
previously read definition, but the defined child-pages will not be touched.