Skip to content

fix: keep citation markup out of page descriptions - #448

Merged
has2k1 merged 3 commits into
mainfrom
fix-description-citations
Oct 27, 2026
Merged

has2k1 merged 3 commits into
mainfrom
fix-description-citations

Conversation

@has2k1

@has2k1 has2k1 commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

This PR removes raw citation markup from the meta, Open Graph and Twitter descriptions of pages whose opening paragraph cites a reference. Since descriptions are written before rendering, a page opening with "introduced by Knuth [@knuth1984], who argued…" carried that text, key and all, into search results and link previews, while the page body showed the resolved citation.

Citations in brackets are now left out of the description. On a site or page with a bibliography, an opening paragraph that cites a reference in its text (@knuth1984 argues) gets the default description, since the author's name is only known once the page renders. Sites without a bibliography are unchanged.

The PR also updates three rendered-site tests that went stale: the CLI sidebar checks now read the sidebar on the rendered page rather than _quarto.yml, which keeps only a stub since sidebars are shared across pages, and the Markdown companion count includes the homepage.

Page descriptions are taken from a page's opening paragraph before Quarto
renders it, so a citation in that paragraph reached the description,
Open Graph and Twitter card tags as raw markup, such as "introduced by
Knuth [@knuth1984]". Search results and link previews showed it.

Citations in brackets are now left out of descriptions. When the site or
the page has a bibliography, an opening paragraph that cites a reference
in its text gets the default description instead, because the author's
name is only known once the page renders. Without a bibliography, Quarto
shows such text as written, and so does the description. The lint check
for default descriptions reports the new case, and the SEO guide
describes it.
Long reference sidebars are rendered once and copied into each page, so
the CLI sidebar in the Quarto configuration keeps only its navbar link.
The three CLI sidebar tests read that entry: the nested one failed, and
the flat and top-level ones passed without checking anything. They now
read the sidebar a reader sees on the CLI index page.
The homepage has had a Markdown companion since companions are written
during rendering, so the nested user-guide package has 11 content
companions, not 10.
@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 40558767754

# or always the latest build for this PR
great-docs preview --pr 448
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 e1f3ee2 into main Oct 27, 2026
8 checks passed
@has2k1
has2k1 deleted the fix-description-citations branch October 27, 2026 18:32
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