Released version 1.1.0
[maven-thymeleaf-skin] / src / main / resources / META-INF / maven / site.vm
1 <!DOCTYPE html>
2 <!--/*-->
3 <!-- Generated by Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end at $dateFormat.format( $currentDate ) -->
4
5
6 #set ( $pages = $project.getClass().forName('java.util.LinkedHashMap').newInstance() )
7 #set ( $stack = $project.getClass().forName('java.util.LinkedList').newInstance() )
8 #macro ( buildPages $menu )
9
10   #if ( $menu.href )
11     #set ( $currentItemHref = $PathTool.calculateLink( $menu.href, $relativePath ) )
12   #else
13     #set ( $currentItemHref = '' )
14   #end
15   #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
16
17   #set ( $seen = false )
18   #foreach ( $entry in $stack )
19     #if ( $entry.uri == $currentItemHref )
20       #set ( $seen = true )
21     #end
22   #end
23
24   #if ( !$seen )
25     #if ($currentItemHref)
26       #set( $sinkhole = $stack.peek().childs.put($currentItemHref, $menu.name) )
27     #end
28
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 ) )
34
35     #if ($menu.title)
36       #set( $sinkhole = $page.put("title", $menu.title) )
37     #end
38     #if ($menu.alt)
39       #set( $sinkhole = $page.put("alt", $menu.alt) )
40     #end
41     #if ($menu.img)
42       #set( $sinkhole = $page.put("img", $menu.img) )
43     #end
44
45     #foreach ( $item in $menu.items )
46       #buildPages ( $item )
47     #end
48
49     #set ( $page = $stack.pop() )
50     #if ( $page.uri != "" )
51
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) )
63         #end
64       #end
65       #set ( $sinkhole = $page.put("crumbs", $crumbs) )
66
67       #if ( $pages.containsKey($page.uri) )
68         #set ( $childs = $pages.get($page.uri).childs )
69         #set ( $sinkhole = $page.put("childs", $childs) )
70
71         <!-- OVERWRITING PAGE - uri: $page.uri / name: $page.name -->
72       #else
73
74         <!-- NEW PAGE - - - - - uri: $page.uri / name: $page.name -->
75       #end
76
77       #set ( $sinkhole = $pages.put($page.uri, $page) )
78
79     #else
80
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) )
86       #end
87
88     #end
89   #else
90     <!-- Skipping already seen entry: uri=$currentItemHref, name=$menu.name -->
91   #end
92 #end
93
94
95 ## Seiten einlesen
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
109   #if ($menu.name)
110     #buildPages ( $menu )
111   #end
112 #end
113 #foreach ( $menu in $decoration.body.menus )
114   ## Nur unbenannte Menüs werden berücksichtigt
115   #if (!($menu.name))
116     #buildPages ( $menu )
117   #end
118 #end
119
120 ## Custom Variablen einlesen
121 #set ( $pathPrefix = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'prefix' ).getValue() )
122 #if ( !$pathPrefix )
123   #set ( $pathPrefix = "" )
124 #end
125 #set ( $canonicalPath = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'path' ).getValue() )
126 #if ( !$canonicalPath )
127   #set ( $canonicalPath = "" )
128   <!-- WARNING: configuration parameter "path" is not set -->
129 #end
130 #set ( $sitePath = $pathPrefix + $canonicalPath + $project.version + "/" )
131 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
132 #set ( $command = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'command' ).getValue() )
133 #if ( !$command )
134   #set ( $command = "" )
135   <!-- WARNING: configuration parameter "command" is not set -->
136 #end
137
138 <!-- name: $pages.get($alignedFileName).name -->
139 <!-- title: $title -->
140 <!-- short title: $shortTitle -->
141 <!-- current page: $alignedFileName -->
142 <!-- path: $sitePath -->
143 <!-- crumbs: $siteCrumbs -->
144 <!-- pages: $pages -->
145
146
147 <!--*/-->
148 <html xmlns="http://www.w3.org/1999/xhtml" $command>
149   <head>
150     <title class="title">$title</title>
151     <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
152     <link id="canonical" rel="canonical" href="$canonicalPath$alignedFileName"/>
153   </head>
154   <body>
155     <h1 class="short_title">$shortTitle</h1>
156     <h2>URI</h2>
157     <ul>
158       <li><strong>site:</strong> <code class="site_uri">$sitePath$alignedFileName</code></li>
159       <li><strong>canonical:</strong> <code class="canonical_uri">$canonicalPath$alignedFileName</code></li>
160       <li><strong>relative:</strong> <code class="relative_uri">$alignedFileName</code></li>
161     </ul>
162     <h2>Path</h2>
163     <p>
164       <ol>
165         #foreach($crumb in $pages.get($alignedFileName).crumbs)<li><a href="$crumb.uri">$crumb.name</a></li>#end
166       </ol>
167     </p>
168     <hr />
169     <article class="maincontent">
170       $bodyContent
171     </article>
172     <hr />
173     <h2>Page Structure as JSON</h2>
174     <pre class="json">
175 {
176   "_titles": {#set($sep = "")#foreach($page in $pages)$sep
177     "$sitePath$page.uri": "$page.name"#set($sep = ",")
178 #end
179
180   },
181   "_childs": {#set($sep = "")#foreach($page in $pages)#if(!$page.childs.isEmpty())$sep
182     "$sitePath$page.uri": [#set($csep = "")#foreach($child in $page.childs.entrySet())$csep
183       "$sitePath$child.key"#set($csep = ",")#end
184
185     ]#set($sep = ",")#end#end
186
187   },
188   "_crumbs": {#set($sep = "")#foreach($page in $pages)$sep
189     "$sitePath$page.uri": [
190 #set($csep = "")#if($siteCrumbs)
191       $siteCrumbs#set($csep = ",")#end#set($last = "")#foreach($crumb in $page.crumbs)#if($sitePath+$crumb.uri != $last)$csep
192       "$sitePath$crumb.uri"#set($csep = ",")#set($last = $sitePath+$crumb.uri)#end#end
193
194     ]#set($sep = ",")#end
195
196   }
197 }
198     </pre>
199     <h2>All Pages</h2>
200     <p>
201       <ul>
202         #foreach($page in $pages)<li><a href="$page.uri">$page.name</a></li>#end
203       </ul>
204     </p>
205   </body>
206 </html>