META-INF.maven.site.vm Maven / Gradle / Ivy
Go to download
Reflow is an Apache Maven site skin built on Twitter Bootstrap.
It allows various structural and stylistic customizations to create
a modern-looking Maven-generated website. Requires Reflow Velocity Tools.
##
## Copyright 2012-2017 Andrius Velykis
##
## Licensed 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.
##
#parse( "site-macros.vm" )##
#* *##if ( $project.name && $project.name != '' )#*
*##set ( $defaultProjectName = $project.name )#*
*##else#*
*##set ( $defaultProjectName = $project.artifactId )#*
*##end#*
## resolve date position, or set the default otherwise (bottom)
## Note, that currently we do not support "navigation-top" position for either publishDate or version.
*##set ( $datePosition = "bottom" )#*
*##if ( $decoration.publishDate.position )#*
*##set ( $datePosition = $decoration.publishDate.position )#*
*##end#*
## resolve version position, or set the default otherwise (bottom)
*##set ( $versionPosition = "bottom" )#*
*##if ( $decoration.version.position )#*
*##set ( $versionPosition = $decoration.version.position )#*
*##end#*
*##if ( $decoration.publishDate.position )#*
*##set ( $datePosition = $decoration.publishDate.position )#*
*##else#*
*##set ( $datePosition = "bottom" )#*
*##end#*
## Try resolving site URL from the POM.
## This can help with resolution of relative links, needed for 'active' link calculations,
## e.g. to normalise the relative links in menus.
*##if ( $project.url && $project.url != '' )#*
*##set ( $projectSiteLoc = $project.url )#*
*##if ( !$projectSiteLoc.endsWith("/") )#*
## ensure that the directory is uniform
*##set ( $projectSiteLoc = "$projectSiteLoc/" )#*
*##end#*
*##else#*
## dummy project URL is used to provide a good base to resolve relative links with ../
*##set ( $projectSiteLoc = "http://dummy.parent.url/" )#*
*##end#*
## absolute location of the current file
*##set ( $currentFileLoc = $uriTool.toURI( "$projectSiteLoc" ).resolve( "$currentFileName" ).toString() )#*
## Check if is set on the page or globally, then display Table of Contents
*##if ( $config.isValue( "toc", "top" ) )#*
*##set ( $tocTop = true )#*
*##else#*
*##set ( $tocTop = false )#*
*##end#*
*##if ( $config.isValue( "toc", "sidebar" ) )#*
*##set ( $tocSidebar = true )#*
*##else#*
*##set ( $tocSidebar = false )#*
*##end#*
*##if ( !$config.not( "imgLightbox" ) )#*
## lightbox is enabled by default, so check for false and negate
## TODO explain more?
*##set ( $bodyContent = $htmlTool.setAttr( $bodyContent, "a[href$=jpg], a[href$=JPG], a[href$=jpeg], a[href$=JPEG], a[href$=png], a[href$=gif], a[href$=bmp]:has(img)", "data-lightbox", "page" ))#*
*##end#*
*##if ( !$config.not( "html5Anchor" ) )#*
## HTML5-style anchors are enabled by default, so check for false and negate
*##set ( $bodyContent = $htmlTool.headingAnchorToId( $bodyContent ) )#*
*##end#*
*##if ( !$config.not( "bootstrapCss" ) )#*
## Bootstrap CSS class conversion is enabled by default, so check for false and negate
*##set ( $bodyContent = $htmlTool.addClass( $bodyContent, "table.bodyTable", ["table", "table-striped", "table-hover"] ) )#*
## image is responsive by default
*##set ( $bodyContent = $htmlTool.addClass( $bodyContent, "img", ["img-responsive"] ) )#*
*##set ( $bodyContent = $htmlTool.fixTableHeads( $bodyContent ) )#*
*##end#*
#
*##if ( !$config.not( "bootstrapIcons" ) )#*
## Bootstrap Icons are enabled by default, so check for false and negate
*##depsCollapse ()#*
*##set ( $iconReplacements = { 'img[src$=images/add.gif]' : '',
'img[src$=images/remove.gif]' : '',
'img[src$=images/fix.gif]' : '',
'img[src$=images/update.gif]' : '',
'img[src$=images/icon_help_sml.gif]' : '',
'img[src$=images/icon_success_sml.gif]' : '',
'img[src$=images/icon_warning_sml.gif]' : '',
'img[src$=images/icon_error_sml.gif]' : '',
'img[src$=images/icon_info_sml.gif]' : '' } )#*
*##set ( $bodyContent = $htmlTool.replaceAll( $bodyContent, $iconReplacements ) )#*
*##end#*
*##if ( $tocTop || $tocSidebar )#*
## Ensure IDs on all headings to refer to them in TOC
*##set ( $bodyContent = $htmlTool.ensureHeadingIds( $config.fileId, $bodyContent, "_" ) )#*
*##set ( $tocItems = $htmlTool.headingTree( $bodyContent, $config.getChildren( $config.sections ) ) )#*
*##end#*
*#
## generate a short title if one does not exist or is specified explicitly
#* if specified explicitly, use that
*##set ( $shortTitleGenerated = false )#*
*##if ( !$config.not( "shortTitle" ) && ( !$shortTitle || $shortTitle == ''
|| ($config.shortTitle && !$config.isValue("shortTitle", "generate") && !$config.isValue("shortTitle", "true") ) ) )#*
Page title generation is enabled by default, so check for false and negate
*##if ( $config.shortTitle && !$config.isValue("shortTitle", "generate") && !$config.isValue("shortTitle", "true") )#*
Use explicitly specified title
*##set ( $shortTitle = $config.shortTitle.getValue() )#*
*##set ( $shortTitleGenerated = true )#*
*##else#*
## Generate the title.
## To generate the title, we take the contents of the first h1 tag in the document.
## If it does not exist, we take the contents of the first h2 tag.
*##set ( $hTexts = $htmlTool.text( $bodyContent, "h1" ) )#*
*##if ( $hTexts.size() == 0 )#*
*##set ( $hTexts = $htmlTool.text( $bodyContent, "h2" ) )#*
*##end#*
*##if ( $hTexts.size() > 0 )#*
*##set ( $shortTitle = $hTexts.get(0) )#*
*##set ( $shortTitleGenerated = true )#*
*##end#*
*##end#*
*##end#*
## If title template is provided, use it to generate title.
## Also regenerate title if a new short title was generated.
*##if ( $config.titleTemplate || $shortTitleGenerated )#*
read the title template from configuration
*##if ( $config.titleTemplate )#*
*##set ( $titleTemplate = $config.titleTemplate.getValue() )#*
*##else#*
## default template is "projectName - shortTitle"
*##set ( $titleTemplate = "%1${esc.d}s - %2${esc.d}s" )#*
*##end#*
## the company/project name is retrieved from decoration ( )
## or from the project itself
*##if ( $decoration.name )#*
*##set ( $titleProjectName = $decoration.name )#*
*##elseif ( $project.name )#*
*##set ( $titleProjectName = $project.name )#*
*##else#*
*##set ( $titleProjectName = "" )#*
*##end#*
## use String.format() to create new title
*##set ( $title = $titleTemplate.format( $titleTemplate, $titleProjectName, $shortTitle ) )#*
*##end##
##
$title
#* *##foreach ( $author in $authors )##
#* *##end#*
*##if ( $locale )##
#* *##end#*
## Use config option http://mysite.com/
*##if ( $config.absoluteResourceURL && $config.absoluteResourceURL.getValue() != '' )#*
*##currentFileRelativeLink ( $config.absoluteResourceURL.getValue() )#*
*##set ( $resourcePath = $currentFileRelativeLink )#*
*##else#*
*##set ( $resourcePath = $relativePath )#*
*##end#*
## Config option true to force CDN-less Bootstrap & jQuery
*##if ( $config.is( "localResources" ) )#*
*##set ( $localResources = true )#*
*##else#*
*##set ( $localResources = false )#*
*##end#*
## for 'site' theme, use local CSS/Javascript. This allows users to use their own Bootstrap configs.
## Otherwise, load the default or Bootswatch themes from BootstrapCDN
*##if ( $localResources || ( $config.theme && "site" == $config.theme.getValue() ) )#*
*##set ( $bootstrapCssPath = "$resourcePath/css" )#*
*##set ( $bootstrapCssResponsivePath = $bootstrapCssPath )#*
*##set ( $bootstrapCssCombined = false )#*
*##set ( $bootstrapJsPath = "$resourcePath/js" )#*
*##else#*
*##if ($config.bootstrapVersion )#*
*##set ( $bootstrapVersion = $config.bootstrapVersion.getValue() )#*
*##else#*
*##set ( $bootstrapVersion = "@bootstrapVersion@" )#*
*##end#*
*##if ($config.bootswatchVersion )#*
*##set ( $bootswatchVersion = $config.bootswatchVersion.getValue() )#*
*##else#*
*##set ( $bootswatchVersion = "@bootswatchVersion@" )#*
*##end#*
## use Bootstrap theme from BootstrapCDN (loaded over network)
*##if ( $config.theme && $config.theme.getValue().startsWith("bootswatch-") )#*
*##set ( $bootswatchTheme = $config.theme.getValue().substring(11) )#*
*##else#*
*##set ( $bootswatchTheme = false )#*
*##end#*
*##if ( $bootswatchTheme )#*
*##set ( $bootstrapCssPath = "https://netdna.bootstrapcdn.com/bootswatch/${bootswatchVersion}/$bootswatchTheme" )#*
*##set ( $bootstrapCssResponsivePath = "https://netdna.bootstrapcdn.com/twitter-bootstrap/${bootswatchVersion}/css" )#*
*##set ( $bootstrapCssCombined = false )#*
*##else#*
*##set ( $bootstrapCssPath = "https://netdna.bootstrapcdn.com/twitter-bootstrap/${bootstrapVersion}/css" )#*
*##set ( $bootstrapCssCombined = true )#*
*##end#*
*##set ( $bootstrapJsPath = "https://netdna.bootstrapcdn.com/twitter-bootstrap/${bootstrapVersion}/js" )#*
*##end
##
#* *##if ( !$bootstrapCssCombined )#*
*### if Bootstrap CSS is not combined, add bootstrap-responsive CSS ##
#* *##end#*
*##if ( $bootswatchTheme )#*
## for Bootswatch themes, add bootswatch.css *#
#* *##else##
#* *##end##
##
## disable CDN-loaded highlightJs altogether if `localResources` is selected.
#* it will need to be added manually
*##if ( !$localResources && $config.is( "highlightJs" ) )#*
*##set ( $highlightJs = true )#*
*##else#*
*##set ( $highlightJs = false )#*
*##end#*
*##if ( $config.highlightJsVersion )#*
*##set ( $highlightJsVersion = $config.highlightJsVersion.getValue() )#*
*##else#*
*##set ( $highlightJsVersion = "@highlightJsVersion@" )#*
*##end#*
*##if ( $highlightJs )#*
## get the configured theme, or use default if not explicitly specified
*##if ( $config.highlightJsTheme )#*
*##set ( $highlightJsTheme = $config.highlightJsTheme.getValue() )#*
*##else#*
*##set ( $highlightJsTheme = 'default' )#*
*##end#*
## use a hosted version of highlight.js for syntax highlighting *#
#* *##end#*
*##if ( !$config.not( "imgLightbox" ) )#*
## if not disabled, include lightbox for showing images *#
#* *##end##
##
#*
*##if ( $decoration.body.head )#*
*#$render.eval( $decoration.body.head )#*
*##end#*
*##if( $headContent )#*
*#$headContent#*
*##end#*
*#
#googleAnalytics( $decoration.googleAnalyticsAccountId )
##
##
## put page and project slugs as classes to the . This allows page-specific CSS customizations.
##
##
#*
*##if ( ($decoration.bannerLeft.name && $decoration.bannerLeft.name != $project.name || $decoration.bannerLeft.src || $decoration.bannerLeft.href ) || $decoration.bannerRight )#*
*##set ( $hasBanner = true )#*
*##else#*
*##set ( $hasBanner = false )#*
*##end##
##
#*
*##if ( $hasBanner )##
#banner ( $decoration.bannerLeft "bannerLeft" )
#banner ( $decoration.bannerRight "bannerRight" )
#* *##end#*
##
## add a 'breadcrumbs' bar for breadcrumbs, version and publish date (left/right) option
*##if ( !$config.not( "breadcrumbs" )
&& (( $decoration.body.breadcrumbs && $decoration.body.breadcrumbs.size() > 0)
|| $datePosition == "left" || $versionPosition == "left"
|| $datePosition == "right" || $versionPosition == "right") )##
#* *##end#*
*##if ( $tocTop )##
## read top offset for fixed ToC bar from the config
#* *##if ( $config.toc.getAttribute("offsetTop") )#*
*##set ( $tocOffsetTop = $config.toc.getAttribute("offsetTop") )#*
*##else#*
*##set ( $tocOffsetTop = "250" )#*
*##end##
##
#* *##end##
##
#*
*##if ( $config.sections )#*
*##bodySections ( $bodyContent $config.sections )
#else#*
## non-sectioned body - just output it all *#
#* *##if ( $tocSidebar )##
#* *##else##
#* *##end##
#* *##bodyWithHeader ( $bodyContent )
#* *##if ( $tocSidebar )#*
*##tocSidebar ()#*
*##end##
#* *##end##
##
##
##
##
##
#*
*##if ( $localResources )##
#* *##else#*
*##if ( $config.jqueryVersion )#*
*##set ( $jqueryVersion = $config.jqueryVersion.getValue() )#*
*##else#*
*##set ( $jqueryVersion = "@jqueryVersion@" )#*
*##end##
#* *##end##
##
#*
*##if ( !$config.not( "imgLightbox" ) )#*
## if not disabled, include lightbox for showing images *#
#* *##end#*
*##if ( !$config.not( "smoothScroll" ) )#*
## if not disabled, include smooth scrolling *#
#* *##end#*
*##if ( $highlightJs )#*
// use a hosted version of highlight.js for syntax highlighting *###
#* *##end#*
*##if ( $config.endContent )#*
## custom HTML (e.g. JavaScript) to place at the end of the document before
*##htmlContent ( $config.endContent.getChildren() )#*
*##end##
##
#*
*##if ( $localResources )##
#* *##else#*
*##if ( $config.anchorJsVesrion )#*
*##set ( $anchorJsVesrion = $config.anchorJsVesrion.getValue() )#*
*##else#*
*##set ( $anchorJsVesrion = "@anchorJsVesrion@" )#*
*##end##
#* *##end#*
*##if ( $tocTop || $tocSidebar )##
#* *##end##
##