Skip to content

fix: stop repeating the title in Markdown companion pages - #427

Merged
has2k1 merged 1 commit into
mainfrom
fix-companion-double-title
Oct 23, 2026
Merged

has2k1 merged 1 commit into
mainfrom
fix-companion-double-title

Conversation

@has2k1

@has2k1 has2k1 commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

This PR stops the Markdown companion of a page from opening with its title twice. User guide pages that start their body with a # heading matching the front-matter title, such as the Great Docs introduction, produced companions with two identical level-1 headings at the top (see introduction.md).

The site's shift-heading-level-by: -1 makes such a leading heading the page title in HTML, so the HTML shows it once. The companion filter reads the page before that shift and added the front-matter title on top of the heading. It now treats a leading # heading as the title, as the HTML does.

A page whose body opens with a `#` heading shows that heading as its
title in HTML, because the site shifts heading levels by -1. The
Markdown companion also prepended the front-matter title, so user guide
companions opened with two level-1 headings. The companion now uses the
leading heading as its title, as the HTML does.
@github-actions

Copy link
Copy Markdown

📚 Preview this PR's docs locally

Fetch the just-built site and open it in your browser:

# this exact build
great-docs preview --run 40011937328

# or always the latest build for this PR
great-docs preview --pr 427
Auth & tips
  • Requires great-docs: pip install great-docs (or run via pipx/uvx).
  • Auth: run gh auth login then add --use-gh, or set GITHUB_TOKEN (needs Actions: read).
  • Jump to a page: add --path reference/index.html.
  • Latest vs exact: --pr <n> grabs the newest build; --run <id> pins this one.
  • Re-download: --refresh ignores the local cache.

@has2k1
has2k1 merged commit f2916ec into main Oct 23, 2026
12 of 13 checks passed
@has2k1
has2k1 deleted the fix-companion-double-title branch October 23, 2026 20:08
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