Projekt-Seite erstellt: Velocity-Template - parent-Definition überschreibbar
authorKai Moritz <kai@juplo.de>
Mon, 13 Mar 2017 17:02:30 +0000 (18:02 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 12 May 2017 21:54:39 +0000 (23:54 +0200)
src/site/site.xml
src/site/template.vm

index a5ee897..978ea51 100644 (file)
@@ -12,6 +12,7 @@
   <custom>
     <thymeproxy>
       <path>/simple-mapper/</path>
+      <parent>&amp;quot;/projects.html&amp;quot;:{&amp;quot;name&amp;quot;:&amp;quot;Projects&amp;quot;,&amp;quot;childs&amp;quot;:{&amp;quot;/simple-mapper/index.html&amp;quot;:&amp;quot;Simple Mapper 4 JSON&amp;quot;},&amp;quot;crumbs&amp;quot;:[{&amp;quot;uri&amp;quot;:&amp;quot;/projects.html&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Projects&amp;quot;}]},</parent>
       <crumbs>{&amp;quot;uri&amp;quot;:&amp;quot;/projects.html&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Projects&amp;quot;}</crumbs>
     </thymeproxy>
   </custom>
index d9fc9bb..2588a09 100644 (file)
   #set ( $sitePath = "" )
 #end
 #set ( $siteCrumbs = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'crumbs' ).getValue() )
+#set ( $parent = $decoration.custom.getChild( 'thymeproxy' ).getChild( 'parent' ).getValue() )
 
 <!-- title: $title -->
 <!-- short title: $shortTitle -->
     <link rel="canonical" href="$sitePath$alignedFileName"/>
   </head>
   <body
-      thymeproxy:variables="merge:{&quot;pages&quot;:{#set($sep = "")#foreach($page in $pages)$sep&quot;$sitePath$page.uri&quot;:{&quot;name&quot;:&quot;$page.name&quot;,#if(!$page.childs.isEmpty())&quot;childs&quot;:{#set($csep = "")#foreach($child in $page.childs.entrySet())$csep&quot;$sitePath$child.key&quot;:&quot;$child.value&quot;#set($csep = ",")#end},#end&quot;crumbs&quot;:[#set($csep = "")#if($siteCrumbs)$siteCrumbs#set($csep = ",")#end#foreach($crumb in $page.crumbs)$csep{&quot;uri&quot;:&quot;$sitePath$crumb.uri&quot;,&quot;name&quot;:&quot;$crumb.name&quot;}#set($csep = ",")#end]#if($page.title),&quot;title&quot;:&quot;$page.title&quot;#end#if($page.alt),&quot;alt&quot;:&quot;$page.alt&quot;#end#if($page.img),&quot;img&quot;:&quot;$page.img&quot;#end}#set($sep = ",")#end}#if($siteTitle),&quot;site_title&quot;:&quot;$siteTitle&quot;#end#if($siteAlt),&quot;site_alt&quot;:&quot;$siteAlt&quot;#end#if($siteImg),&quot;site_img&quot;:&quot;$siteImg&quot;#end}"
+      thymeproxy:variables="merge:{&quot;pages&quot;:{#if($parent)$parent#end#set($sep = "")#foreach($page in $pages)$sep&quot;$sitePath$page.uri&quot;:{&quot;name&quot;:&quot;$page.name&quot;,#if(!$page.childs.isEmpty())&quot;childs&quot;:{#set($csep = "")#foreach($child in $page.childs.entrySet())$csep&quot;$sitePath$child.key&quot;:&quot;$child.value&quot;#set($csep = ",")#end},#end&quot;crumbs&quot;:[#set($csep = "")#if($siteCrumbs)$siteCrumbs#set($csep = ",")#end#foreach($crumb in $page.crumbs)$csep{&quot;uri&quot;:&quot;$sitePath$crumb.uri&quot;,&quot;name&quot;:&quot;$crumb.name&quot;}#set($csep = ",")#end]#if($page.title),&quot;title&quot;:&quot;$page.title&quot;#end#if($page.alt),&quot;alt&quot;:&quot;$page.alt&quot;#end#if($page.img),&quot;img&quot;:&quot;$page.img&quot;#end}#set($sep = ",")#end}#if($siteTitle),&quot;site_title&quot;:&quot;$siteTitle&quot;#end#if($siteAlt),&quot;site_alt&quot;:&quot;$siteAlt&quot;#end#if($siteImg),&quot;site_img&quot;:&quot;$siteImg&quot;#end}"
       >
     <h2>Path</h2>
     <p>
     <hr />
     <h2>Common</h2>
     <ul>
+      <li><strong>Parent</strong>: $parent</li>
       <li><strong>Title</strong>: $title</li>
       <li><strong>Short Title</strong>: $shortTitle</li>
       <li><strong>Current</strong>: $alignedFileName</li>