Skip to the content Fork me on GitHub

Welcome to Apache Maven Fluido Skin!

The Apache Maven Fluido Skin is an Apache Maven site skin built on top of Bootstrap 5.3.8. Pages read and navigate without JavaScript: the side menu, also on phones, and wide tables work without it. Scripts add code highlighting, the button that hides the side menu on phones, the top bar's dropdown menus and, when enabled, the dark theme.

Upgrading from 2.1.0 or earlier? Read Migrating to Fluido 2.2.0: Bootstrap 2 classes in your own pages and site.css, removed options and files, and how to stay on 2.1.0.

A sample page is provided to see the skin in action, and two complete sites to show skin configurations: one for sidebar layout (default) and the other for topbar layout.

Notice: since version 1.5 of this skin, Velocity 1.7 (used by Maven Site Plugin version 3.5) is required. But in previous versions of the skin, it was Velocity 1.5, which has some incompatibilities. If you need to mix versions, please see the migration guide to override Velocity version used by Maven Site Plugin as per your specific skin and site plugin requirements.

Usage

To use this skin in your project, use the skin element of the site.xml site descriptor:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <skin>
    <groupId>org.apache.maven.skins</groupId>
    <artifactId>maven-fluido-skin</artifactId>
    <version>2.2.0-SNAPSHOT</version>
  </skin>
  [...]
</site>

The following aspects may be configured:

Topbar and/or Sidebar

The skin supports different layouts, enabling/disabling the left sidebar menu and the topbar menu. Users have just play with flags in the custom.fluidoSkin element in site.xml:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <topBarEnabled>true</topBarEnabled>
      <sideBarEnabled>false</sideBarEnabled>
    </fluidoSkin>
  </custom>
  [...]
</site>

That allows users having 4 skins in only 1!

  1. sidebar only;
  2. topbar only;
  3. both side/top bars;
  4. none at all.

Default skin setting is the option 1.

To leave out the sidebar on a few pages only, such as a front page with its own layout, list them in custom.fluidoSkin.sideBarSkipped, separated by commas. A page is named by its path from the site root, such as index.html or guide/overview.html:

<custom>
  <fluidoSkin>
    <sideBarSkipped>index.html</sideBarSkipped>
  </fluidoSkin>
</custom>

Topbar Icon

When users decide to enable the topbar, they can plug a small icon/logo there (typically 108*20 px) just configuring the custom.fluidoSkin.topBarIcon element in site.xml:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <topBarEnabled>true</topBarEnabled>
      <topBarIcon>
        <name>Maven Fluido Skin</name>
        <alt>Maven Fluido Skin</alt>
        <src>/images/topbar-logo.png</src>
        <href>/index.html</href>
      </topBarIcon>
    </fluidoSkin>
  </custom>
  [...]
</site>

Topbar Container Style

You can configure the style attribute value of the div container for your topbar

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <topBarEnabled>true</topBarEnabled>
      <topBarContainerStyle>width: 90%;</topBarContainerStyle>
    </fluidoSkin>
  </custom>
  [...]
</site>

Navbar Style

You can configure style of your top bar nav. Use navbar-inverse to have the dark one: the bar then uses Bootstrap's dark colour mode.

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <topBarEnabled>true</topBarEnabled>
      <navBarStyle>navbar-inverse</navBarStyle>
    </fluidoSkin>
  </custom>
  [...]
</site>

Configuring column class

When using sidebar, the navigation column uses by default the classes col-lg-3 col-xl-2 and the body column col-lg-9 col-xl-10, Bootstrap's grid columns. The Bootstrap 2 classes span1 to span12 are still accepted and become col-lg-1 to col-lg-12. To prevent weird/ugly result, the sum must be 12. You can change that using:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <leftColumnClass>col-lg-3</leftColumnClass>
      <bodyColumnClass>col-lg-9</bodyColumnClass>
    </fluidoSkin>
  </custom>
  [...]
</site>

Matomo (e.g. Apache Analytics)

Users can optionally enable Matomo. How to configure it for Apache Analytics, the options element will contain some configuration (here some privacy setup):

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
      <matomo>
        <siteId>xxx</siteId>
        <url>https://analytics.apache.org</url>
        <options>
          <disableCookies/>
          <trackPageView/>
          <enableLinkTracking/>
        </options>
      </matomo>
  </custom>
  [...]
</site>

Google Analytics

Removed in 2.2.0: the script came from a third-party host on every page view, and the Universal Analytics service it used no longer collects data. The googleAnalytics configuration is ignored. Use Matomo, or add your own script in the head element of the site descriptor's body (head/footer placeholders).

Google Search

Removed in 2.2.0: the search box sent the reader's query to a third-party host. The googleSearch configuration is ignored.

Source code line numbers

Source code sections are highlighted by highlight.js (since 2.2.0; earlier versions used Google Code Prettify), with grammars for XML, Java, Bash/shell, JSON, properties, Groovy and JavaScript; a block that names no language is detected among them. Users can optionally enable line numbers rendering (disabled by default):

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
    </fluidoSkin>
  </custom>
  [...]
</site>

Copyright class

Since version 1.3.1, you can configure a copyright class:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <copyrightClass>pull-right</copyrightClass>
    </fluidoSkin>
  </custom>
  [...]
</site>

head/footer placeholders

This skin will pass your custom head/footer to $<a id="esc.d"></a>esc.drender.eval() and replace all variables known to the Velocity context.

GitHub Ribbons

