From: Kai Moritz Date: Thu, 18 Jun 2026 21:39:10 +0000 (+0200) Subject: TMP: Mit StILi generiert und mit import-in-astro.sh importiert X-Git-Url: https://juplo.de/gitweb/?a=commitdiff_plain;h=765e6697c4b23dddda0541f049301be892c07453;p=website TMP: Mit StILi generiert und mit import-in-astro.sh importiert --- diff --git a/public/projects/maven-stili-skin/1.0.0-SNAPSHOT/css/site.css b/public/projects/maven-stili-skin/1.0.0-SNAPSHOT/css/site.css new file mode 100644 index 00000000..055e7e28 --- /dev/null +++ b/public/projects/maven-stili-skin/1.0.0-SNAPSHOT/css/site.css @@ -0,0 +1 @@ +/* You can override this file with your own styles */ \ No newline at end of file diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/_index.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/_index.html new file mode 100644 index 00000000..915df5ef --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/_index.html @@ -0,0 +1,67 @@ +--- +title: "Maven StILi Skin" +weight: 0 +url: /maven-stili-plugin/ +params: + current: true +--- +
+

Maven StILi Skin

+

A Maven Doxia skin that liberates the generated site content and its structure for import into arbitrary static site generators. StILi = (St)atic (I)mport site (Li)berator.

+

What is StILi?

+

StILi stands for (St)atic (I)mport site (Li)berator — and the name says it all:

+
    + +
  • Liberator: Maven generates site content as monolithic HTML pages that are only usable within the Maven theme ecosystem. StILi liberates that content by serialising the page structure and metadata into a machine-readable JSON block, making it accessible to any downstream tool.
  • +
  • Static: The intended targets are static site generators — Hugo, Astro, and any other generator for which someone contributes an import script.
  • +
  • Import: The mechanism is a set of import scripts that transfer the generated Maven output into the target system.
  • +
  • Site: The source is Maven Doxia site output.
  • +
+

The name also deliberately echoes the German and Italian word for style (Stil / stile) — a nod to the fact that StILi liberates Maven site content in a stylish way.

+

Quick Start

+

Add StILi as the skin in your project's src/site/site.xml:

+ +
+
<project ...>
+  <skin>
+    <groupId>de.juplo.maven</groupId>
+    <artifactId>maven-stili-skin</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+  </skin>
+  <custom>
+    <menuName>Your Main Menu Name</menuName>
+  </custom>
+  ...
+</project>
+
+

The <menuName> custom element tells StILi which menu in site.xml is the primary navigation. StILi uses this to determine the page order and hierarchy recorded in the stili-json block.

+

After running mvn site, the generated output in target/site/ contains the regular HTML files plus the import scripts. Run the appropriate import script from that directory:

+ +
+
cd target/site
+./import-in-astro.sh /path/to/your/astro-project --base /projects --archived
+
+

See the Architecture page for a detailed explanation of the generated format, and the Hugo and Astro pages for the full import script reference.

+

Design Principle: Extensible by the Community

+

StILi is not tied to any specific website or static site generator. The skin itself is completely generator-agnostic — it only ensures that the content and navigation structure are machine-readable.

+

Generator-specific logic lives in import scripts, which the skin ships as Maven resources and copies into the generated site output:

+ + + + + + + + + + + + + + + +
ScriptTarget
import-in-hugo.shHugo
import-in-astro.shAstro
+

Anyone who wants to use StILi with a different generator writes a new import script. Contributions are welcome.

+

License

+

Maven StILi Skin is licensed under the GNU Lesser General Public License, Version 3.0.

+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/architecture.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/architecture.html new file mode 100644 index 00000000..8309af8c --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/architecture.html @@ -0,0 +1,145 @@ +--- +title: "Architecture" +weight: 6 +url: /maven-stili-plugin/architecture.html +params: + current: true +--- +
+

Architecture

+

How site.vm Works

+

The Velocity template src/main/resources/META-INF/maven/site.vm is the core of StILi. It renders every Maven page in the following structure:

+ +
+
<h1 id="stili-title">Page Title</h1>
+<div id="stili-body">
+  $bodyContent
+</div>
+
+

