You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/01/15 01:43:09 UTC
[maven-doxia-sitetools] branch DOXIASITETOOLS-278 updated: Don't remove, but simply don't link
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch DOXIASITETOOLS-278
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git
The following commit(s) were added to refs/heads/DOXIASITETOOLS-278 by this push:
new 91b8000 Don't remove, but simply don't link
91b8000 is described below
commit 91b80002dd27d566dd6f6a697232a10b43dcaaa9
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Jan 15 02:42:48 2023 +0100
Don't remove, but simply don't link
---
.../apache/maven/doxia/tools/DefaultSiteTool.java | 36 +++++++++++-----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
index b0cfab7..c085c93 100644
--- a/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
+++ b/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
@@ -687,16 +687,13 @@ public class DefaultSiteTool
{
skipFlag = moduleProject.getProperties().getProperty( "maven.site.skip" );
}
- if ( "true".equalsIgnoreCase( skipFlag ) )
- {
- continue;
- }
- String siteUrl = getDistMgmntSiteUrl( moduleProject );
+ String siteUrl = "true".equalsIgnoreCase( skipFlag ) ? null : getDistMgmntSiteUrl( moduleProject );
String itemName =
( moduleProject.getName() == null ) ? moduleProject.getArtifactId() : moduleProject.getName();
+ String defaultSiteUrl = "true".equalsIgnoreCase( skipFlag ) ? null : moduleProject.getArtifactId();
- appendMenuItem( project, menu, itemName, siteUrl, moduleProject.getArtifactId() );
+ appendMenuItem( project, menu, itemName, siteUrl, defaultSiteUrl );
}
}
else if ( decorationModel.getMenuRef( "modules" ).getInherit() == null )
@@ -1363,7 +1360,7 @@ public class DefaultSiteTool
* @param menu not null
* @param name not null
* @param href could be null
- * @param defaultHref not null
+ * @param defaultHref could not null
*/
private void appendMenuItem( MavenProject project, Menu menu, String name, String href, String defaultHref )
{
@@ -1377,19 +1374,22 @@ public class DefaultSiteTool
MenuItem item = new MenuItem();
item.setName( name );
- String baseUrl = getDistMgmntSiteUrl( project );
- if ( baseUrl != null )
+ if ( selectedHref != null )
{
- selectedHref = getRelativePath( selectedHref, baseUrl );
- }
+ String baseUrl = getDistMgmntSiteUrl( project );
+ if ( baseUrl != null )
+ {
+ selectedHref = getRelativePath( selectedHref, baseUrl );
+ }
- if ( selectedHref.endsWith( "/" ) )
- {
- item.setHref( selectedHref + "index.html" );
- }
- else
- {
- item.setHref( selectedHref + "/index.html" );
+ if ( selectedHref.endsWith( "/" ) )
+ {
+ item.setHref( selectedHref + "index.html" );
+ }
+ else
+ {
+ item.setHref( selectedHref + "/index.html" );
+ }
}
menu.addItem( item );
}