You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2005/12/09 00:23:56 UTC

svn commit: r355271 - in /maven/plugins/trunk/maven-site-plugin/src: main/resources/org/apache/maven/plugins/site/maven-site.vm site/apt/howto.apt

Author: vsiveton
Date: Thu Dec  8 15:23:50 2005
New Revision: 355271

URL: http://svn.apache.org/viewcvs?rev=355271&view=rev
Log:
PR: MNG-1706
Site doesn't display the Last Published: in the top left

o Updated maven-site.vm to use left as default in publishDate macro
o Added documentation

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm
    maven/plugins/trunk/maven-site-plugin/src/site/apt/howto.apt

Modified: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm?rev=355271&r1=355270&r2=355271&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm (original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm Thu Dec  8 15:23:50 2005
@@ -127,46 +127,43 @@
   #end
 #end
 
-#macro ( publishDate $position)
-  #if ( $siteDescriptor.getChild( "publishDate" ) )
-      
-      #if ( $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) ) 
-          #set ( $format = $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) )
-      #end
-      
-      #if ( $format )
-          $dateFormat.applyPattern( $format )
-      #end
-          ##$dateFormat.applyPattern( "MM/dd/yyyy" )          
-      ##end    
-      
-      #set ( $dateToday = $dateFormat.format( $currentDate ) )
-      
-      #set ( $datePosition = $siteDescriptor.getChild( "publishDate" ).getAttribute( "position" ) ) 
-      #if ( $datePosition.equalsIgnoreCase( $position ) )
-        
-        #if ( $datePosition.equalsIgnoreCase( "right" ) || $datePosition.equalsIgnoreCase( "bottom" ) )
-           | $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday
-        
-        #elseif ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) || $datePosition.equalsIgnoreCase( "navigation-top" ) )
-           <div id="lastPublished">$i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday</div>
-        
-        #elseif ( $datePosition.equalsIgnoreCase("left") )
-            <div class="xleft">
-              $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday &nbsp; | &nbsp; Doc for 
-              #if ( $siteDescriptor.getChild( "version" ))
-                $siteDescriptor.getChild( "version" ).getValue()
-              #else
-                ${project.version}
-              #end
-            </div>
-        #end   
-      #end
-  #end                
+#macro ( publishDate $position )
+  #if ( ( $siteDescriptor.getChild( "publishDate" ) ) && ( $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) ) )
+    #set ( $format = $siteDescriptor.getChild( "publishDate" ).getAttribute( "format" ) )
+  #else
+    #set ( $format = "MM/dd/yyyy" )
+  #end
+
+  $dateFormat.applyPattern( $format )
+
+  #set ( $dateToday = $dateFormat.format( $currentDate ) )
+
+  #if ( ( $siteDescriptor.getChild( "publishDate" ) ) && ( $siteDescriptor.getChild( "publishDate" ).getAttribute( "position" ) ) )
+    #set ( $datePosition = $siteDescriptor.getChild( "publishDate" ).getAttribute( "position" ) )
+  #else
+    #set ( $datePosition = "left" )
+  #end
+
+  #if ( $datePosition.equalsIgnoreCase( $position ) )
+    #if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase( "bottom" ) ) )
+      &nbsp;| $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday
+    #elseif ( ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $datePosition.equalsIgnoreCase( "navigation-top" ) ) )
+      <div id="lastPublished">$i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday</div>
+    #elseif ( $datePosition.equalsIgnoreCase("left") )
+      <div class="xleft">
+        $i18n.getString( "site-plugin", $locale, "template.lastpublished" ): $dateToday &nbsp; | &nbsp; Doc for
+        #if ( $siteDescriptor.getChild( "version" ))
+          $siteDescriptor.getChild( "version" ).getValue()
+        #else
+          ${project.version}
+        #end
+      </div>
+    #end
+  #end
 #end
 
 #macro ( poweredByLogo )
-                
+
     #if( $siteDescriptor.getChild( "powered-by" ) )
         #foreach ($item in $siteDescriptor.getChild( "powered-by" ).getChildren() )
             #if( $item.getAttribute( "href" ) )
@@ -174,20 +171,20 @@
             #else
                 #set ( $href="http://maven.apache.org/" )
             #end
-            
+
             #if( $item.getAttribute( "name" ) )
                 #set ( $name = $item.getAttribute( "name" ) )
             #else
                 #set ( $name = $i18n.getString( "site-plugin", $locale, "template.builtby" )  )
                 #set ( $name = "${name} Maven"  )
-            #end   
-            
+            #end
+
             #if( $item.getAttribute( "img" ) )
                 #set ( $img = $item.getAttribute( "img" ) )
             #else
                 #set ( $img = "maven-feather.png" )
-            #end 
-            
+            #end
+
             <a href="$href" title="$name" id="poweredBy">
               <img alt="$name" src="$relativePath/images/logos/$img"></img>
             </a>
@@ -244,7 +241,7 @@
     </div>
     <div id="leftColumn">
       <div id="navcolumn">
-       #publishDate( "navigation-top" )   
+       #publishDate( "navigation-top" )
        #mainMenu()
        #poweredByLogo()
        #publishDate( "navigation-bottom" )

Modified: maven/plugins/trunk/maven-site-plugin/src/site/apt/howto.apt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/site/apt/howto.apt?rev=355271&r1=355270&r2=355271&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/site/apt/howto.apt (original)
+++ maven/plugins/trunk/maven-site-plugin/src/site/apt/howto.apt Thu Dec  8 15:23:50 2005
@@ -4,7 +4,7 @@
  Vincent Siveton
  <vi...@gmail.com>
  ------
- December 4, 2005
+ December 8, 2005
  ------
 
 Maven 2 Site Plugin
@@ -32,7 +32,7 @@
 
 *How to change the site template
 
-  It is possible to change the velocity template used for creating the site.
+  It is possible to change the Velocity template used for creating the site.
   In your pom, just add something like this:
 
 -------------------
@@ -79,3 +79,17 @@
 *Site Descriptor
 
   For more references of site descriptor, here's a link {{{http://maven.apache.org/site.html}http://maven.apache.org/site.html}}.
+
+  With the out-of box Velocity template, the "Last Published" position could be configurable.
+  By default, the position is on the left but you could change it.
+  To do this, you could add a \<publishDate/> in the site.xml like this following:
+
+-------------------
+<project name="My Site Descriptor">
+  ...
+  <publishDate position="navigation-bottom" format="MM-dd-yy"/>
+  ...
+</project>
+-------------------
+
+  The position could be: left, right, navigation-top, navigation-bottom, bottom.