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:

variable type description
alignedFileName String The file name of the (html) document being rendered, relative to the document being rendered
authors List<String> A list of authors from the source document
bodyContent String
decoration DecorationModel This is a model that represents the data in your site.xml
currentDate Date The date when the site is rendered
currentFileName String The file name of the (html) document being rendered, relative to the site root
dateCreation String The date specified in the source document, in the format "yyyyMMdd"
dateFormat DateFormat An instance of the date format as defined in site.xml/publishDate/@format (default: An instance of the default date format for the locale of the document being rendered
dateRevision String The date when the site is rendered, in the format "yyyyMMdd"
headContent String
locale Locale The locale for the document being rendered
publishDate Date An optional hardcoded publish date that has been set programmatically
relativePath String The path to the site root from the document being rendered
shortTitle String The title of the document, excluding the project or site name
supportedLocales List<Locale>
title String The title of the document, including the project or site name

There are also some properties defined by caller:

property type description
FileUtils FileUtils
i18n i18n
PathTool PathTool
StringUtils StringUtils

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

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

variable type description
inputEncoding String
outputEncoding String
project MavenProject
project properties String Properties defined in POM are directly available.

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