For index.html only, a JSON metadata block is appended after the body:

+ +
+
<script id="stili-json" type="application/json">
+{
+  "project": "Project Name",
+  "groupId": "de.juplo",
+  "artifactId": "my-project",
+  "version": "1.0.0",
+  "pages": [ ... ]
+}
+</script>
+
+

This block is the machine-readable interface between StILi and the import scripts. It appears only in index.html so that the import scripts have a single, predictable location for the full site metadata.

+

The stili-json Format

+

The top-level fields mirror the Maven project coordinates:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldSource
projectDisplay name from POM <name>
groupIdPOM <groupId>
artifactIdPOM <artifactId>
versionPOM <version>
generatorMaven Doxia Site Renderer version
generatedISO-8601 timestamp of generation
pagesArray of all pages (see below)
+

The pages Array

+

The pages array contains every page of the Maven site in the order they appear in the configured navigation menu. Array position serves as the weight for navigation sorting in the target system.

+

Each entry:

+ +
+
{
+  "name": "Project Reports",
+  "href": "project-reports.html",
+  "childs": ["plugin-info.html"],
+  "crumbs": [],
+  "path": ""
+}
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldMeaning
nameDisplay name of the page
hrefFilename relative to the site root (e.g. project-reports.html; for generated directories e.g. apidocs/index.html)
childsDirect children in the menu tree (their href values)
crumbsAncestor pages from the root, excluding index.html (e.g. ["project-reports.html"])
pathAncestors as a directory path — crumbs with .html replaced by / (e.g. "project-reports/")
+

Page Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeExampleDetection
Rootindex.htmlhref == "index.html"
Section node (has children)project-reports.htmlchilds.length > 0
Leaf pageconfiguration.htmlchilds.length == 0
Generated contentapidocs/, xref/ etc.Subdirectory, not an HTML file
+

Generated content (JavaDocs, cross-references, etc.) appears as a subdirectory in the Maven site output and has a pages entry with an href like apidocs/index.html.

+

Body Extraction

+

Import scripts extract the page body from each HTML file using this pattern:

+ +
+
sed -n '/<script id="stili-json" type="application\/json">/q;p' "$SOURCE" \
+  | tail -n +2
+
+
    + +
  • sed outputs all lines before the JSON block (and stops). For non-index.html files there is no JSON block, so all content is output.
  • +
  • tail -n +2 drops the first line (<h1 id="stili-title">...</h1>), leaving only the <div id="stili-body"> and its content.
  • +
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-astro.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-astro.html new file mode 100644 index 00000000..8cc01cad --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-astro.html @@ -0,0 +1,168 @@ +--- +title: "Astro" +weight: 9 +url: /maven-stili-plugin/import-in-astro.html +params: + current: true +--- +
+

Import Script: Astro

+

import-in-astro.sh imports a Maven site generated with the StILi skin into an Astro project.

+

Prerequisites

+
    + +
  • bash
  • +
  • jq (JSON processor)
  • +
+

Usage

+

Run the script from the Maven site output directory (target/site/):

+ +
+
cd target/site
+./import-in-astro.sh <ASTRO_ROOT> [OPTIONS]
+
+

The script checks for package.json in <ASTRO_ROOT> to verify that the path points to an Astro project.

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
<ASTRO_ROOT>Path to the Astro project root (required).
--base <path>URL and routing path prefix. The project name is always appended; for --archived the version is appended as well. Default: none (project at root).
--project <name>Overrides the project name derived from artifactId.
--current [<url>](Default) Marks this version as the current (visible) release. If <url> is given, it overrides the computed URL base.
--archived [<url>]Marks this version as archived. params.canonical points to the corresponding current-version page. If <url> is given, it overrides the computed URL base.
--canonical <url>Explicitly sets the canonical URL base. Only valid with --archived. Default: <base>/<project>.
+

Only one of --current and --archived may be specified.

+

What the Script Produces

+

Content files

+

Each HTML page becomes a content file with YAML frontmatter at:

+ +
+
src/content/projects/<project>/<version>/<page-path>
+
+

Frontmatter fields: title, weight, url, params.current, and (for archived) params.canonical. The HTML body follows the frontmatter delimiter.

+

Section nodes (pages with children) become _index.html files in a subdirectory; leaf pages keep their .html filename:

+ + + + + + + + + + + + + + + + + + + + + + +
Maven outputContent pathURL (current, no --base)
index.html_index.html/<project>/
project-reports.html (has children)project-reports/_index.html/<project>/project-reports.html
configuration.html (leaf)configuration.html/<project>/configuration.html
+

URLs are always flat (no URL nesting matching the content hierarchy), reflecting Maven's own flat site structure.

+

Routing files

+

For each content file a minimal Astro routing file is created at the path corresponding to the page URL:

+ +
+
src/pages/<base>/<project>/index.astro               (current, root page)
+src/pages/<base>/<project>/configuration.html.astro  (current, leaf page)
+src/pages/<base>/<project>/<version>/index.astro     (archived, root page)
+
+

The import depth (number of ../ segments in the ProjectPage.astro import) is computed dynamically from the actual URL depth, so --base values of any nesting level are handled correctly.

+

Static files (generated content)

+

Generated content directories (apidocs/, xref/, etc.) are copied to:

+ +
+
public/projects/<project>/<version>/<directory>/
+
+

This path is always fixed regardless of --base, because the generated content is served at /projects/<project>/<version>/ independently of where the content pages appear in the URL space.

+

Relative links inside content pages that point to generated directories (e.g. href="apidocs/") are rewritten to absolute URLs with an explicit index.html (e.g. href="/projects/<project>/<version>/apidocs/index.html"). This is necessary because the same content page may be served at different URL prefixes (visible vs. archived) while the generated docs always live at the same fixed path.

+

Known Generated Content Directories

+

The following directories are recognised as generated content (defined by GENERATED_DOC_NAMES in the consuming Astro project):

+ + + + + + + + + + + + + + + + + + + + + +
DirectoryTypical content
apidocs/JavaDocs
testapidocs/Test JavaDocs
xref/Source cross-reference
xref-test/Test source cross-reference
+

URL Defaults

+ + + + + + + + + + + + + + + + + + + + + +
ModeURL Base
--current, no --base/<project>/
--current --base /path/path/<project>/
--archived, no --base/<project>/<version>/
--archived --base /path/path/<project>/<version>/
+

Examples

+

Import the current release directly under the site root:

+ +
+
cd target/site
+./import-in-astro.sh /path/to/astro-project
+
+

Import an archived version under /projects/:

+ +
+
cd target/site
+./import-in-astro.sh /path/to/astro-project \
+    --base /projects \
+    --archived \
+    --canonical /my-project
+
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-hugo.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-hugo.html new file mode 100644 index 00000000..5358cde9 --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/import-in-hugo.html @@ -0,0 +1,112 @@ +--- +title: "Hugo" +weight: 8 +url: /maven-stili-plugin/import-in-hugo.html +params: + current: true +--- +
+

Import Script: Hugo

+

import-in-hugo.sh imports a Maven site generated with the StILi skin into a Hugo project.

+

Prerequisites

+
    + +
  • bash
  • +
  • jq (JSON processor)
  • +
  • perl with HTML::Entities module (for <pre> block conversion)
  • +
+

Usage

+

Run the script from the Maven site output directory (target/site/):

+ +
+
cd target/site
+./import-in-hugo.sh <HUGO_ROOT> [OPTIONS]
+
+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
<HUGO_ROOT>Path to the Hugo project root (required).
--base <path>URL and content path prefix. The project name and version are always appended. Default: none (project at root).
--project <name>Overrides the project name derived from artifactId.
--current [<url>](Default) Marks this version as the current (visible) release. If <url> is given, it overrides the computed URL base.
--archived [<url>]Marks this version as archived. params.canonical points to the corresponding current-version page. If <url> is given, it overrides the computed URL base.
--canonical <url>Explicitly sets the canonical URL base. Only valid with --archived. Default: <base>/<project>.
+

