------ Configuring the Site Descriptor ------ Vincent Siveton Maria Odea Ching Dennis Lundberg ------ 2011-08-14 ------ ~~ 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. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Configuring the Site Descriptor You can create your own site descriptor for your project when you want to override the navigation tree for the site. For example, aside from the generated reports you want to add additional content to your site. In order for it to be accessible in the generated site, you must configure your site descriptor. You create the site descriptor in a file called <<>> which should be located in your <<>> directory. If you are migrating from Maven 1.x you will be interested to know that the <<>> file has been replaced by the site descriptor in Maven 2. The format is nearly the same, so you can probably reuse most of your old file. There is a {{{http://maven.apache.org/doxia/doxia-sitetools/doxia-decoration-model/decoration.html}reference documentation for the site descriptor}} available. The XML Schema for the site descriptor is published at {{http://maven.apache.org/xsd/decoration-1.1.0.xsd}}. Have a look at the {{{http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-site-plugin/src/site/site.xml}site descriptor for Maven Site Plugin}} for a real life example. %{toc|section=1|fromDepth=2|toDepth=3} * Title The title of each generated page will be a combination of the and the title of the current page. By default the Site Plugin will use the value of the <<<\>>> element from your <<>> file as the site title. The complete title for this page is "Maven Site Plugin - Configuring the Site Descriptor". If you want to use a different site title, but do not want to change the <<<\>>> element in your <<>>, you can configure this in your <<>>, like this: +-----+ ... +-----+ * Banner You can include some logos on top of your site, using the following syntax: +-----+ ... Project Name http://maven.apache.org/images/apache-maven-project-2.png http://maven.apache.org/ http://maven.apache.org/images/maven-logo-2.gif ... +-----+ Refer to the site descriptor {{{http://maven.apache.org/doxia/doxia-sitetools/doxia-decoration-model/decoration.html}reference}} for a complete tag description. * Publish Date With the out-of-the-box Velocity template, the position of the "Last Published" date is configurable. By default, the position is on the left but you can change it. To do this, you can add a <<<\>>> element to your <<>> like the following: +-----+ ... ... +-----+ The <<>> attribute can have one of these values: <<>>, <<>>, <<>>, <<>>, <<>>. If you want hide the publish date, you can use this in your <<>>: +-----+ ... ... +-----+ The format of the "Last Published" date is the ISO date format that is {{{http://www.w3.org/QA/Tips/iso-date}recommended by the W3C}}. Because the web has an international, cross-cultural audience it is recommended to change the date format. There is however a <<>> attribute to the <<<\>>> element that can be used if you really need a different date format. * Version You can show the "Version" of your project on the site, by adding a <<<\>>> element to your <<>> like this: +-----+ ... ... +-----+ The <<>> attribute can have the same values as the <<>> attribute, see above. If the <<>> attribute is omitted, the default value is <<>>. If you want hide the version, you can use this in your <<>>: +-----+ ... ... +-----+ * "Powered by" Logo You can add your own "Powered by" logo to your site. To do this, you add a <<<\>>> element in your <<>> like this: +-----+ ... ... +-----+ * Inheritance See {{{./multimodule.html} Building multi-module sites}}. * Including Generated Content Files in the format-based directory structure can be linked to by their target HTML filename, e.g. <<<${basedir}/src/site/apt/foo.apt>>> and <<<${basedir}/src/site/fml/faq.fml>>> can be linked to via: +-----+ ... ... ... ... +-----+ There are also several preset menus that can be used in the site descriptor to include generated content from your project. These are linked via the <<>> attribute, like so: +-----+ ... ... ... ... +-----+ <> The old syntax using <<<$\{reports\}>>>, <<<$\{parent\}>>> and <<<$\{modules\}>>> has been deprecated and you are encouraged to use the new syntax instead. The support for the old syntax will be removed in a future version of the Site Plugin. The currently available preset menus are: * <<>> - a menu with links to all the generated reports for your project * <<>> - a menu with a link to the parent project's site * <<>> - a menu containing the links to the sites of the submodules of this project [] * Inject xhtml into \ You can inject some xhtml into the generated <<<\>>> element of each page by adding a head element to the body element of your project's site descriptor. The following example adds some javascript: +-----+ ... ...