Default Theme
Ornate‘s default theme generates multiple HTML pages for the site, one per page. It uses Foundation’s Flexbox-based CSS layout for responsive design across different classes of devices. All assets are included in the generated site by default.
Configuration
This is the theme’s default configuration:
Third-Party Content
Sites that are generated by the default theme contain Foundation 6 and its dependencies (JQuery, what-input), all of which are available under the MIT License.
Sites that are generated by the default theme may contain Foundation Icon Fonts 3 which is available under the MIT License.
Sites that are generated by the default theme may contain fonts from Font Awesome which are available under the SIL OFL 1.1.
When using Mermaid diagrams, the generated site includes Mermaid which is available under the MIT License.
When using MathJax for math notation, the generated site includes MathJax which is available under the Apache License.
When using the Emoji extension, the generated sites can contain images from the EmojiOne project which require attribution when used in commercial projects.
Search
The default theme can generate a JavaScript-based search function for the site using Elasticlunr (available under the MIT License). The search index includes page titles, content and keywords. See above for configuration options.
Minification
Ornate can minify generated HTML files, JavaScript assets and CSS using the following libraries:
- CSSO (running on Nashorn) for CSS
- Closure Compiler for JavaScript
- HtmlCompressor for HTML
Minification is turned off by default for better performance when building the site. It can be enabled with the following settings under theme.default.global
:
Snippet Source Links
Snippets from fenced code blocks can show links to an appropriate source file by setting the sourceLinkURI
attribute. If sourceLinkText
is also set, it is used as the link text, otherwise the file name from the URI is used.
Example:
This gets rendered as (link shown on mouse-over):
The includeCode extension can generate link targets for included snippets automatically.
Shortcut Icons
Shortcut icons can be defined through custom link
elements with appropriate rel
and href
values under theme.default
:
For example, this is how you add a standard favicon.ico
located under global.resourceDir
:
Customization
Some of the default theme’s colors can be changed under theme.default.global.color
. These are the default values:
Other styles can be changed by appending custom CSS code to the generated app.css
file. These are the defaults (under theme.default.global
):
Index
The default theme can generate an index page from user-defined keywords. Using the headerAttributes extension, you can define the keywords with the index
key. Nested keywords are separated by commas, multiple independent keywords are separated by semicolons. For example, the following header definition contributes two index entries “Bar” and “Foo, Bar” that link to the header:
Multi-Version Sites
The default theme can add code for an automatic client-side multi-version navigation that allows users to switch between different versions of the site, going to the same page if it exists in the selected version or the root of the site otherwise. This works by reading an existing HTML index page (either auto-generated by the web server or maintained manually). Due to security restrictions and the way browsers handle directory listings this does not work (and is in fact automatically disabled) when loading a generated site from a file:
URL. You have to put it on a web server to make it work.
The feature can be enabled under theme.default
. Here is the default configuration:
Example: A typical directory layout looks like this:
Here /docs/0.1/
and /docs/0.2/
are two versions of a site that have been generated independently with Ornate. All HTML pages load ../
(the auto-generated directory listing of /docs/
) as the index page and detect the versions 0.1
and 0.2
from it. For example, on /docs/0.1/foo.html
you get a link to /docs/0.2/foo.html
. When you click on it the navigation script first checks if the page exists and since it doesn’t in this case, it loads /docs/0.2/
instead.
Instead of a separate navigation section below the page navigation the version switcher can be integrated into a version number that is shown in the title bar by embedding an image with the special versions:/
URI. For example, the following definition could be used by this manual if it was supposed to be published as a multi-version site: