Repository navigation
Use the page's site-name for og:site_name and only update Quarto's own meta tags - #15102
Merged
Merged
Conversation
…a tags The markdown pipeline that renders social metadata overwrote og:site_name with the website title, so a page's open-graph.site-name never reached the output. It also looked the tags up with querySelector, which returns the first match in the head, so a tag added through include-in-header or an extension got rewritten instead of the one Quarto wrote. writeMetaTag now returns the element it creates, the post processor keeps the tags it writes by name, and the pipeline handlers update those elements directly. og:site_name gets the same resolved value as the first pass: open-graph.site-name when set, the website title otherwise. Fixes quarto-dev#14917
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
approved these changes
Oct 19, 2026
cderv
left a comment
Member
There was a problem hiding this comment.
Thanks for the PR.
Keeping the elements Quarto writes is the right fix I think. The markdown pipeline pass is what resolves markdown and shortcodes in the site title, so it can't be dropped, and nothing in the output marks which tags Quarto wrote, so a narrower selector would not work.
I can reproduce the issue on main and the PR fixes it, also for a page site-name with markdown or a shortcode, and for one set in _metadata.yml.
I'll push a few small adjustments on your branch before merging, no need to change anything on your side.
… out of social metadata The changelog entry moves into issue number order with the author attribution. A page with `open-graph: false` that writes its own tags had them rewritten with the website title before this fix, so it gets a test. `metadataHtmlPostProcessor` drops its unused default map and the `written.clear()` call, since its only caller creates a fresh map for each file.
1 of 5 tasks
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.
Description
Fixes #14917.
Both problems from the issue came from the markdown pipeline that runs after the social meta tags are written:
siteTitleMetaHandleralways pushed the website title intoog:site_name, so a page'sopen-graph.site-namenever made it to the output.doc.querySelector, i.e. the first match in<head>, so a tag frominclude-in-headeror an extension got rewritten instead of Quarto's own.writeMetaTagnow returns the element it creates, the post processor keeps the tags it writes by name, and the pipeline handlers update those elements directly instead of searching the head.og:site_namenow gets the same value the first pass writes:open-graph.site-namewhen the page sets it, the website title otherwise. Tags Quarto didn't write are left alone, which coversog:title,og:description,twitter:titleandtwitter:descriptionas well.Tests: a small website project under
2026/10/19/issue-14917following the issue's repro.index.qmdchecks the page's site name wins, andabout.qmdadds decoy tags for all five names throughinclude-in-headerand checks they keep their values while Quarto's tags get the right ones. Both fail onmainand pass with this change.I also ran the existing social metadata tests (27 smoke-all documents plus
smoke/site/render-website-image-data-uri.test.ts). All pass except2024/10/28/issue-10311, which needs Jupyter; it fails the same way onmainon my machine.Checklist
I have (if applicable):
AI-assisted PR