Website `og:site_name` ignores `open-graph.site-name`, because the site-title handler overwrites the first matching `meta` tag
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 76/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript
- Domaine
- web-dev
Piste de recherche
Read src/project/types/website/website-meta.ts, especially opengraphMetadata and the siteTitleMetaHandler, then reproduce with the documented quarto render and grep commands. Done means explicit open-graph.site-name remains in Quarto's og:site_name tag, and hand-written tags are not overwritten; verify the behavior on both index.qmd and about.qmd.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Bug description
On a website page, open-graph.site-name set in the document front matter is ignored.
og:site_name always carries the website title instead.
The schema says the opposite.
It says the website or book title is used only when site-name is not explicitly provided in the open-graph metadata.
The cause is that two passes build the tag, they disagree about which value wins, and the second one picks its target by position in the document rather than by ownership.
The first pass gets it right.
opengraphMetadata seeds site-name from the website title, then lets the merged site and document open-graph block overwrite it.
So the value handed to the tag writer is the document's site-name.
- https://github.com/quarto-dev/quarto-cli/blob/a8bfe4037a966f9cf2bea4acbb4e7053701948ed/src/project/types/website/website-meta.ts#L240-L271
- https://github.com/quarto-dev/quarto-cli/blob/a8bfe4037a966f9cf2bea4acbb4e7053701948ed/src/project/types/website/website-meta.ts#L211-L227
The second pass runs the markdown pipeline over the same document, right after.
siteTitleMetaHandler renders the website title and pushes it into og:site_name every time.
It finds the tag with doc.querySelector, which returns the first og:site_name element in the document.
It never checks that the element is the one the first pass just wrote.
On an ordinary page there is only one og:site_name tag, so the overwrite lands on Quarto's own tag and the document's site-name disappears without a word.
Put any earlier og:site_name tag in the head, through include-in-header for instance, and the overwrite lands on that tag instead.
Quarto's own tag is then left carrying the document site-name, which shows what the first pass really wrote.
titleMetaHandler selects og:title and twitter:title the same way, and descriptionMetaHandler does the same for og:description and twitter:description.
- https://github.com/quarto-dev/quarto-cli/blob/a8bfe4037a966f9cf2bea4acbb4e7053701948ed/src/project/types/website/website-meta.ts#L478-L495
- https://github.com/quarto-dev/quarto-cli/blob/a8bfe4037a966f9cf2bea4acbb4e7053701948ed/src/project/types/website/website-meta.ts#L547-L563
Those four never show a wrong value, because both passes work them out from the same expression.
They do still write into a tag the project did not create, so a page that supplies its own social tags has them rewritten.
This matters for any extension or template that writes Open Graph tags of its own.
The effect is easy to misread as the extension corrupting Quarto's output.
Steps to reproduce
Create a stock website project.
quarto create project website ogsite --no-open --no-prompt
Set the site title in _quarto.yml and leave the rest of the scaffold alone.
project:
type: website
website:
title: "SITE TITLE"
navbar:
left:
- href: index.qmd
text: Home
- about.qmd
format:
html:
theme:
- cosmo
- brand
css: styles.css
toc: true
Replace index.qmd.
---
title: "Home"
open-graph:
site-name: "DOCUMENT SITE NAME"
---
`og:site_name` in the head of this page should be `DOCUMENT SITE NAME`.
Replace about.qmd with the same page, plus one hand-written tag in the head.
---
title: "About"
open-graph:
site-name: "DOCUMENT SITE NAME"
format:
html:
include-in-header:
- text: |
<meta property="og:site_name" content="DECOY">
---
The same page, plus one hand-written `og:site_name` tag placed in the head before
Quarto writes its own.
Render, then read the tags back.
quarto render
grep -n '<meta property="og:site_name' _site/index.html _site/about.html
Actual behavior
_site/index.html:81:<meta property="og:site_name" content="SITE TITLE">
_site/about.html:76:<meta property="og:site_name" content="SITE TITLE">
_site/about.html:82:<meta property="og:site_name" content="DOCUMENT SITE NAME">
On index.qmd the document's site-name never appears at all.
On about.qmd the decoy tag receives SITE TITLE, even though a header include wrote it and it never held the website title.
Quarto's own tag keeps DOCUMENT SITE NAME, which is what it was written with.
Expected behavior
og:site_name should carry DOCUMENT SITE NAME on both pages, since both set open-graph.site-name explicitly.
The website title should only be the fallback, as the schema describes.
A tag the project did not write should also be left alone.
Selecting the element by ownership, or narrowing the selection to the tag the first pass created, would fix both halves.
Your environment
- IDE: none, run from the terminal.
- OS: macOS 26.6.2 on Apple Silicon.
It also reproduces on a build of main at a8bfe4037a966f9cf2bea4acbb4e7053701948ed, which is where the line references above point.
Quarto check output
$ quarto check
Quarto 1.10.18
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.7.14: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.10.18
Path: /Applications/Positron.app/Contents/Resources/app/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2026.07
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
[✓] Checking R installation...........OK
Version: 4.6.1
Path: /Library/Frameworks/R.framework/Versions/4.6/Resources
LibPaths:
- /Users/mcanouil/Library/R/arm64/4.6/library
- /Library/Frameworks/R.framework/Versions/4.6/Resources/library
knitr: 1.51
rmarkdown: 2.31
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Library/Developer/CommandLineTools/usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking Julia installation...
- Langage dominant
- JavaScript
- Étoiles
- 6.1k
- Forks
- 466
- Merge moyen
- 20 h 35 min
- PR mergées (30 j)
- 75
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de quarto-dev/quarto-cli
-
accessibility bug listings
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
quarto-dev/quarto-cli#15066 ·
Les mainteneurs répondent en général sous 1 jour
-
accessibility bootstrap dark-mode enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
quarto-dev/quarto-cli#15060 ·
Les mainteneurs répondent en général sous 1 jour
-
Code annotation gutter keeps a grey background when code blocks have none (`code-block-bg: false`)Ouvertebug code-annotation code-blocks themes
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
quarto-dev/quarto-cli#15059 ·
Les mainteneurs répondent en général sous 1 jour
-
bug callouts code-blocks themes
Difficulté 1/5 1-3 heures Accessibilité débutants 82/100
quarto-dev/quarto-cli#15058 ·
Les mainteneurs répondent en général sous 1 jour
-
diagrams-mermaid maintenance
Difficulté 2/5 1-3 heures Accessibilité débutants 60/100
quarto-dev/quarto-cli#15042 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de quarto-dev/quarto-cli
Issues similaires
-
good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
saayam-for-all/webapp#1919 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Uuriko/project-room#3728 ·
Les mainteneurs répondent en général sous 1 jour
-
docs(site): Mermaid edge-label contrast on Architecture and a table header on How it comparesOuvertedocumentation
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
devops-thiago/ThrillhouseBot#1132 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
andromarces/agent-loops#886 ·
Les mainteneurs répondent en général sous 1 jour
-
bug effort:low model:light plan planner:gpt-6-1-sol tests
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour