blob: 911047fadf7d776872d85bb8ef4c95b31a713088 [file] [log] [blame]
## Licensed to the Apache Software Foundation (ASF) under one
## or more contributor license agreements. See the NOTICE file
## distributed with this work for additional information
## regarding copyright ownership. The ASF licenses this file
## to you under the Apache License, Version 2.0 (the
## "License"); you may not use this file except in compliance
## with the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing,
## software distributed under the License is distributed on an
## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
## KIND, either express or implied. See the License for the
## specific language governing permissions and limitations
## under the License.
##
#macro ( link $href $name $target $img $position $alt $border $width $height $title )
#**##set ( $linkTitle = ' title="' + $name + '"' )
#**##if( $target )
#* *##set ( $linkTarget = ' target="' + $target + '"' )
#**##else
#* *##set ( $linkTarget = "" )
#**##end
#**##if ( $decoration.isLink( $href ) )
#* *##set ( $linkClass = ' class="externalLink"' )
#**##else
#* *##set ( $linkClass = "" )
#**##end
#**##if ( $img )
#* *##if ( $position == "left" )
#* *#<a href="$href"$linkClass$linkTarget$linkTitle>#image($img $alt $border $width $height $title)$name</a>##
#* *##else
#* *#<a href="$href"$linkClass$linkTarget$linkTitle>$name #image($img $alt $border $width $height $title)</a>##
#* *##end
#**##else
#* *#<a href="$href"$linkClass$linkTarget$linkTitle>$name</a>##
#**##end
#end
##
#macro ( image $img $alt $border $width $height $title )
#**##if( $img )
#* *##if ( !$decoration.isLink( $img ) )
#* *##set ( $imgSrc = $PathTool.calculateLink( $img, $relativePath ) )
#* *##set ( $imgSrc = $imgSrc.replaceAll( '\\', '/' ) )
#* *##set ( $imgSrc = ' src="' + $imgSrc + '"' )
#* *##else
#* *##set ( $imgSrc = ' src="' + $img + '"' )
#* *##end
#* *##if( $alt )
#* *##set ( $imgAlt = ' alt="' + $alt + '"' )
#* *##else
#* *##set ( $imgAlt = ' alt=""' )
#* *##end
#* *##if( $border )
#* *##set ( $imgBorder = ' border="' + $border + '"' )
#* *##else
#* *##set ( $imgBorder = "" )
#* *##end
#* *##if( $width )
#* *##set ( $imgWidth = ' width="' + $width + '"' )
#* *##else
#* *##set ( $imgWidth = "" )
#* *##end
#* *##if( $height )
#* *##set ( $imgHeight = ' height="' + $height + '"' )
#* *##else
#* *##set ( $imgHeight = "" )
#* *##end
#* *##if( $title )
#* *##set ( $imgTitle = ' title="' + $title + '"' )
#* *##else
#* *##set ( $imgTitle = "" )
#* *##end
#* *#<img class="imageLink"$imgSrc$imgAlt$imgBorder$imgWidth$imgHeight$imgTitle/>##
#**##end
#end
##
#macro ( banner $banner $id )
#**##if ( $banner )
#* *##if( $banner.href )
#* *##set ( $hrf = $banner.href )
#* *##if ( !$decoration.isLink( $hrf ) )
#* *##set ( $hrf = $PathTool.calculateLink( $hrf, $relativePath ) )
#* *##set ( $hrf = $hrf.replaceAll( '\\', '/' ) )
#* *##if ( ( $hrf == '' ) )
#* *##set ( $hrf = './' )
#* *##end
#* *##end
#* *#<a href="$hrf" id="$id"#if( $banner.alt ) title="$banner.alt"#end>##
#* *##else
#* *#<div id="$id">
#* *##end
##
#* *##if( $banner.src )
#* *##set ( $src = $banner.src )
#* *##if ( !$decoration.isLink( $src ) )
#* *##set ( $src = $PathTool.calculateLink( $src, $relativePath ) )
#* *##set ( $src = $src.replaceAll( '\\', '/' ) )
#* *##end
#* *##if ( $banner.alt )
#* *##set ( $alt = ' alt="' + $banner.alt + '"' )
#* *##elseif ( $banner.name )
#* *##set ( $alt = ' alt="' + $banner.name + '"' )
#* *##else
#* *##set ( $alt = ' alt=""' )
#* *##end
#* *##if( $banner.border )
#* *##set ( $imgBorder = ' border="' + $banner.border + '"' )
#* *##else
#* *##set ( $imgBorder = "" )
#* *##end
#* *##if( $banner.width )
#* *##set ( $imgWidth = ' width="' + $banner.width + '"' )
#* *##else
#* *##set ( $imgWidth = "" )
#* *##end
#* *##if( $banner.height )
#* *##set ( $imgHeight = ' height="' + $banner.height + '"' )
#* *##else
#* *##set ( $imgHeight = "" )
#* *##end
#* *##if( $banner.title )
#* *##set ( $bannerTitle=' title="' + $banner.title + '"' )
#* *##else
#* *##set ( $bannerTitle="" )
#* *##end
#* *#<img src="$src" $alt$bannerTitle$imgBorder$imgWidth$imgHeight/>##
#* *##else
#* *#$banner.name
#* *##end
##
#* *##if( $banner.href )
#* *#</a>
#* *##else
#* *#</div>
#* *##end
#**##end
#end
##
#macro ( links $links )
#**##set ( $counter = 0 )
#**##foreach( $item in $links )
#* *##set ( $counter = $counter + 1 )
#* *##set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
#* *##set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
#* *##link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height $item.title )
#* *##if ( $links.size() > $counter )
#* *# |
#* *##end
#**##end
#end
##
#macro ( breadcrumbs $breadcrumbs )
#**##foreach( $item in $breadcrumbs )
#* *##set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
#* *##set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
#* *##if ( ( $currentItemHref == '' ) )
#* *##set ( $currentItemHref = './' )
#* *##end
##
#* *##link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height $item.title )
#**# &gt;
#**##end
#**#$shortTitle
#**##if( $decoration.edit && $docRenderingContext.editable )
#* *# <a href="$docRenderingContext.getDoxiaSourcePath( $decoration.edit )">[edit]</a>
#**##end
#end
##
#macro ( displayTree $display $item )
#**##if ( $item && $item.items && $item.items.size() > 0 )
#* *##foreach( $subitem in $item.items )
#* *##set ( $subitemHref = $PathTool.calculateLink( $subitem.href, $relativePath ) )
#* *##set ( $subitemHref = $subitemHref.replaceAll( '\\', '/' ) )
##
#* *##if ( $alignedFileName == $subitemHref )
#* *##set ( $display = true )
#* *##end
##
#* *##displayTree( $display $subitem )
#* *##end
#**##end
#end
##
#macro ( menuItem $item $indent )
#**##set ( $collapse = "none" )
#**##set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
#**##set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
##
#**##if ( $item && $item.items && $item.items.size() > 0 )
#* *##if ( $item.collapse == false )
#* *##set ( $collapse = "expanded" )
#* *##else
#* *### By default collapsed
#* *##set ( $collapse = "collapsed" )
#* *##end
##
#* *##set ( $display = false )
#* *##displayTree( $display $item )
##
#* *##if ( $alignedFileName == $currentItemHref || $display )
#* *##set ( $collapse = "expanded" )
#* *##end
#**##end
$indent <li class="$collapse">##
#**##if ( $item.img )
#* *##if ( $item.position == "left" )
#* *##if ( $alignedFileName == $currentItemHref )
#* *#<strong>#image($item.img $item.alt $item.border $item.width $item.height $item.title) $item.name</strong>
#* *##else
#* *##link($currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height $item.title)
#* *##end
#* *##else
#* *##if ( $alignedFileName == $currentItemHref )
#* *#<strong>$item.name #image($item.img $item.alt $item.border $item.width $item.height $item.title)</strong>
#* *##else
#* *##link($currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height $item.title)
#* *##end
#* *##end
#**##else
#* *##if ( $alignedFileName == $currentItemHref )
#* *#<strong>$item.name</strong>##
#* *##else
#* *##link( $currentItemHref $item.name $item.target $item.img $item.position $item.alt $item.border $item.width $item.height $item.title )
#* *##end
#**##end
#**##if ( $item && $item.items && $item.items.size() > 0 )
#* *##if ( $collapse == "expanded" )
$indent <ul>
#* *##foreach( $subitem in $item.items )
#* *##menuItem( $subitem "$indent " )
#* *##end
$indent </ul>##
#* *##end
#**##end
#**#</li>
#end
##
#macro ( mainMenu $menus )
#**##foreach( $menu in $menus )
#* *##if ( $menu.name )
#* *##if ( $menu.img )
#* *##if( $menu.position )
#* *##set ( $position = $menu.position )
#* *##else
#* *##set ( $position = "left" )
#* *##end
##
#* *##if ( !$decoration.isLink( $menu.img ) )
#* *##set ( $src = $PathTool.calculateLink( $menu.img, $relativePath ) )
#* *##set ( $src = $src.replaceAll( '\\', '/' ) )
#* *##set ( $src = ' src="' + $src + '"' )
#* *##else
#* *##set ( $src = ' src="' + $menu.img + '"' )
#* *##end
##
#* *##if( $menu.alt )
#* *##set ( $alt = ' alt="' + $menu.alt + '"' )
#* *##else
#* *##set ( $alt = ' alt="' + $menu.name + '"' )
#* *##end
##
#* *##if( $menu.border )
#* *##set ( $border = ' border="' + $menu.border + '"' )
#* *##else
#* *##set ( $border = ' border="0"' )
#* *##end
##
#* *##if( $menu.width )
#* *##set ( $width = ' width="' + $menu.width + '"' )
#* *##else
#* *##set ( $width = "" )
#* *##end
#* *##if( $menu.height )
#* *##set ( $height = ' height="' + $menu.height + '"' )
#* *##else
#* *##set ( $height = "" )
#* *##end
#* *##if( $menu.title )
#* *##set ( $title = ' title="' + $menu.title + '"' )
#* *##else
#* *##set ( $title = "" )
#* *##end
##
#* *##set ( $img = '<img class="imageLink"' + $src + $alt + $border + $width + $height + $title + "/>" )
##
#* *##if ( $position == "left" )
<h5>$img $menu.name</h5>
#* *##else
<h5>$menu.name $img</h5>
#* *##end
#* *##else
<h5>$menu.name</h5>
#* *##end
#* *##end
#* *##if ( $menu.items && $menu.items.size() > 0 )
<ul>
#* *##foreach( $item in $menu.items )
#* *##menuItem( $item '' )
#* *##end
</ul>
#* *##end
#**##end
#end
##
#macro ( copyright )
#**##if ( $project )
#* *##if ( ${project.organization} && ${project.organization.name} )
#* *##set ( $period = "" )
#* *##else
#* *##set ( $period = "." )
#* *##end
##
#* *##set ( $currentYear = ${currentDate.year} + 1900 )
##
#* *##if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) )
${project.inceptionYear}&#x2013;${currentYear}${period}##
#* *##else
${currentYear}${period}##
#* *##end
##
#* *##if ( ${project.organization} )
#* *##if ( ${project.organization.name} && ${project.organization.url} )
#* *# <a href="$project.organization.url">${project.organization.name}</a>.
#* *##elseif ( ${project.organization.name} )
#* *#${project.organization.name}.
#* *##end
#* *##end
#**##end
#end
##
#macro ( publishDate $position $decorationPublishDate $version )
#**##if ( $publishDate )
#* *##set ( $dateValue = $dateFormat.format( $publishDate ) )
#**##elseif ( $decoration.custom.getChild( 'publishDate' ) )
#* *##set ( $dateValue = $decoration.custom.getChild( 'publishDate' ).getValue() )
#**##else
#* *##set ( $dateValue = $dateFormat.format( $currentDate ) )
#**##end
##
#**##set ( $datePosition = $decorationPublishDate.position )
#**##set ( $versionPosition = $version.position )
##
#**##set ( $breadcrumbs = $decoration.body.breadcrumbs )
#**##set ( $links = $decoration.body.links )
##
#**##if ( $datePosition.equalsIgnoreCase( "right" ) && $links && $links.size() > 0 )
#* *##set ( $prefix = "&#xA0;|" )
#**##else
#* *##set ( $prefix = "" )
#**##end
##
#**##if ( $datePosition.equalsIgnoreCase( $position ) )
#* *##if ( ( $datePosition.equalsIgnoreCase( "right" ) ) || ( $datePosition.equalsIgnoreCase( "bottom" ) ) )
$prefix <span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateValue</span>
#* *##if ( $versionPosition.equalsIgnoreCase( $position ) )
&#xA0;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
#* *##end
#* *##elseif ( ( $datePosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $datePosition.equalsIgnoreCase( "navigation-top" ) ) )
<div id="lastPublished">
<span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateValue</span>
#* *##if ( $versionPosition.equalsIgnoreCase( $position ) )
&#xA0;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
#* *##end
</div>
#* *##elseif ( $datePosition.equalsIgnoreCase( "left" ) )
<div class="xleft">
<span id="publishDate">$i18n.getString( "site-renderer", $locale, "template.lastpublished" ): $dateValue</span>
#* *##if ( $versionPosition.equalsIgnoreCase( $position ) )
&#xA0;| <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
#* *##end
#* *##if ( $breadcrumbs && $breadcrumbs.size() > 0 )
| #breadcrumbs( $breadcrumbs )
#* *##end
</div>
#* *##end
#**##elseif ( $versionPosition.equalsIgnoreCase( $position ) )
#* *##if ( ( $versionPosition.equalsIgnoreCase( "right" ) ) || ( $versionPosition.equalsIgnoreCase( "bottom" ) ) )
$prefix <span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
#* *##elseif ( ( $versionPosition.equalsIgnoreCase( "navigation-bottom" ) ) || ( $versionPosition.equalsIgnoreCase( "navigation-top" ) ) )
<div id="lastPublished">
<span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
</div>
#* *##elseif ( $versionPosition.equalsIgnoreCase( "left" ) )
<div class="xleft">
<span id="projectVersion">$i18n.getString( "site-renderer", $locale, "template.version" ): ${project.version}</span>
#* *##if ( $breadcrumbs && $breadcrumbs.size() > 0 )
| #breadcrumbs( $breadcrumbs )
#* *##end
</div>
#* *##end
#**##elseif ( $position.equalsIgnoreCase( "left" ) )
#* *##if ( $breadcrumbs && $breadcrumbs.size() > 0 )
<div class="xleft">
#* *##breadcrumbs( $breadcrumbs )
</div>
#* *##end
#**##end
#end
##
#macro ( poweredByLogo $poweredBy )
#**##if( $poweredBy )
#* *##foreach ($item in $poweredBy)
#* *##if( $item.href )
#* *##set ( $href = $PathTool.calculateLink( $item.href, $relativePath ) )
#* *##set ( $href = $href.replaceAll( '\\', '/' ) )
#* *##else
#* *##set ( $href="http://maven.apache.org/" )
#* *##end
##
#* *##if( $item.name )
#* *##set ( $name = $item.name )
#* *##else
#* *##set ( $name = $i18n.getString( "site-renderer", $locale, "template.builtby" ) )
#* *##set ( $name = "${name} Maven" )
#* *##end
##
#* *##if( $item.img )
#* *##set ( $img = $item.img )
#* *##else
#* *##set ( $img = "images/logos/maven-feather.png" )
#* *##end
##
#* *##if ( !$decoration.isLink( $img ) )
#* *##set ( $img = $PathTool.calculateLink( $img, $relativePath ) )
#* *##set ( $img = $img.replaceAll( '\\', '/' ) )
#* *##end
##
#* *##if( $item.alt )
#* *##set ( $alt = ' alt="' + $item.alt + '"' )
#* *##else
#* *##set ( $alt = ' alt="' + $name + '"' )
#* *##end
##
#* *##if( $item.border )
#* *##set ( $border = ' border="' + $item.border + '"' )
#* *##else
#* *##set ( $border = "" )
#* *##end
##
#* *##if( $item.width )
#* *##set ( $width = ' width="' + $item.width + '"' )
#* *##else
#* *##set ( $width = "" )
#* *##end
#* *##if( $item.height )
#* *##set ( $height = ' height="' + $item.height + '"' )
#* *##else
#* *##set ( $height = "" )
#* *##end
#* *##if( $item.title )
#* *##set ( $title = ' title="' + $item.title + '"' )
#* *##else
#* *##set ( $title = "" )
#* *##end
##
<a href="$href" title="$name" class="poweredBy">
<img class="poweredBy" $alt src="$img" $border $width $height $title />
</a>
#* *##end
#* *##if( $poweredBy.isEmpty() )
<a href="http://maven.apache.org/" title="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" class="poweredBy">
<img class="poweredBy" alt="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" src="$relativePath/images/logos/maven-feather.png" />
</a>
#* *##end
#**##else
<a href="http://maven.apache.org/" title="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" class="poweredBy">
<img class="poweredBy" alt="$i18n.getString( "site-renderer", $locale, "template.builtby" ) Maven" src="$relativePath/images/logos/maven-feather.png" />
</a>
#**##end
#end
##
#macro ( googleAnalytics $accountId )
#**##if( $accountId && $accountId != "" )
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '$accountId', 'auto');
ga('send', 'pageview');
ga('set', 'anonymizeIp', true);
ga('set', 'forceSSL', true);
</script>
#**##end
#end
##
#macro( generatedBy )
Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end
#end
##