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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-fluido-skin.git


The following commit(s) were added to refs/heads/master by this push:
     new fa5a3b5  Put a decorative banner image in a div instead of an empty h1
fa5a3b5 is described below

commit fa5a3b52393ccf680bf9c8b2a51adf879b3b71e9
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Nov 2 14:29:51 2026 +0000

    Put a decorative banner image in a div instead of an empty h1
---
 src/it/sidebar/verify.groovy                     | 2 +-
 src/it/topbar/verify.groovy                      | 2 +-
 src/main/resources/META-INF/maven/site-macros.vm | 7 ++++++-
 src/main/resources/css/maven-theme.css           | 8 ++++++++
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/it/sidebar/verify.groovy b/src/it/sidebar/verify.groovy
index a0a7efc..6571a7c 100644
--- a/src/it/sidebar/verify.groovy
+++ b/src/it/sidebar/verify.groovy
@@ -32,4 +32,4 @@ assert html.contains( '<li><a 
href="https://www.apache.org/";>Apache</a><span cla
 
 // MSKINS-263 - image without class in banner
 assert html.contains('<div class="pull-left"><div id="bannerLeft"><h1><a 
href="../../../"><img 
src="../../../images/apache-maven-project-light-theme.svg" alt="Apache Maven 
Fluido Skin IT, sidebar layout" style="width: 489px;height: 83px;" 
/></a></h1></div></div>')
-assert html.contains('<div class="pull-right"><div id="bannerRight"><h1><img 
src="../../../images/logos/MavenLogoLeaf.svg" alt="" style="width: 
340px;height: 83px;" /></h1></div></div>')
+assert html.contains('<div class="pull-right"><div id="bannerRight"><div 
class="banner-decoration"><img src="../../../images/logos/MavenLogoLeaf.svg" 
alt="" style="width: 340px;height: 83px;" /></div></div></div>')
diff --git a/src/it/topbar/verify.groovy b/src/it/topbar/verify.groovy
index 4602ad4..cc0a7ca 100644
--- a/src/it/topbar/verify.groovy
+++ b/src/it/topbar/verify.groovy
@@ -32,7 +32,7 @@ assert html.contains( '<li><a 
href="https://www.apache.org/";>Apache</a><span cla
 
 // MSKINS-263 - image without class in banner
 assert html.contains('<div class="pull-left"><div id="bannerLeft"><h1><a 
href="../../../"><img 
src="../../../images/apache-maven-project-light-theme.svg" alt="Apache Maven 
Fluido Skin IT, topbar layout" style="width: 489px;height: 83px;" 
/></a></h1></div></div>')
-assert html.contains('<div class="pull-right"><div id="bannerRight"><h1><img 
src="../../../images/logos/MavenLogoLeaf.svg" alt="" style="width: 
340px;height: 83px;" /></h1></div></div>')
+assert html.contains('<div class="pull-right"><div id="bannerRight"><div 
class="banner-decoration"><img src="../../../images/logos/MavenLogoLeaf.svg" 
alt="" style="width: 340px;height: 83px;" /></div></div></div>')
 
 // edit link after the page title: the SVG icon, copied with the site
 assert html =~ /<a href="[^"]+"><img src="\.\/images\/edit\.svg" alt="Edit" 
width="14" height="14" \/><\/a><\/li>/
diff --git a/src/main/resources/META-INF/maven/site-macros.vm 
b/src/main/resources/META-INF/maven/site-macros.vm
index 69abc29..5af36aa 100644
--- a/src/main/resources/META-INF/maven/site-macros.vm
+++ b/src/main/resources/META-INF/maven/site-macros.vm
@@ -155,7 +155,12 @@
 #*  *##else
 #*    *##set( $bannerAlt = "" )
 #*  *##end
-#*  *#<div id="$id"><h1>#link( $banner $null false $null "set" $null "" 
)</h1></div>##
+#*  *##if( $banner.name || $banner.href || $banner.image.alt )
+#*    *#<div id="$id"><h1>#link( $banner $null false $null "set" $null "" 
)</h1></div>##
+#*  *##else
+## an unlinked image without a name or alt text is decorative: no heading, so 
screen readers do not announce an empty one
+#*    *#<div id="$id"><div class="banner-decoration">#link( $banner $null 
false $null "set" $null "" )</div></div>##
+#*  *##end
 #*  *##set( $inBanner = false )
 #**##end
 #end
diff --git a/src/main/resources/css/maven-theme.css 
b/src/main/resources/css/maven-theme.css
index 3532749..41534d5 100644
--- a/src/main/resources/css/maven-theme.css
+++ b/src/main/resources/css/maven-theme.css
@@ -178,6 +178,14 @@ pre .hljs-ln td.hljs-ln-code {
   padding: 2px 0;
 }
 
+/* site.vm puts a decorative banner in a div instead of an empty h1; give it 
the h1's box so the banners stay aligned */
+#banner .banner-decoration {
+  margin: 10px 0;
+  font-size: 38.5px;
+  font-weight: bold;
+  line-height: 40px;
+}
+
 /* on phones the right banner sits below the left one and pushes the page 
down; keep only the left one */
 @media (max-width: 767px) {
   #banner .pull-left:not(:empty) + .pull-right {

Reply via email to