WIP: Normal links are rendered...
[maven-thymeleaf-skin] / src / main / resources / META-INF / maven / site.vm
index cabe610..50bd7ca 100644 (file)
 #end
 
 ## Custom Variablen einlesen
-#set ( $sitePath = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'path' ).getValue() )
-#if ( !$sitePath )
-  #set ( $sitePath = "" )
+#set ( $canonicalPath = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'path' ).getValue() )
+#if ( !$canonicalPath )
+  #set ( $canonicalPath = "" )
 #end
+#set ( $sitePath = $canonicalPath + $project.version + "/" )
 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
 
 <!-- name: $pages.get($alignedFileName).name -->
                 $siteCrumbs
                 #set($csep = ",")
               #end
+              #set($last = "")
               #foreach($crumb in $page.crumbs)
-                $csep
-                &quot;$sitePath$crumb.uri&quot;
-                #set($csep = ",")
+                #if($sitePath+$crumb.uri != $last)
+                  $csep
+                  &quot;$sitePath$crumb.uri&quot;
+                  #set($csep = ",")
+                  #set($last = $sitePath+$crumb.uri)
+                #end
               #end
             ]
             #set($sep = ",")
   <head>
     <title id="title">#if($shortTitle and $shortTitle != '')$title#else$project.name &mdash; $pages.get($alignedFileName).name#end</title>
     <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
-    <link rel="canonical" href="$sitePath$alignedFileName"/>
+    <link id="canonical" rel="canonical" href="$canonicalPath$alignedFileName"/>
   </head>
   <body>
     <h2>Path</h2>