Website `og:site_name` ignores `open-graph.site-name`, because the site-title handler overwrites the first matching `meta` tag
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- web-dev
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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...
- Lingua principale
- JavaScript
- Stelle
- 6.1k
- Fork
- 466
- Merge medio
- 20h 28m
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/quarto-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
quarto-dev/quarto-cli#15042 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility documentation revealjs
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
quarto-dev/quarto-cli#14971 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility revealjs
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
quarto-dev/quarto-cli#14970 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility revealjs themes
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/quarto-cli#14963 ·
I maintainer di solito rispondono entro 1 giorno
-
accessibility revealjs themes
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
quarto-dev/quarto-cli#14962 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/quarto-cli
Issue simili
-
OpenCode install copies the Pi harness directory (`.pi/`) into the OpenCode config rootForse già presa @gaurav0107 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Docs viewer: inverted grey colormap, Phantom CT window -20 to 35 HU, smoothing up to 40 mmForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea: docs enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
PyTomography/PyTomography#331 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
pnpm/get.pnpm.io#68 ·
-
Android (vision-camera-location): HybridLocationManager never quits its HandlerThread on disposeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
margelo/react-native-vision-camera#4217 ·
I maintainer di solito rispondono entro 4 giorni