Skip to content

Give every chapter page a level-0 title - #171

Merged
Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/page-titles
Sep 11, 2026
Merged

Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/page-titles

Conversation

@wmat

@wmat Bill Traynor (wmat) commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

The Antora site titles 17 of its 18 pages "Untitled" — in the browser tab and
anywhere else the UI prints a page title. This gives them real titles, and updates
the guide so template users don't hit the same problem.

Cause

Antora takes a page's title from its level-0 = Title line. These pages opened with
a level-1 == heading instead. The live site proves it: install-tools.adoc was the
one page with = Install Asciidoctor..., and the only one with a real title.

Not a regression. The chapters used == before the migration too, because they were
written as sections of one master document. MIGRATION.md Step 7 requires the level-0
title; this repo never met it, and nothing checks for it.

What changes

Pages. Every heading moves up one level (== → =, === → ==, …), so each
page opens with one = Title and its sections keep their relative depth. Lines inside
listing, literal and fenced blocks are untouched — asserted per file, which matters for
a_few_basics.adoc, whose fenced example of heading syntax contains = Title head.

Assembler. Every include gains leveloffset=+1, turning each page's level-0 title
back into a chapter. The [preface] and [bibliography] style lines move from the top
of copyright.adoc and bibliography.adoc into the assembler, ahead of the include, so
each page starts with a bare title. The template already does this for contributors.

Guide text. The "When adding a new chapter" steps in antora-structure.adoc and the
chapter-file paragraph in author-quickstart.adoc now say to start each chapter with a
level-0 title and include it with leveloffset=+1. Neither was mentioned before, so an
author following this guide got a green build and an "Untitled" page. Also fixes an
include: → include:: typo.

Please review: vale.adoc changes the PDF

vale.adoc had three peer == sections, and a page can have only one level-0 title. Only
its first heading was promoted, so "AsciiDoc style for Vale" and "RISC-V style for Vale"
now sit under "Vale at RISC-V".

  • Site: unchanged apart from the page gaining its title.
  • PDF: those two stop being chapters. 15 chapters become 13, chapters 11–15
    renumber to 9–13, and the PDF is one page shorter (75 → 74).

The alternative is splitting vale.adoc into three pages.

Deliberately not changed: index.adoc

It's the cover, with the logo above the heading. The shared UI renders an <h1> from the
page title unconditionally — partials/article.hbs has no notitle escape — so titling it
puts the heading above the logo. That's a cover-layout decision for docs-spec-template,
whose index.adoc has the same problem — raised upstream as riscv/docs-spec-template#155, along with a CI check that would catch pages like these.

Verification

Compared against a baseline build of main:

Check Before After
Untitled pages (Antora) 17 of 18 1 of 18 (index.html)
Antora log 1 warn, 0 errors 1 warn, 0 errors (same pre-existing graphviz warning)
Asciidoctor warnings (PDF/HTML) 0 0
PDF 15 chapters, 75 pages 13 chapters, 74 pages
  • Rendered body text of the standalone HTML differs only in the new guide sentences —
    so shifting the headings and adding leveloffset=+1 reproduces the document exactly.
  • Heading outline differs only in the Vale subtree.
  • Front matter, TOC, lists and index all present in the PDF.

Follow-up: nav order

A commit putting the title page, copyright and contributors first in the nav arrived on
this branch after this PR merged, so it isn't part of it. It's #172.

Relationship to #170

Independent — no files in common. The home/index.html 404 on the header logo and
breadcrumb is still present on this branch; #170 fixes that.

🤖 Generated with Claude Code

The Antora site titled 17 of its 18 pages "Untitled" -- in the browser
tab, and anywhere else the UI prints the page title. Antora takes a
page's title from its level-0 `= Title` line, and these pages opened with
a level-1 `==` heading instead. install-tools.adoc was the one page with a
level-0 title, and the only one that showed a real title on the live site.
Not a regression: the chapters used `==` before the migration too, because
they were written as sections of one master document. MIGRATION.md Step 7
requires the level-0 title; this repo never met it.

Pages: every heading moves up one level (`==` -> `=`, `===` -> `==`, ...),
so each page opens with one `= Title` and its sections keep their relative
depth. Lines inside listing, literal and fenced blocks are untouched --
the script asserted that per file, which matters for a_few_basics.adoc,
whose fenced example of AsciiDoc heading syntax contains `= Title head`.

Assembler: every include gains leveloffset=+1, which turns each page's
level-0 title back into a chapter. The [preface] (copyright) and
[bibliography] (bibliography) style lines move from the top of those pages
into the assembler, ahead of the include, so each page starts with a bare
title and the style still lands on the same heading in the PDF. The
template already does this for contributors.

vale.adoc is the exception. It had three peer `==` sections, and a page
can have only one level-0 title, so only its first heading was promoted:
"AsciiDoc style for Vale" and "RISC-V style for Vale" now sit under "Vale
at RISC-V". On the site that page is unchanged apart from gaining its
title. In the PDF those two stop being chapters: 15 chapters become 13,
chapters 11-15 renumber to 9-13, and the PDF is one page shorter.

index.adoc is deliberately left alone. It is the cover page, with the logo
above the heading, and the shared UI renders an <h1> from the page title
unconditionally (partials/article.hbs has no notitle escape). Titling it
means putting the heading above the logo -- a cover-layout decision that
belongs to docs-spec-template, whose index.adoc has the same problem.

Guide text: the "When adding a new chapter" steps in antora-structure.adoc
and the chapter-file paragraph in author-quickstart.adoc now say to start
each chapter with a level-0 title and include it with leveloffset=+1.
Neither was mentioned before, so an author following this guide got a
green build and an "Untitled" page. Also fixes `include:` -> `include::`.

Verified against a baseline build of main:
  * Antora: untitled pages 17 -> 1 (index.html); log unchanged at one
    pre-existing graphviz warning and no errors.
  * Standalone HTML: the rendered body text differs only in the new guide
    sentences; the heading outline differs only in the Vale subtree.
  * PDF: builds with no asciidoctor warnings before or after; front
    matter, TOC, lists and index all present.
  * nav.adoc is unchanged, so the central playbook's line-keyed chapter
    numbering is unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Bill Traynor <wmat@riscv.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant