]> juplo.de Git - maven-thymeleaf-skin/commitdiff
Only valid HTML is rendered into the generated pages
authorKai Moritz <kai@juplo.de>
Tue, 3 Feb 2026 08:44:57 +0000 (09:44 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 4 Feb 2026 10:41:51 +0000 (11:41 +0100)
- 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*.

src/main/resources/META-INF/maven/site.vm

index aab191b32532ab89e3388a14c5833b8d1f6a3bf2..a29da96597a7e43f3f85b8f6e76adca45e790ec1 100644 (file)
@@ -62,8 +62,8 @@
 #end
 #end
 #end
-<!-- HEAD -->
-<div class="maven-site">
+<h1 id="sili-title">$!{shortTitle}</h1>
+<div id="sili-body">
 $bodyContent
 </div>
 #if (!$alignedFilePath or $alignedFilePath == 'index.html')
@@ -87,8 +87,7 @@ $bodyContent
 #end
 #end
 #end
-<!--
-JSON-BEGIN
+<script id="sili-json" type="application/json">
 {
   "project": "$project.name",
 #if ( $project.description )
@@ -123,6 +122,5 @@ JSON-BEGIN
 #end
   ]
 }
-JSON-END
--->
+</script>
 #end