Only one of --current and --archived may be specified.

+

What the Script Produces

+

Content files

+

Each HTML page becomes a Hugo content file at:

+ +
+
content/<base>/<project>/<version>/<page-path>
+
+

Content files have YAML frontmatter with title, weight, outputs: [html], url, layout: article, and params.current / params.canonical.

+

Section nodes (pages with children) become _index.html files in a subdirectory. Leaf pages keep their .html filename.

+

Static files

+

Generated content directories (apidocs/, xref/, etc.) are copied to:

+ +
+
static/<url-base>/<directory>/
+
+

For each directory that also has a pages entry in stili-json, a redirect page is created in the content tree so that the nav link works correctly.

+

<pre> block conversion

+

<pre> blocks in the HTML body are converted to Hugo {{< highlight guess >}} shortcodes via perl. This ensures syntax-highlighted rendering in Hugo.

+

URL Defaults

+ + + + + + + + + + + + + + + + + + + + + +
ModeURL Base
--current, no --base/<project>/
--current --base /path/path/<project>/
--archived, no --base/<project>/<version>/
--archived --base /path/path/<project>/<version>/
+

Examples

+

Import the current release directly under the site root:

+ +
+
cd target/site
+./import-in-hugo.sh /path/to/hugo-project
+
+

Import an archived version under /projects/:

+ +
+
cd target/site
+./import-in-hugo.sh /path/to/hugo-project \
+    --base /projects \
+    --archived \
+    --canonical /my-project
+
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/_index.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/_index.html new file mode 100644 index 00000000..f8f2ca22 --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/_index.html @@ -0,0 +1,32 @@ +--- +title: "Project Information" +weight: 1 +url: /maven-stili-plugin/project-info.html +params: + current: true +--- +
+
+

Project Information

+

This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by Maven on behalf of the project.

+

Overview

+ + + + + + + + + + + + + + + + + + +
DocumentDescription
AboutA Maven Doxia skin that liberates the generated site content and its structure for import into arbitrary static site generators. StILi = (St)atic (I)mport site (Li)berator.
SummaryThis document lists other related information of this project
LicensesThis document lists the project license(s).
TeamThis document provides information on the members of this project. These are the individuals who have contributed to the project in one form or another.
PluginsThis document lists the build plugins and the report plugins used by this project.
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/licenses.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/licenses.html new file mode 100644 index 00000000..ed29cb7e --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/licenses.html @@ -0,0 +1,14 @@ +--- +title: "Licenses" +weight: 3 +url: /maven-stili-plugin/licenses.html +params: + current: true +--- +
+
+

Overview

+

Typically the licenses listed for the project are that of the project itself, and not of dependencies.

+

Project Licenses

+

GNU Lesser General Public License, Version 3.0

http://www.gnu.org/licenses/lgpl-3.0.en.html
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/plugins.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/plugins.html new file mode 100644 index 00000000..9c110d64 --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/plugins.html @@ -0,0 +1,62 @@ +--- +title: "Plugins" +weight: 5 +url: /maven-stili-plugin/plugins.html +params: + current: true +--- +
+
+

Project Build Plugins

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GroupIdArtifactIdVersion
org.apache.maven.pluginsmaven-clean-plugin3.3.2
org.apache.maven.pluginsmaven-compiler-plugin3.13.0
org.apache.maven.pluginsmaven-deploy-plugin3.1.1
org.apache.maven.pluginsmaven-enforcer-plugin1.2
org.apache.maven.pluginsmaven-install-plugin3.1.1
org.apache.maven.pluginsmaven-jar-plugin3.3.0
org.apache.maven.pluginsmaven-resources-plugin3.3.1
org.apache.maven.pluginsmaven-site-plugin3.12.1
org.apache.maven.pluginsmaven-surefire-plugin2.12.4
+

Project Report Plugins

+ + + + + + + + +
GroupIdArtifactIdVersion
org.apache.maven.pluginsmaven-project-info-reports-plugin3.7.0
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/summary.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/summary.html new file mode 100644 index 00000000..e70427c7 --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/summary.html @@ -0,0 +1,56 @@ +--- +title: "Summary" +weight: 2 +url: /maven-stili-plugin/summary.html +params: + current: true +--- +
+
+

