From a517965b7dce61ece22fae169d6208ce67880641 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 13 Nov 2019 02:27:01 -0700 Subject: [PATCH] make the reference table of UI variables clearer --- docs/modules/ROOT/pages/templates.adoc | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/modules/ROOT/pages/templates.adoc b/docs/modules/ROOT/pages/templates.adoc index e717a7d..5d39f8b 100644 --- a/docs/modules/ROOT/pages/templates.adoc +++ b/docs/modules/ROOT/pages/templates.adoc @@ -13,8 +13,8 @@ The partial templates, in [.path]_src/partials/_, fill in different regions of a The templates read from a model that's populated by Antora. Places in the template where the model is read are enclosed in `{{` and `}}` markers or `{{{` and `}}}`, aka mustaches (e.g., `+{{{page.title}}}+`). -Double mustaches escape the content, whereas triple mustaches insert the content verbatim. -When the `{{` is immediately followed by `>`, that's where the result of a partial is inserted (e.g., `+{{> head }}+`. +Double mustaches escape the content for HTML, whereas triple mustaches insert the content as is. +When the `{{` is immediately followed by `>`, that invokes a partial and inserts the result (e.g., `+{{> head }}+`. === Template variables @@ -23,12 +23,12 @@ Variable names and purposes may change. Here's an overview of the available UI model: -.Variables available to the Handlebars templates +.Variables available to the Handlebars templates (top-level variables in bold) [#template-variables-table,cols="1m,2"] |=== | Name | Description -| site +s| [[site]]site | Information about the site. | site.url @@ -43,7 +43,8 @@ Only set if site.url is defined. | The title of the site. | site.components -| A collection of all the components in the site. +| A map of all the components in the site, keyed by component name. +Properties of each component include name, title, url, latest, and versions. | site.ui | Information about the site UI. @@ -54,7 +55,7 @@ Only set if site.url is defined. | site.ui.url | The absolute base URL of the UI. -| page +s| [[page]]page | Information about the current page. | page.title @@ -79,11 +80,11 @@ The `page-` prefix is used to isolate page-related attributes from the numerous | page.component | Information about the component for the current page. -Properties include name, title, and versions. +Properties include name, title, url, latest, and versions. | page.componentVersion | Information about the component version for the current page. -Properties include name, title, and url. +Properties include version, displayVersion, prerelease (if set), title, and url. | page.module | The name of the module for the current page. @@ -138,16 +139,16 @@ Then, the "Edit the Page" link will not appear. | page.parent | The parent page in the navigation tree. Will resolve to grandparent if parent item is not a page. -| siteRootPath +s| env +| The map of environment variables (sourced from `process.env`). + +s| siteRootPath | The relative path to the root of the published site. -| uiRootPath +s| uiRootPath | The relative path to the root directory of the UI. -| env -| The map of environment variables (sourced from `process.env`). - -| antoraVersion +s| antoraVersion | The version of Antora used to build the site (specifically the version of the @antora/page-composer package). |=== -- 2.11.0