From f7b4265309dbbb55217290f5dac5ea03b649e937 Mon Sep 17 00:00:00 2001 From: Justin W. Flory (he/him) Date: Oct 01 2020 20:28:22 +0000 Subject: asciidoc-fedora: Update partials docs for Antora 2.0 This commit refactors the documentation on how to use reusable attributes. Recently I needed to create reusable attributes in a docs project with multiple modules (a.k.a. this repo). So, while digging, I discovered that the way I learned to include partials is deprecated since Antora 1.1. The current stable version is 2.3.4 and an early alpha is released for v3.0.0. So, this is a slight modernization to make sure we are giving people the right advice to set up their partials in a way that will continue to work in future versions of Antora. Hurrah! References: * https://docs.antora.org/antora/2.3/partials-directory/ * https://docs.antora.org/antora/2.3/page/partials-and-content-snippets/ * https://docs.antora.org/antora/2.3/page/include-a-partial/ * https://docs.antora.org/antora/2.2/asciidoc/page-to-page-xref/ Signed-off-by: Justin W. Flory (he/him) --- diff --git a/modules/ROOT/pages/index.adoc b/modules/ROOT/pages/index.adoc index 4c2b97d..fc6f373 100644 --- a/modules/ROOT/pages/index.adoc +++ b/modules/ROOT/pages/index.adoc @@ -1,4 +1,4 @@ -include::{partialsdir}/attributes.adoc[] +include::ROOT:partial$attributes.adoc[] = Fedora Docs diff --git a/modules/asciidoc-fedora/pages/reusable-attributes.adoc b/modules/asciidoc-fedora/pages/reusable-attributes.adoc index 0db25b5..00bd89c 100644 --- a/modules/asciidoc-fedora/pages/reusable-attributes.adoc +++ b/modules/asciidoc-fedora/pages/reusable-attributes.adoc @@ -30,17 +30,18 @@ There are two requirements for your Fedora Documentation project to use attribut [[attributes-file]] == Create attributes file -First, initialize an attributes file for a specific module, as shown below: +First, initialize an `attributes.adoc` file for any module. +The example below shows a globally reusable attributes file in the `ROOT` module: [source,sh] ---- . └── ROOT ├── nav.adoc - └── pages - ├── index.adoc - └── _partials -    └── attributes.adoc + ├── pages + │   └── index.adoc + └── partials + └── attributes.adoc ---- This is an example `attributes.adoc` from the xref:diversity-inclusion::index.adoc[Fedora Diversity & Inclusion Team]: @@ -64,7 +65,7 @@ Placing this macro on the top line will do the rest: [source,adoc] ---- -\include::{partialsdir}/attributes.adoc[] +\include::ROOT:partial$attributes.adoc[] ----