Project Summary

+

Project Information

+ + + + + + + + + + + + +
FieldValue
NameMaven StILi Skin
DescriptionA Maven Doxia skin that liberates the generated site content and its structure for import into arbitrary static site generators. StILi = (St)atic (I)mport site (Li)berator.
Homepagehttps://juplo.github.io/maven-stili-skin/
+

Project Organization

+ + + + + + + + + +
FieldValue
Namejuplo
URLhttp://juplo.de
+

Build Information

+ + + + + + + + + + + + + + + + + + +
FieldValue
GroupIdde.juplo.maven
ArtifactIdmaven-stili-skin
Version1.0.0-SNAPSHOT
Typejar
Java Version-
+
diff --git a/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/team.html b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/team.html new file mode 100644 index 00000000..d9fe79b6 --- /dev/null +++ b/src/content/projects/maven-stili-skin/1.0.0-SNAPSHOT/project-info/team.html @@ -0,0 +1,28 @@ +--- +title: "Team" +weight: 4 +url: /maven-stili-plugin/team.html +params: + current: true +--- +
+
+

Project Team

+

A successful project requires many people to play many roles. Some members write code or documentation, while others are valuable as testers, submitting patches and suggestions.

+

The project team is comprised of Members and Contributors. Members have direct access to the source of a project and actively evolve the code-base. Contributors improve the project through submission of patches and suggestions to the Members. The number of Contributors to the project is unbounded. Get involved today. All contributions to the project are greatly appreciated.

+

Members

+

The following is a list of developers with commit privileges that have directly contributed to the project in one way or another.

+ + + + + + + + + + +
ImageIdNameEmail
kaiKai Moritzkai@juplo.de
+

Contributors

+

There are no contributors listed for this project. Please check back again later.

+
diff --git a/src/pages/maven-stili-plugin/architecture.html.astro b/src/pages/maven-stili-plugin/architecture.html.astro new file mode 100644 index 00000000..5cb74366 --- /dev/null +++ b/src/pages/maven-stili-plugin/architecture.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/import-in-astro.html.astro b/src/pages/maven-stili-plugin/import-in-astro.html.astro new file mode 100644 index 00000000..a6a565b1 --- /dev/null +++ b/src/pages/maven-stili-plugin/import-in-astro.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/import-in-hugo.html.astro b/src/pages/maven-stili-plugin/import-in-hugo.html.astro new file mode 100644 index 00000000..3df6011f --- /dev/null +++ b/src/pages/maven-stili-plugin/import-in-hugo.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/index.astro b/src/pages/maven-stili-plugin/index.astro new file mode 100644 index 00000000..bdb467b2 --- /dev/null +++ b/src/pages/maven-stili-plugin/index.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/licenses.html.astro b/src/pages/maven-stili-plugin/licenses.html.astro new file mode 100644 index 00000000..e7e1eb3d --- /dev/null +++ b/src/pages/maven-stili-plugin/licenses.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/plugins.html.astro b/src/pages/maven-stili-plugin/plugins.html.astro new file mode 100644 index 00000000..597affef --- /dev/null +++ b/src/pages/maven-stili-plugin/plugins.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/project-info.html.astro b/src/pages/maven-stili-plugin/project-info.html.astro new file mode 100644 index 00000000..75ab1298 --- /dev/null +++ b/src/pages/maven-stili-plugin/project-info.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/summary.html.astro b/src/pages/maven-stili-plugin/summary.html.astro new file mode 100644 index 00000000..03aa0c83 --- /dev/null +++ b/src/pages/maven-stili-plugin/summary.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- + diff --git a/src/pages/maven-stili-plugin/team.html.astro b/src/pages/maven-stili-plugin/team.html.astro new file mode 100644 index 00000000..6464ab22 --- /dev/null +++ b/src/pages/maven-stili-plugin/team.html.astro @@ -0,0 +1,4 @@ +--- +import ProjectPage from '../../components/ProjectPage.astro'; +--- +