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?
我正在使用mvn网站生成我网站的文档。在大多数情况下,我对默认网站感到满意,但我想从左侧菜单栏中删除“关于”链接,只需将默认页面设置为“项目信息”页面即可。是否有捷径可寻?
3 个解决方案
#1
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>
#2
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:
您可以修改源代码并将其注释掉,也可以为其添加一个css选择器,或者您可以包含一个JS库,如jQuery,并在页面加载时通过以下方式删除它:
$(function () {
// untested
$('#navcolumn h5:contains("Maven")').hide(); // hide the header
$('#navcolumn h5:contains("Maven") + ul ').hide(); // hide the ul
})();
#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
我最终根本没有使用该插件,只是使用了maven-site-plugin。 Maven 3有一个maven pom的reportPlugins配置部分,可以让你指定要显示的报告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
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.
我还提供了自己的index.apt(在src / site / apt中)文件来自定义索引页面文本。
#1
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>
#2
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:
您可以修改源代码并将其注释掉,也可以为其添加一个css选择器,或者您可以包含一个JS库,如jQuery,并在页面加载时通过以下方式删除它:
$(function () {
// untested
$('#navcolumn h5:contains("Maven")').hide(); // hide the header
$('#navcolumn h5:contains("Maven") + ul ').hide(); // hide the ul
})();
#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
我最终根本没有使用该插件,只是使用了maven-site-plugin。 Maven 3有一个maven pom的reportPlugins配置部分,可以让你指定要显示的报告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
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.
我还提供了自己的index.apt(在src / site / apt中)文件来自定义索引页面文本。