Skip to content

Commit d0975cb

Browse files
lfranckemojavelinuxSven Petersenggrossetieedward-encoord
authored
Documentation UI changes for the overhaul (#2)
- Antora 3 (Rebase with latest upstream changes) - UI changes for Stackable - Search integration Co-authored-by: Dan Allen <dan@opendevise.com> Co-authored-by: Sven Petersen <s.petersen@webever.de> Co-authored-by: Guillaume Grossetie <ggrossetie@gmail.com> Co-authored-by: Edward <edward@encoord.com>
1 parent 3b56322 commit d0975cb

32 files changed

+4492
-5302
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
--fail
3232
-u 'github:${{ secrets.NEXUS_PASSWORD }}'
3333
--upload-file ./build/ui-bundle.zip
34-
"https://repo.stackable.tech/repository/misc/ui-bundle.zip"
34+
"https://repo.stackable.tech/repository/misc/antora-ui-bundle.zip"

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ It's intentionally minimalistic so as to give you a good starting point without
2929

3030
== Code of Conduct
3131

32-
The Antora project and its project spaces are governed by our https://gitlab.com/antora/antora/-/blob/master/CODE-OF-CONDUCT.adoc[Code of Conduct].
32+
The Antora project and its project spaces are governed by our https://gitlab.com/antora/antora/-/blob/HEAD/CODE-OF-CONDUCT.adoc[Code of Conduct].
3333
By participating, you're agreeing to honor this code.
3434
Let's work together to make this a welcoming, professional, inclusive, and safe environment for everyone.
3535

@@ -41,7 +41,7 @@ If you want to simply use the default UI for your Antora-generated site, add the
4141
----
4242
ui:
4343
bundle:
44-
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
44+
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable
4545
snapshot: true
4646
----
4747

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: antora-ui-default
22
title: Antora Default UI
3-
version: master
3+
version: ~
44
nav:
55
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/development-workflow.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// This section provides information about some of the UI files you'll be modifying and how to prepare and submit those changes.
44

5-
All changes pushed to a UI project's master branch can trigger a new release (not described here).
5+
All changes pushed to a UI project's default branch can trigger a new release (not described here).
66
Therefore, you want to make your changes to a development branch and submit it as a pull request (PR) to be approved.
77
(Even better would be to issue the PR from a fork).
88
Only when the PR is approved and merged will the new release be triggered.
@@ -11,7 +11,7 @@ Only when the PR is approved and merged will the new release be triggered.
1111

1212
Use the following command to create a local development branch named `name-me`:
1313

14-
$ git checkout -b name-me -t origin/master
14+
$ git checkout -b name-me -t origin/HEAD
1515

1616
You'll then apply your changes to the UI files.
1717
Once you're done making changes, commit those changes to the local branch:
@@ -26,6 +26,6 @@ Finally, navigate to your UI project in your browser and create a new pull reque
2626

2727
The maintainer of the UI should review the changes.
2828
If the changes are acceptable, the maintainer will merge the pull request.
29-
As soon as the pull request is merged into master, an automated process will take over to publish a new release for the site generator to use.
29+
As soon as the pull request is merged into the default branch, an automated process will take over to publish a new release for the site generator to use.
3030

3131
Now that you've got the process down, let's review some of the files you'll be working with in more detail.

docs/modules/ROOT/pages/index.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ The most common postprocessor backports newer CSS features to older browsers by
7171

7272
== UI project versus UI bundle
7373

74-
The [.term]*UI project*, the master branch of a git repository, contains the recipe and raw materials for creating an Antora UI bundle.
74+
The [.term]*UI project*, which is comprised of the source files in the git repository, provides the recipe and raw materials for creating an Antora UI bundle.
7575
It includes a build, source files, project files, and dependency information.
7676
This is your development workspace.
7777

7878
The [.term]*UI bundle*, a distributable archive, provides pre-compiled (interpreted, consolidated, and/or minimized) files that are ready to be used by Antora.
7979

80-
=== UI project repository structure (master branch)
80+
=== UI project repository structure (default branch)
8181

82-
You should think of the UI project's master branch as your UI workspace.
82+
You should think of the UI project's default branch as your UI workspace.
8383
It contains the recipe and raw materials for creating a UI, including a build, source files, project files, and dependency information.
8484

8585
Here's how the files are structured in the UI project:
@@ -133,7 +133,7 @@ The UI bundle--a distributable archive--provides files which are ready to be use
133133
When the UI project files are built by Gulp, they are assembled under the [.path]_public_ directory.
134134
Since the [.path]_public_ directory is generated, it's safe to remove.
135135

136-
The contents of the UI bundle resembles the UI project's master branch contents, except the bundle doesn't contain any files other than the ones that make up the UI.
136+
The contents of the UI bundle resembles the UI project's default branch contents, except the bundle doesn't contain any files other than the ones that make up the UI.
137137
This is the content that is used by Antora.
138138

139139
[.output]
@@ -174,7 +174,7 @@ The purpose of an Antora UI project is to get the UI files into a state that Ant
174174

175175
The UI is served statically in a production site, but the UI's assets live in a source form in a UI project to accommodate development and simplify maintenance.
176176
When handed off to the Antora pipeline, the UI is in an interim, pre-compiled state.
177-
Specifically, the master branch of the git repository contains the files in source form while releases are used to distribute the files in pre-compiled form.
177+
Specifically, the default branch of the git repository contains the files in source form while releases are used to distribute the files in pre-compiled form.
178178

179179
The responsibility of compiling the UI is shared between a UI project and Antora.
180180
The UI project uses a local build to pre-compile (i.e., interpret, consolidate, and/or minimize) the files.

docs/modules/ROOT/pages/set-up-project.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The sources can be {url-project}[Antora's default UI] or an existing UI project
99
To start, clone the default UI project using git:
1010

1111
[subs=attributes+]
12-
$ git clone {url-project} &&
13-
cd "`basename ${_%.git}`"
12+
$ git clone {url-project}
13+
$ cd "`basename ${_%.git}`"
1414

1515
The example above clones Antora's default UI project and then switches to the project folder on your filesystem.
1616
Stay in this project folder in order to initialize the project using npm.

docs/modules/ROOT/pages/templates.adoc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Variable names and purposes may change.
2727
Here's an overview of the available UI model:
2828

2929
.Variables available to the Handlebars templates (top-level variables in bold)
30-
[#template-variables-table,cols="1m,2"]
30+
[#template-variables-ref,cols="1m,2"]
3131
|===
3232
| Name | Description
3333

@@ -36,6 +36,7 @@ s| [[site]]site
3636

3737
| site.url
3838
| The base URL of the site, if specified in the playbook.
39+
If a site start page is defined, the visitor will be redirected from this location to the start page.
3940

4041
| site.path
4142
| The pathname (i.e., subpath) of the site.url under which the site is hosted (e.g., /docs).
@@ -47,6 +48,9 @@ Can be prepended to `page.url` to create a root-relative URL for a page (e.g., `
4748
| site.title
4849
| The title of the site.
4950

51+
| site.homeUrl
52+
| The URL that points directly to the start (aka home) page of the site.
53+
5054
| site.components
5155
| A map of all the components in the site, keyed by component name.
5256
Properties of each component include name, title, url, latest, and versions.
@@ -80,6 +84,9 @@ For example, the value of the document attribute named `page-support-phone` can
8084
Page attributes can be defined per page in the AsciiDoc document header (e.g., `:page-support-phone: +1 212-555-1234`) or globally in the playbook under the key `asciidoc.attributes`.
8185
The `page-` prefix is used to isolate page-related attributes from the numerous other document attributes in AsciiDoc.
8286

87+
| page.author
88+
| The first author of the document, if one or more authors are specified in the AsciiDoc header.
89+
8390
| page.description
8491
| The text of the description attribute in the AsciiDoc header, if specified.
8592

@@ -130,8 +137,8 @@ It's often used as the base URL to generate relative URLs from this page.
130137

131138
| page.canonicalUrl
132139
| The canonical URL for the current page.
133-
The canonicalUrl is only set if site.url is set.
134-
If there are multiple versions of the component, the canonical URL is the qualified URL of the most recent version of the page (excluding any prerelease versions).
140+
The canonicalUrl is only set if site.url is set to an absolute URL and the page's component has at least one non-prerelease version.
141+
If there are multiple versions of the component, the canonical URL is the qualified URL of the most recent, non-prerelease version of the page.
135142
If there's only a single version of the component, the canonical URL is the qualified URL of the current page.
136143

137144
| page.editUrl
@@ -174,6 +181,8 @@ s| env
174181

175182
s| siteRootPath
176183
| The relative path to the root of the published site.
184+
If a site start page is defined, the visitor will be redirected from this location to the start page.
185+
Can be used as a fallback when a site URL is not set.
177186

178187
s| uiRootPath
179188
| The relative path to the root directory of the UI.
@@ -197,6 +206,6 @@ Next, open the file [.path]_templates/partials/head.hbs_ and add your tag.
197206
----
198207

199208
Each template file has access to the template model, which exposes information about the current page through variable names.
200-
The variables currently available are listed in <<template-variables-table>>.
209+
The variables currently available are listed in <<template-variables-ref>>.
201210

202211
Save the file, commit it to git, push the branch, and allow the approval workflow to play out.

gulp.d/tasks/build-preview-pages.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
'use strict'
22

3-
// NOTE remove patch after upgrading from asciidoctor.js to @asciidoctor/core
4-
Error.call = (self, ...args) => {
5-
const err = new Error(...args)
6-
return Object.assign(self, { message: err.message, stack: err.stack })
7-
}
8-
9-
const asciidoctor = require('asciidoctor.js')()
3+
const Asciidoctor = require('@asciidoctor/core')()
104
const fs = require('fs-extra')
115
const handlebars = require('handlebars')
126
const merge = require('merge-stream')
@@ -42,7 +36,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
4236
if (file.stem === '404') {
4337
uiModel.page = { layout: '404', title: 'Page Not Found' }
4438
} else {
45-
const doc = asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
39+
const doc = Asciidoctor.load(file.contents, { safe: 'safe', attributes: ASCIIDOC_ATTRIBUTES })
4640
uiModel.page.attributes = Object.entries(doc.getAttributes())
4741
.filter(([name, val]) => name.startsWith('page-'))
4842
.reduce((accum, [name, val]) => {

0 commit comments

Comments
 (0)