X-Git-Url: https://juplo.de/gitweb/?p=maven-thymeleaf-skin;a=blobdiff_plain;f=src%2Fmain%2Fresources%2FMETA-INF%2Fmaven%2Fsite.vm;h=1aab3171887ab02f25c0e122aef4b0f6c3b7dfc6;hp=cabe6102420a146acb84a3a4ad5fa8444d347a46;hb=e932d64ce88a53477a6ac3783f4666e2403eea39;hpb=b62d434740f3e6989a2d6e5eb444de81d9ae57c8 diff --git a/src/main/resources/META-INF/maven/site.vm b/src/main/resources/META-INF/maven/site.vm index cabe610..1aab317 100644 --- a/src/main/resources/META-INF/maven/site.vm +++ b/src/main/resources/META-INF/maven/site.vm @@ -85,6 +85,13 @@ #set ( $page = $project.getClass().forName('java.util.LinkedHashMap').newInstance() ) #set ( $sinkhole = $page.put("uri", "index.html") ) #set ( $sinkhole = $page.put("name", "$project.name") ) +#set ( $crumbs = $project.getClass().forName('java.util.LinkedList').newInstance() ) +#set ( $crumb = $project.getClass().forName('java.util.LinkedHashMap').newInstance() ) +#set ( $sinkhole = $crumb.put("uri", $page.uri) ) +#set ( $sinkhole = $crumb.put("name", $page.name) ) +#set ( $sinkhole = $crumbs.push( $crumb ) ) +#set ( $sinkhole = $page.put("crumbs", $crumbs ) ) +#set ( $sinkhole = $pages.put($page.uri, $page) ) #set ( $sinkhole = $stack.push($page) ) #foreach ( $menu in $decoration.body.menus ) ## Nur benannte Menüs werden berücksichtigt @@ -100,10 +107,11 @@ #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() ) @@ -120,9 +128,11 @@ xmlns="http://www.w3.org/1999/xhtml" th:replace="~{/templates/layout.html :: layout( uri='$sitePath$alignedFileName', + title=~{:: title}, + maincontent=~{:: .maincontent}, json='MERGE: { - "_names": { + "_titles": { #set($sep = "") #foreach($page in $pages) $sep @@ -157,10 +167,14 @@ $siteCrumbs #set($csep = ",") #end + #set($last = "") #foreach($crumb in $page.crumbs) - $csep - "$sitePath$crumb.uri" - #set($csep = ",") + #if($sitePath+$crumb.uri != $last) + $csep + "$sitePath$crumb.uri" + #set($csep = ",") + #set($last = $sitePath+$crumb.uri) + #end #end ] #set($sep = ",") @@ -172,7 +186,7 @@ #if($shortTitle and $shortTitle != '')$title#else$project.name — $pages.get($alignedFileName).name#end - +

Path