]> juplo.de Git - maven-thymeleaf-skin/commitdiff
Added a parameter "prefix" that is added to non-canonical uris
authorKai Moritz <kai@juplo.de>
Mon, 7 Mar 2022 21:37:47 +0000 (22:37 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 24 Oct 2025 09:28:21 +0000 (11:28 +0200)
src/main/resources/META-INF/maven/site.vm
src/site/site.xml
src/site/xhtml/usage.xhtml

index 09cef8f5181b6a2011cd5392c4dede9a3dc0a041..7aecf983468b50dec223f05b250a133b50848ddd 100644 (file)
 #end
 
 ## Custom Variablen einlesen
+#set ( $pathPrefix = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'prefix' ).getValue() )
+#if ( !$pathPrefix )
+  #set ( $pathPrefix = "" )
+#end
 #set ( $canonicalPath = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'path' ).getValue() )
 #if ( !$canonicalPath )
   #set ( $canonicalPath = "" )
+  <!-- WARNING: configuration parameter "path" is not set -->
 #end
-#set ( $sitePath = $canonicalPath + $project.version + "/" )
+#set ( $sitePath = $pathPrefix + $canonicalPath + $project.version + "/" )
 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
 #set ( $command = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'command' ).getValue() )
 #if ( !$command )
index 5586fd4eeb59a85e2ea2fc8815484962923a13fb..fe762c809d735c689291c606eb6cf2a80f1e8724 100644 (file)
@@ -23,7 +23,8 @@
   </body>
   <custom>
     <thymeproxy>
-      <path>/projects/maven-thymeleaf-skin/</path>
+      <path>/maven-thymeleaf-skin/</path>
+      <prefix>/projects</prefix>
       <crumbs>"/index.html","/projects.html"</crumbs>
       <command>th:replace="~{/templates/layout.html :: layout(uri='' + ~{:: code[class='site_uri']/text()}, title=~{:: title}, maincontent=~{:: .maincontent}, json='MERGE:' + ~{:: pre[class='json']/text()})}"</command>
     </thymeproxy>
index a9c4e0c5bd1b14bc6b642aff26f2bb89cb8e44fd..48d4a82a25cfa44995def65e1818b4fa688382e7 100644 (file)
@@ -26,6 +26,7 @@
   </p>
   <ul>
   <li><strong>path</strong></li>
+  <li><strong>prefix</strong></li>
   <li><strong>crumbs</strong></li>
   <li><strong>command</strong></li>
   </ul>
@@ -35,7 +36,7 @@
   <ul>
   <li>
     <strong>site_uri:</strong>
-    Concatenation of the configured <code>path</code>, the version of the project and the relative path of the page
+    Concatenation of the configured <code>prefix</code> and <code>path</code>, the version of the project and the relative path of the page
   </li>
   <li>
     <strong>canonical_uri:</strong>
@@ -46,6 +47,8 @@
     Solely the relative path of the page
   </li>
   </ul>
+  <h3>prefix</h3>
+  <p>If set, the <code>path</code> is prefixed with the value, when generating the <code>site_uri</code>.</p>
   <h3>crumbs</h3>
   <p>Some crumbs, that should be prepended to the breadcrumbs that are computed for the pages.</p>
   <p>The crumbs have to be specified in double quotes and must be separated by commas. Example:</p>