Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Website `og:site_name` ignores `open-graph.site-name`, because the site-title handler overwrites the first matching `meta` tag

Aperta
#14,917 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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 metadata
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.

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.

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/quarto-cli

Tutte le issue di quarto-dev/quarto-cli

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.