Skip to content

Commit c7b25ea

Browse files
mcanouilcderv
andauthored
fix(website-meta.ts): change meta selector from "name" to "property" (#13847)
* fix: change meta selector from "name" to "property" * chore: update changelog for version 1.9 * chore: update changelog for og:site_name meta tags clarification Clarified the description of the change regarding the `og:site_name` meta tags to ensure proper metadata markdown processing. * chore: Update changelog for version 1.9 * test: check if og:site_name in generated HTML correctly uses variable in site title * test - use ensureHtmlElements instead of regex to check for HTML elements in tests --------- Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent d341f2a commit c7b25ea

6 files changed

Lines changed: 35 additions & 1 deletion

File tree

news/changelog-1.9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ All changes included in 1.9:
6262
- ([#13547](https://github.com/quarto-dev/quarto-cli/issues/13547))`cookie-content: { type: express }` is now the default. Previously it was `type: implied`. It now means this will block cookies until the user expressly agrees to allow them (or continue blocking them if the user doesn't agree).
6363
- ([#13570](https://github.com/quarto-dev/quarto-cli/pull/13570)): Replace Twitter with Bluesky in default blog template and documentation examples. New blog projects now include Bluesky social links instead of Twitter.
6464
- ([#13716](https://github.com/quarto-dev/quarto-cli/issues/13716)): Fix draft pages showing blank during preview when pre-render scripts are configured.
65+
- ([#13847](https://github.com/quarto-dev/quarto-cli/pull/13847)): Open graph title with markdown is now processed correctly. (author: @mcanouil)
6566

6667
### `book`
6768

src/project/types/website/website-meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ function metaMarkdownPipeline(format: Format, extras: FormatExtras) {
506506
if (renderedEl) {
507507
// Update the document title
508508
const el = doc.querySelector(
509-
`meta[name="og:site_name"]`,
509+
`meta[property="og:site_name"]`,
510510
);
511511
if (el) {
512512
el.setAttribute("content", renderedEl.innerText);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
project:
2+
type: website
3+
4+
website:
5+
title: "Quarto CLI {{< var version >}}"
6+
open-graph: true
7+
navbar:
8+
left:
9+
- href: index.qmd
10+
text: Home
11+
right:
12+
- icon: github
13+
href: https://github.com/
14+
15+
format:
16+
html:
17+
theme: cosmo
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version: 1.0.0
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "PR 13847: open graph metadata"
3+
_quarto:
4+
render-project: true
5+
tests:
6+
html:
7+
ensureHtmlElements:
8+
-
9+
- 'meta[property="og:site_name"][content*="Quarto CLI 1.0.0"]'
10+
- []
11+
---
12+
13+
This test check that the website title is correctly resolved when used in open graph site name, including when using a shortcode.

0 commit comments

Comments
 (0)