maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r366502 - in /maven/plugins/trunk/maven-site-plugin/src/main: java/org/apache/maven/plugins/site/SiteMojo.java resources/org/apache/maven/plugins/site/default-site.vm
Date Fri, 06 Jan 2006 13:39:12 GMT
Author: brett
Date: Fri Jan  6 05:39:04 2006
New Revision: 366502

URL: http://svn.apache.org/viewcvs?rev=366502&view=rev
Log:
[MSITE-51] Add breadcrumbs

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java?rev=366502&r1=366501&r2=366502&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
Fri Jan  6 05:39:04 2006
@@ -655,7 +655,8 @@
         {
             DecorationModel parent = getDecorationModel( parentProject, locale, props );
 
-            assembler.assembleModelInheritance( decoration, parent, project.getUrl(), parentProject.getUrl()
);
+            assembler.assembleModelInheritance( project.getName(), decoration, parent, project.getUrl(),
+                                                parentProject.getUrl() );
         }
 
         return decoration;

Modified: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm?rev=366502&r1=366501&r2=366502&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
Fri Jan  6 05:39:04 2006
@@ -43,6 +43,24 @@
   #end
 #end
 
+#macro ( breadcrumbs $breadcrumbs )
+  #set ( $counter = 0 )
+  #foreach( $item in $breadcrumbs )
+    #set ( $counter = $counter + 1 )
+    #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
+    #set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
+
+    #if ( $currentItemHref == $currentFileName || $currentItemHref == "" )
+      $item.name
+    #else
+      <a href="$item.href">$item.name</a>
+    #end
+    #if ( $breadcrumbs.size() > $counter )
+      &gt;
+    #end
+  #end
+#end
+
 #macro ( displayTree $display $item )
   #if ( $item && $item.items && $item.items.size() > 0 )
     #foreach( $subitem in $item.items )
@@ -61,7 +79,6 @@
 #macro ( menuItem $item )
   #set ( $collapse = "none" )
   #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
-  #set ( $currentFileName = $currentFileName.replaceAll( "\\", "/" ) )
   #set ( $currentItemHref = $currentItemHref.replaceAll( "\\", "/" ) )
 
   #if ( $item && $item.items && $item.items.size() > 0 )
@@ -149,6 +166,8 @@
     #end
   #end
 
+  #set ( $breadcrumbs = $decoration.body.breadcrumbs )
+
   #if ( $datePosition.equalsIgnoreCase( $position ) )
     #if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase(
"bottom" ) ) )
       &nbsp;| $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday
@@ -168,6 +187,9 @@
         #if ( $versionPosition.equalsIgnoreCase( $position ) )
           &nbsp;| $i18n.getString( "site-plugin", $locale, "template.version" ): ${project.version}
         #end
+        #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
+          | #breadcrumbs( $breadcrumbs )
+        #end
       </div>
     #end
   #elseif ( $versionPosition.equalsIgnoreCase( $position ) )
@@ -180,6 +202,15 @@
     #elseif ( $versionPosition.equalsIgnoreCase("left") )
       <div class="xleft">
         $i18n.getString( "site-plugin", $locale, "template.version" ): ${project.version}
+        #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
+          | #breadcrumbs( $breadcrumbs )
+        #end
+      </div>
+    #end
+  #elseif ( $position.equalsIgnoreCase( "left" ) )
+    #if ( $breadcrumbs && $breadcrumbs.size() > 0 )
+      <div class="xleft">
+        #breadcrumbs( $breadcrumbs )
       </div>
     #end
   #end



Mime
View raw message