Since version 1.11.1, fluido-skin supports GitHub ribbons to simplify the Fork me on GitHub banner integration. Users must define:

  • custom.fluidoSkin.gitHub.projectId: required, the project id on GitHub and will be used to build the project page URL;

  • custom.fluidoSkin.gitHub.ribbonOrientation: optional, the ribbon position, left-top (left)/right-top (right)/left-bottom/right-bottom are accepted only (left-top by default);

  • custom.fluidoSkin.gitHub.ribbonColor: optional, the ribbon color, red/green/black/darkblue/orange/gray are accepted only (red by default).

    <site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
      [...]
      <custom>
        <fluidoSkin>
          <gitHub>
            <projectId>apache/maven-skins</projectId>
            <ribbonOrientation>right</ribbonOrientation>
            <ribbonColor>black</ribbonColor>
          </gitHub>
        </fluidoSkin>
      </custom>
      [...]
    </site>
    

Project profile

As shown in MojoHaus Maven plugins list, plugins life-cycle are characterized by different status/stages:

  • Production

  • Pre-release

  • Sandbox

  • Graveyard (retired projects)

    Users can configure different backgrounds depending on the project status (except the production) to warrant users they are not using a production ready software:

    <site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
      [...]
      <custom>
        <fluidoSkin>
          <profile>(pre-release|sandbox|retired)</profile>
        </fluidoSkin>
      </custom>
      [...]
    </site>
    

Twitter follow button

Removed in 2.2.0: the button loaded a script from a third-party host on every page view, while the ASF privacy policy integrates social media plug-ins with a two-click method. The twitter configuration is ignored.

Facebook like button

Removed in 2.2.0, for the same reason. The facebookLike configuration is ignored.

Flattr button

As of version 2.0.0-M9, support for Flattr buttons in fluido-skin has been removed.

AnchorJS

You can optionally enable anchor ID generation with AnchorJS:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <anchorJs />
    </fluidoSkin>
  </custom>
  [...]
</site>

Note that the generated IDs are not compatible with IDs generated by the underlying Doxia framework.

Additionally you can provide a CSS selector for the add() function and options:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <anchorJs>
        <cssSelector>h1, h2, h3, h4, h5</cssSelector>
        <options>
          <class>.anchor</class>
          <titleText>foo</titleText>
        </options>
      </anchorJs>
    </fluidoSkin>
  </custom>
  [...]
</site>

Expose last modified date instead of publish date

Since version 2.2.0, you can expose the last modified date of the Doxia source file (derived from SCM metadata, not from regular file system metadata) instead of the publish date. This requires a dedicated dependency on the doxia-site-scm-context artifact and is only supported by Maven Site Plugin version 3.22.0 (leveraging Doxia Sitetools 2.1.0) or later.

Note: This only works correctly if you are not using shallow clones for your SCM repository, otherwise the last modified date will be the date of most recent commit not the actual last modified date of the file in the repository. Further details in Maven SCM Issue #1378.

To add the dependency you need to add the following snippet to your pom.xml:

<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.22.0</version>
        <dependencies>
            <dependency>
              <groupId>org.apache.maven.doxia</groupId>
              <artifactId>doxia-site-scm-context</artifactId>
              <version>${doxiaSitetoolsVersion}</version>
            </dependency>
        <dependencies>
      </plugin>
      [...]
    </plugins>
  <build>
  [...]
</project>

The site descriptor (site.xml) needs to be adjusted as well in its publishDate element. The necessary attributes are provided in the site descriptor schema since version 2.1.0.

<site xmlns="http://maven.apache.org/SITE/2.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.1.0.xsd">
  [...]
  <publishDate format="yyyy-MM-dd" position="right" value="scmModifiedDate" prefix="template.lastmodified" fallbackValue="publishDate"/>
  [...]
</site>

The value attribute of the publishDate element must be set to scmModifiedDate to use the last modified date, and a fallbackValue can be set to publishDate to use the publish date as fallback when the last modified date is not available (e.g., when SCM metadata for the Doxia source file is not available or for pages generated by reporting plugins). The prefix attribute determines the text preceding the date and if starting with template. it will be resolved from the site-renderer.properties. There is a dedicated fallbackPrefix attribute as well to specify the prefix to be used when the fallback value is used, however its default value usually is fine (template.lastpublished).

Skip generation date

Since version 1.3.1, you can skip generation date from the line "Generated by Apache Maven Doxia at <date>" to enable it:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <skipGenerationDate>true</skipGenerationDate>
    </fluidoSkin>
  </custom>
  [...]
</site>

Breadcrumb Divider

Since version 1.3.1, you can configure the breadcrumb divider (default is a slash):

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <breadcrumbDivider>»</breadcrumbDivider>
    </fluidoSkin>
  </custom>
  [...]
</site>

Dark Theme

Pages are light by default, with no theme switch and no theme script.

With darkThemeEnabled (since 2.2.0), the dark theme activates based on the browser preferences (Auto), and a theme switch at the top of the menu lets the reader choose Light, Dark or Auto; the choice is kept for the next pages. Both map onto Bootstrap's colour modes and need JavaScript: without it pages stay light and the switch does not show.

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <darkThemeEnabled>true</darkThemeEnabled>
    </fluidoSkin>
  </custom>
  [...]
</site>

To keep the dark theme following the browser but remove the switch, also set themeSwitch to false:

<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd">
  [...]
  <custom>
    <fluidoSkin>
      <darkThemeEnabled>true</darkThemeEnabled>
      <themeSwitch>false</themeSwitch>
    </fluidoSkin>
  </custom>
  [...]
</site>

Acknowledgment

Apache Maven Fluido Skin contains/redistributes Bootstrap, released under the MIT License.