Question

I'm using mvn site to generate my site's documentation. For the most part, I'm satisfied with the default site, but I'd like to remove the "About" link from the left hand menu bar and just have the default page be the "Project Information" page. Is there an easy way to do this?

Was it helpful?

Solution 3

I ended up not using that plugin at all and just used the maven-site-plugin. Maven 3 has a reportPlugins configuration section of the maven pom that lets you specified which reports you want to show up http://maven.apache.org/plugins/maven-site-plugin/maven-3.html

org.apache.maven.plugins maven-site-plugin 3.0 org.codehaus.mojo cobertura-maven-plugin

I also provided my own index.apt (in src/site/apt) file to customize the index page text.

OTHER TIPS

Here only the 'About' report is still included. All other standard reports are removed.

<reporting>
  <plugins>

    <!--  Add the Maven project information reports  -->
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-project-info-reports-plugin</artifactId>
      <version>2.1.2</version>
      <reportSets>
        <reportSet>
          <reports>
            <report>index</report>
            <!--
            <report>dependencies</report>
            <report>project-team</report>
            <report>mailing-list</report>
            <report>cim</report>
            <report>issue-tracking</report>
            <report>license</report>
            <report>scm</report>
             -->
          </reports>
        </reportSet>
      </reportSets>
    </plugin>
  </plugins>
</reporting>

You can either modify the source and comment it out or add a css selector for it, or you can include a JS library like jQuery and remove it when the page loads via something like:

$(function () {
   // untested
   $('#navcolumn h5:contains("Maven")').hide(); // hide the header
   $('#navcolumn h5:contains("Maven") + ul ').hide(); // hide the ul
})();

I know this is an old question, but I've always found it quite annoying. The 'About' section is redundant, and more important, cause the 'Project Information' menu is expanded by default when you visit the site. Since I didn't found any solution on the web, I had to figure it out myself.

With the following workaround, the 'About' item under the 'Project Information' menu will completely disappear from the site. Just add this to the site.xml file:

...
<body>
        <head>
            <![CDATA[
             <script type="text/javascript">
             $(document).ready(function () {
                var linkAbout = $('a').filter(function(index) { return $(this).text() === "About"; });
                var projectInformationMenu = $('a').filter(function(index) { return $(this).text() === "Project Information"; });
                linkAbout.hide();
                if (!projectInformationMenu.parent().hasClass('active')) {
                    projectInformationMenu.parent().children('ul').hide();
                    projectInformationMenu.children('span').removeClass('icon-chevron-down').addClass('icon-chevron-right');
                }
            });
            </script>
        ]]>
        </head>
...
</body>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top