From: Kai Moritz
Date: Fri, 8 Jul 2016 08:10:23 +0000 (+0200)
Subject: Rendering page-data as JSON
X-Git-Tag: maven-thymeleaf-skin-1.0.0~21
X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=ef613e7ef748a9815b93520d505a8f31a9dbaee6;p=maven-thymeleaf-skin
Rendering page-data as JSON
* The JSON-data is now generated from the read in page-data.
* The data is passed to the thymeleaf-dialect "juplo:variables".
* The old breadcrumb-macro was removed.
---
diff --git a/src/main/resources/META-INF/maven/site.vm b/src/main/resources/META-INF/maven/site.vm
index 2577a89..b441f02 100644
--- a/src/main/resources/META-INF/maven/site.vm
+++ b/src/main/resources/META-INF/maven/site.vm
@@ -48,7 +48,6 @@
#end
#set ( $sinkhole = $pages.put($page.uri, $page) )
- #set ( $sinkhole = $page.remove("uri") )
#else
@@ -71,53 +70,12 @@
#end
#end
-
-
-
-
-#set ( $crumbs = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
-#macro ( searchBreadcrumbTrail $items )
- #set ( $sep = '' )
- #foreach ( $item in $items )
- #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
- #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
- #if ( $currentItemHref == 'index.html' )
- #set ( $name = $project.name )
- #else
- #set ( $name = $item.name )
- #end
- $sep"$currentItemHref": {
- "name": "$name"
- #if ( !$item.items.empty )
- ,"childs": {
- #set ( $sinkhole = $crumbs.put( $currentItemHref , $name) )
- #searchBreadcrumbTrail ( $item.items )
- #set ( $sinkhole = $crumbs.pop() )
- }
- #end
- #if ( !$breadcrumbs && $alignedFileName == $currentItemHref )
- #set ( $breadcrumbs = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
- ## Den Titel der Seite korrigieren!
- #set ( $title = "$project.name - $item.name" )
- #set ( $shortTitle = $name )
- #set ( $sinkhole = $breadcrumbs.put( 'index.html', $project.name) )
- #set ( $sepc = '' )
- #foreach ( $crumb in $crumbs.entrySet() )
- #set ( $sinkhole = $breadcrumbs.put( $crumb.key , $crumb.value ) )
- $sepc{ "uri": "$crumb.key", "name": "$crumb.value" }
- #set( $sepc = ',' )
- #end
- #set ( $sinkhole = $breadcrumbs.put( $alignedFileName , $shortTitle) )
- ]
- #end
- }
- #set ( $sep =',' )
- #end
-#end
+
+
-
+
$bodyContent