3 <!-- Generated by Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end at $dateFormat.format( $currentDate ) -->
6 #set ( $pages = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
7 #set ( $stack = $project.getClass().forName('java.util.LinkedList').newInstance() )
8 #macro ( buildPages $menu )
11 #set ( $currentItemHref = $PathTool.calculateLink( $menu.href, $relativePath ) )
13 #set ( $currentItemHref = '' )
15 #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
17 #set ( $seen = false )
18 #foreach ( $entry in $stack )
19 #if ( $entry.uri == $currentItemHref )
25 #if ($currentItemHref)
26 #set( $sinkhole = $stack.peek().childs.put($currentItemHref, $menu.name) )
29 #set ( $page = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
30 #set ( $sinkhole = $page.put("name", $menu.name) )
31 #set ( $sinkhole = $page.put("uri", $currentItemHref) )
32 #set ( $sinkhole = $page.put("childs", $project.getClass().forName('java.util.LinkedHashMap').newInstance()) )
33 #set ( $sinkhole = $stack.push( $page ) )
36 #set( $sinkhole = $page.put("title", $menu.title) )
39 #set( $sinkhole = $page.put("alt", $menu.alt) )
42 #set( $sinkhole = $page.put("img", $menu.img) )
45 #foreach ( $item in $menu.items )
49 #set ( $page = $stack.pop() )
50 #if ( $page.uri != "" )
52 #set ( $crumbs = $project.getClass().forName('java.util.LinkedList').newInstance() )
53 #set ( $crumb = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
54 #set ( $sinkhole = $crumb.put("uri", $page.uri) )
55 #set ( $sinkhole = $crumb.put("name", $page.name) )
56 #set ( $sinkhole = $crumbs.push($crumb) )
57 #foreach ( $entry in $stack )
58 #if ( $entry.uri != "" )
59 #set ( $crumb = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
60 #set ( $sinkhole = $crumb.put("uri", $entry.uri) )
61 #set ( $sinkhole = $crumb.put("name", $entry.name) )
62 #set ( $sinkhole = $crumbs.push($crumb) )
65 #set ( $sinkhole = $page.put("crumbs", $crumbs) )
67 #if ( $pages.containsKey($page.uri) )
68 #set ( $childs = $pages.get($page.uri).childs )
69 #set ( $sinkhole = $page.put("childs", $childs) )
71 <!-- OVERWRITING PAGE - uri: $page.uri / name: $page.name -->
74 <!-- NEW PAGE - - - - - uri: $page.uri / name: $page.name -->
77 #set ( $sinkhole = $pages.put($page.uri, $page) )
81 <!-- DONE WITH MENUE - - #if($page.name)$page.name-->#else(no name)-->
82 #set( $siteTitle = $menu.title )
83 #set( $siteAlt = $menu.alt )
84 #set( $siteImg = $menu.img )
85 #set( $sinkhole = $pages.get("index.html").put("childs", $page.childs) )
90 <!-- Skipping already seen entry: uri=$currentItemHref, name=$menu.name -->
96 #set ( $page = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
97 #set ( $sinkhole = $page.put("uri", "index.html") )
98 #set ( $sinkhole = $page.put("name", "$project.name") )
99 #set ( $crumbs = $project.getClass().forName('java.util.LinkedList').newInstance() )
100 #set ( $crumb = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
101 #set ( $sinkhole = $crumb.put("uri", $page.uri) )
102 #set ( $sinkhole = $crumb.put("name", $page.name) )
103 #set ( $sinkhole = $crumbs.push( $crumb ) )
104 #set ( $sinkhole = $page.put("crumbs", $crumbs ) )
105 #set ( $sinkhole = $pages.put($page.uri, $page) )
106 #set ( $sinkhole = $stack.push($page) )
107 #foreach ( $menu in $decoration.body.menus )
108 ## Nur benannte Menüs werden berücksichtigt
110 #buildPages ( $menu )
113 #foreach ( $menu in $decoration.body.menus )
114 ## Nur unbenannte Menüs werden berücksichtigt
116 #buildPages ( $menu )
120 ## Custom Variablen einlesen
121 #set ( $canonicalPath = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'path' ).getValue() )
122 #if ( !$canonicalPath )
123 #set ( $canonicalPath = "" )
125 #set ( $sitePath = $canonicalPath + $project.version + "/" )
126 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
128 <!-- name: $pages.get($alignedFileName).name -->
129 <!-- title: $title -->
130 <!-- short title: $shortTitle -->
131 <!-- current page: $alignedFileName -->
132 <!-- path: $sitePath -->
133 <!-- crumbs: $siteCrumbs -->
134 <!-- pages: $pages -->
139 xmlns="http://www.w3.org/1999/xhtml"
140 th:replace="~{/templates/layout.html :: layout(
141 uri='$sitePath$alignedFileName',
143 maincontent=~{:: .maincontent},
144 json='MERGE:' + ~{:: pre[class='json']/text()})}" >
146 <title id="title">#if($shortTitle and $shortTitle != '')$title#else$project.name — $pages.get($alignedFileName).name#end</title>
147 <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
148 <link id="canonical" rel="canonical" href="$canonicalPath$alignedFileName"/>
154 #foreach($crumb in $pages.get($alignedFileName).crumbs)<li><a href="$crumb.uri">$crumb.name</a></li>#end
158 <article class="maincontent">
162 <h2>Page Structure as JSON</h2>
165 "_titles": {#set($sep = "")#foreach($page in $pages)$sep
166 "$sitePath$page.uri": "$page.name"#set($sep = ",")
170 "_childs": {#set($sep = "")#foreach($page in $pages)#if(!$page.childs.isEmpty())$sep
171 "$sitePath$page.uri": [#set($csep = "")#foreach($child in $page.childs.entrySet())$csep
172 "$sitePath$child.key"#set($csep = ",")#end
174 ]#set($sep = ",")#end#end
177 "_crumbs": {#set($sep = "")#foreach($page in $pages)$sep
178 "$sitePath$page.uri": [
179 #set($csep = "")#if($siteCrumbs)
180 $siteCrumbs#set($csep = ",")#end#set($last = "")#foreach($crumb in $page.crumbs)#if($sitePath+$crumb.uri != $last)$csep
181 "$sitePath$crumb.uri"#set($csep = ",")#set($last = $sitePath+$crumb.uri)#end#end
183 ]#set($sep = ",")#end
191 #foreach($page in $pages)<li><a href="$page.uri">$page.name</a></li>#end