This is an automated email from the ASF dual-hosted git repository.
sjaranowski 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 2932346 [MSKINS-263] Fix empty image class
2932346 is described below
commit 2932346f9c648c4cc36d222f3c7ee35d26e3b881
Author: Slawomir Jaranowski <[email protected]>
AuthorDate: Sat Mar 8 19:09:55 2025 +0100
[MSKINS-263] Fix empty image class
---
src/it/sidebar/verify.groovy | 7 +++++++
src/it/topbar/verify.groovy | 7 +++++++
src/main/resources/META-INF/maven/site-macros.vm | 10 +++++-----
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/src/it/sidebar/verify.groovy b/src/it/sidebar/verify.groovy
index a4af397..ba3e412 100644
--- a/src/it/sidebar/verify.groovy
+++ b/src/it/sidebar/verify.groovy
@@ -29,3 +29,10 @@ assert html.contains( '<li><a
href="summary.html">Summary</a>' )
assert html.contains( '<li><a href="plugins.html">Plugins</a></li>' )
// breadcrumb
assert html.contains( '<li><a href="https://www.apache.org/">Apache</a><span
class="divider">/</span></li>' )
+
+// MSKINS-263 - image without class in banner
+assert html.contains('<div class="pull-left"><div id="bannerLeft"><h1><a
href="https://www.apache.org/"><img
src="../../../images/apache-maven-project.png" /></a></h1></div></div>')
+assert html.contains('<div class="pull-right"><div id="bannerRight"><h1><a
href="../../../"><img src="../../../images/maven-logo-black-on-white.png"
/></a></h1></div></div>')
+
+// and image with class
+assert html.contains('<a href="https://maven.apache.org/" class="builtBy"
target="_blank"><img class="builtBy" alt="Built by Maven"
src="./images/logos/maven-feather.png" /></a>')
diff --git a/src/it/topbar/verify.groovy b/src/it/topbar/verify.groovy
index fed327e..7be8d80 100644
--- a/src/it/topbar/verify.groovy
+++ b/src/it/topbar/verify.groovy
@@ -29,3 +29,10 @@ assert html.contains( '<li><a
href="summary.html">Summary</a></li>' )
assert html.contains( '<li><a href="plugins.html">Plugins</a></li>' )
// breadcrumb
assert html.contains( '<li><a href="https://www.apache.org/">Apache</a><span
class="divider">/</span></li>' )
+
+// MSKINS-263 - image without class in banner
+assert html.contains('<div class="pull-left"><div id="bannerLeft"><h1><a
href="https://www.apache.org/"><img
src="../../../images/apache-maven-project.png" /></a></h1></div></div>')
+assert html.contains('<div class="pull-right"><div id="bannerRight"><h1><a
href="../../../"><img src="../../../images/maven-logo-black-on-white.png"
/></a></h1></div></div>')
+
+// and image with class
+assert html.contains('<a href="https://maven.apache.org/" class="builtBy"
target="_blank"><img class="builtBy" alt="Built by Maven"
src="./images/logos/maven-feather.png" /></a>')
diff --git a/src/main/resources/META-INF/maven/site-macros.vm
b/src/main/resources/META-INF/maven/site-macros.vm
index 54c60ee..ef880af 100644
--- a/src/main/resources/META-INF/maven/site-macros.vm
+++ b/src/main/resources/META-INF/maven/site-macros.vm
@@ -85,11 +85,11 @@
#* *##set( $wrapElem = $elemOnEmptyHref )
#**##end
#**##if( $overrideElemClass && $overrideElemClass != "" )
-#* *##set( $class = ' class="' + $overrideElemClass + '"' )
+#* *##set( $elementClass = ' class="' + $overrideElemClass + '"' )
#**##else
-#* *##set( $class = "" )
+#* *##set( $elementClass = "" )
#**##end
-#**##if( $wrap )<$wrapElem#end$href$target$class#if( $wrap )>#end##
+#**##if( $wrap )<$wrapElem#end$href$target$elementClass#if( $wrap )>#end##
#**##if( $link.image && !$omitImage )
#* *##set( $img = "#image( $link.image $imageClass )" )
#* *##if( $link.image.position == "left" )
@@ -111,7 +111,7 @@
#**##link ( $link $null true )
#end
##
-#macro( image $image $class )
+#macro( image $image $imageClass )
#* *##if( !$site.isLink( $image.src ) )
#* *##set( $src = $PathTool.calculateLink( $image.src, $relativePath ) )
#* *##set( $src = $src.replace( '\\', '/' ) )
@@ -140,7 +140,7 @@
#* *##set( $style = "" )
#* *##end
#* *##set( $style = "$width$height$style" )
-<img#if( $class ) class="$class"#end$src$alt#if( $style ) style="$style"#end
/>##
+<img#if( $imageClass ) class="$imageClass"#end$src$alt#if( $style )
style="$style"#end />##
#end
##
#macro( banner $banner $id )