diff --git a/maven-plugins/maven-site-plugin/src/main/resources/org/apache/maven/doxia/maven-site.vm b/maven-plugins/maven-site-plugin/src/main/resources/org/apache/maven/doxia/maven-site.vm
index 37a50d3f5d..1f3b731ad1 100644
--- a/maven-plugins/maven-site-plugin/src/main/resources/org/apache/maven/doxia/maven-site.vm
+++ b/maven-plugins/maven-site-plugin/src/main/resources/org/apache/maven/doxia/maven-site.vm
@@ -41,13 +41,17 @@
#macro ( menuItem $item )
#if ( $item.getChildCount() > 0 )
- #set ( $collapse = "expanded" )
+ #if ( $item.getAttribute( "collapse" ) == "true" )
+ #set ( $collapse = "collapsed" )
+ #else
+ #set ( $collapse = "expanded" )
+ #end
#else
#set ( $collapse = "none" )
#end
#set ( $currentItemHref = $PathTool.calculateLink( $item.getAttribute( "href" ), $relativePath ) )
- #if ( $currentFileName == $currentItemHref )
+ #if ( $currentFileName.replaceAll('\\', '/') == $currentItemHref )
$item.getAttribute( "name" )
#else
$item.getAttribute( "name" )
@@ -55,11 +59,13 @@
#if ( $item.getChildren() )
#if ( $item.getChildCount() > 0 )
+ #if ( $collapse != "collapsed" )
#foreach( $subitem in $item.getChildren() )
#menuItem( $subitem )
#end
+ #end
#end
#end
#end
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/pom.xml b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/pom.xml
new file mode 100644
index 0000000000..c5dcc5d400
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/pom.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+ 4.0.0
+ org.apache.maven.plugin.site.test6
+ site-plugin-test6
+ jar
+ 1.0-SNAPSHOT
+ 2005
+ Maven Site Plugin Test6 MNG-584 and MNG-585 issues
+ Test the MNG-584 and MNG-585 issues
+ http://maven.apache.org
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+
+
+ vsiveton
+ Vincent Siveton
+ vsiveton@apache.org
+ Apache Software Foundation
+
+ Java Developer
+
+ -5
+
+
+
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/main/java/org/apache/maven/plugin/site/test6/App.java b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/main/java/org/apache/maven/plugin/site/test6/App.java
new file mode 100644
index 0000000000..bbacf018cb
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/main/java/org/apache/maven/plugin/site/test6/App.java
@@ -0,0 +1,13 @@
+package org.apache.maven.plugin.site.test6;
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/index.apt
new file mode 100644
index 0000000000..890633429d
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /alpha/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/one/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/one/index.apt
new file mode 100644
index 0000000000..885467fd97
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/one/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /alpha/one/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/two/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/two/index.apt
new file mode 100644
index 0000000000..7fe34d2de9
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/alpha/two/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /alpha/two/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/index.apt
new file mode 100644
index 0000000000..fba87873bd
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /beta/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/one/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/one/index.apt
new file mode 100644
index 0000000000..75a4217961
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/one/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /beta/one/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/two/index.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/two/index.apt
new file mode 100644
index 0000000000..5f90ef4ca2
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/beta/two/index.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Index
+
+ From /beta/beta/index.apt
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/item.apt b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/item.apt
new file mode 100644
index 0000000000..3d04d54d8a
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/apt/item.apt
@@ -0,0 +1,12 @@
+ ------
+ Configuring Site Plugin
+ ------
+ Vincent Siveton
+ ------
+ 13 July 2005
+ ------
+
+
+Site Plugin Item
+
+Todo
\ No newline at end of file
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/site.xml b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/site.xml
new file mode 100644
index 0000000000..06d49883e9
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/site/site.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+ Maven Site
+ http://maven.apache.org/images/apache-maven-project.png
+ http://maven.apache.org/
+
+
+ http://maven.apache.org/images/maven-small.gif
+
+
+
+
+
+
+
+
+ ${reports}
+
+
diff --git a/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/test/java/org/apache/maven/plugin/site/test6/AppTest.java b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/test/java/org/apache/maven/plugin/site/test6/AppTest.java
new file mode 100644
index 0000000000..255b83b9da
--- /dev/null
+++ b/maven-plugins/maven-site-plugin/src/test/projects/site-plugin-test6/src/test/java/org/apache/maven/plugin/site/test6/AppTest.java
@@ -0,0 +1,38 @@
+package org.apache.maven.plugin.site.test6;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}