Repository navigation
fix: keep citation markup out of page descriptions - #448
Merged
Merged
Conversation
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.
📚 Preview this PR's docs locallyFetch 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 448Auth & tips
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.