]> juplo.de Git - maven-thymeleaf-skin/commitdiff
Only valid HTML is rendered into the generated pages hugo
authorKai Moritz <kai@juplo.de>
Tue, 3 Feb 2026 08:44:57 +0000 (09:44 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 3 Feb 2026 08:47:13 +0000 (09:47 +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 5884b2f1d58f6763cecaab180241463d5d2aa496..381defabbb73fabd2e2c1d32b3f7c04282e6382e 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')
@@ -88,8 +88,7 @@ $bodyContent
 #end
 #end
 #end
-<!--
-JSON-BEGIN
+<script id="sili-json" type="application/json">
 {
   "project": "$project.name",
 #if ( $project.description )
@@ -125,5 +124,5 @@ JSON-BEGIN
   ]
 }
 JSON-END
--->
+</script>
 #end