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 2024/05/22 19:13:39 UTC

(maven-doxia-sitetools) branch DOXIASITETOOLS-340 updated (6e719f0 -> 7bf7a0f)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch DOXIASITETOOLS-340
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git


 discard 6e719f0  [DOXIASITETOOLS-340] Rearrange title order in Velocity context
     add c54e6b1  [DOXIASITETOOLS-342] Upgrade to Maven Fluido Skin 2.0.0-M9 in default site descriptor
     new 7bf7a0f  [DOXIASITETOOLS-340] Rearrange title order in Velocity context

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6e719f0)
            \
             N -- N -- N   refs/heads/DOXIASITETOOLS-340 (7bf7a0f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doxia-integration-tools/src/main/resources/default-site.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


(maven-doxia-sitetools) 01/01: [DOXIASITETOOLS-340] Rearrange title order in Velocity context

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch DOXIASITETOOLS-340
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git

commit 7bf7a0ff95e4e2f092f7f4e15cea3f8cc57bf745
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat May 18 13:30:06 2024 +0200

    [DOXIASITETOOLS-340] Rearrange title order in Velocity context
    
    This closes #157
---
 .../doxia/siterenderer/DefaultSiteRenderer.java    | 25 +++++++++++++---------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
index 544b6b9..7e41c4a 100644
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
@@ -547,22 +547,27 @@ public class DefaultSiteRenderer implements Renderer {
         // Add infos from document
         context.put("authors", content.getAuthors());
 
-        context.put("shortTitle", content.getTitle());
+        String shortTitle = content.getTitle();
+        context.put("shortTitle", shortTitle);
 
-        // DOXIASITETOOLS-70: Prepend the project name to the title, if any
-        StringBuilder title = new StringBuilder();
-        if (siteRenderingContext.getSiteModel() != null
-                && StringUtils.isNotEmpty(siteRenderingContext.getSiteModel().getName())) {
-            title.append(siteRenderingContext.getSiteModel().getName());
+        String projectTitle = null;
+        if (StringUtils.isNotEmpty(siteRenderingContext.getSiteModel().getName())) {
+            projectTitle = siteRenderingContext.getSiteModel().getName();
         } else if (StringUtils.isNotEmpty(siteRenderingContext.getDefaultTitle())) {
-            title.append(siteRenderingContext.getDefaultTitle());
+            projectTitle = siteRenderingContext.getDefaultTitle();
         }
 
-        if (title.length() > 0 && StringUtils.isNotEmpty(content.getTitle())) {
+        StringBuilder title = new StringBuilder();
+        if (StringUtils.isNotEmpty(shortTitle)) {
+            title.append(shortTitle);
+        }
+
+        if (title.length() > 0 && StringUtils.isNotEmpty(projectTitle)) {
             title.append(" \u2013 "); // Symbol Name: En Dash
         }
-        if (StringUtils.isNotEmpty(content.getTitle())) {
-            title.append(content.getTitle());
+
+        if (StringUtils.isNotEmpty(projectTitle)) {
+            title.append(projectTitle);
         }
 
         context.put("title", title.length() > 0 ? title.toString() : null);