Doxia Site Tools - Site Renderer

The Site Renderer handles the rendering of sites, assembling a common site decoration with a collection of documents.

A default site decoration is included (see default-site.vm), but other decorations can be used at will, either as a standalone template or packaged in a skin artifact (containing a META-INF/maven/site.vm template).

Documents can be dynamically generated with Doxia Sink API, like Maven reports, or simply read from static files, eventually processed by Velocity if their file names end in .vm.

Doxia Site Skins

Site decoration can be customized with skins.

Maven team provides a collection of skins for projects use, but more skins are listed in MAVENUSER wiki.

Some documentation is available on how to write a new skin.

Velocity processing

Site decoration and documents with file names ending in .vm are processed by Velocity.

The Velocity context defines some variables, that you can use:

variabletypedescription
alignedFileNameStringThe file name of the (html) document being rendered, relative to the document being rendered
authorsList<String>A list of authors from the source document
bodyContentString
decorationDecorationModelThis is a model that represents the data in your site.xml
currentDateDateThe date when the site is rendered
currentFileNameStringThe file name of the (html) document being rendered, relative to the site root
dateCreationStringThe date specified in the source document, in the format "yyyyMMdd"
dateFormatDateFormatAn instance of the default date format for the locale of the document being rendered
dateRevisionStringThe date when the site is rendered, in the format "yyyyMMdd"
headContentString
localeLocaleThe locale for the document being rendered
publishDateDateAn optional hardcoded publish date that has been set programmatically
relativePathStringThe path to the site root from the document being rendered
shortTitleStringThe title of the document, excluding the project or site name
supportedLocalesList<Locale>
titleStringThe title of the document, including the project or site name

There are also some properties defined by caller:

propertytypedescription
FileUtilsFileUtils
i18ni18n
PathToolPathTool
StringUtilsStringUtils

See DefaultSiteRenderer.createVelocityContext(...) source for more details.

When doxia-site-renderer is used by maven-site-plugin, the following template properties are defined:

variabletypedescription
inputEncodingString
outputEncodingString
projectMavenProject
project propertiesStringProperties defined in POM are directly available.

See AbstractSiteRenderingMojo.createSiteRenderingContext(...) source for more details.