Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create og:image:alt from fig-alt #10864

Open
cscheid opened this issue Sep 23, 2024 Discussed in #10857 · 0 comments
Open

Create og:image:alt from fig-alt #10864

cscheid opened this issue Sep 23, 2024 Discussed in #10857 · 0 comments
Assignees
Labels
accessibility enhancement New feature or request listings websites Issues creating websites
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Sep 23, 2024

Discussed in #10857

Originally posted by leofontenelle September 21, 2024

Description

I missed this feature when I was working on my Quarto blog. Documentation says the OpenGraph preview image can be picked from the page content by adding the preview-image to an image. It works!

It would be even better if this feature also reused the image's fig-alt as the og:image:alt, so that I don't have to copy and paste the alternative text into the YAML header for every single blog post.

I guess this is not exactly a bug report, but I'll add steps to reproduce:

quarto create project website mysite

The _quarto.yml:

project:
  type: website

website:
  title: "Test"
  open-graph: true
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd

format:
  html:
    theme: cosmo
    css: styles.css
    toc: true

The about.qmd:

---
title: "About"
---

About this site

![](https://quarto.org/quarto.png){fig-alt="Quarto logo" .preview-image}

The resulting HTML file:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>

<meta charset="utf-8">
<meta name="generator" content="quarto-1.6.11">

<!-- snip -->

<link rel="stylesheet" href="styles.css">
<meta property="og:title" content="About – Test">
<meta property="og:description" content="">
<meta property="og:image" content="https://quarto.org/quarto.png">
<meta property="og:site_name" content="Test">
</head>

<body class="nav-fixed">

<!-- snip -->

<p>About this site</p>
<p><img src="https://quarto.org/quarto.png" class="preview-image img-fluid" alt="Quarto logo"></p>

<!-- snip -->

</body></html>

I guess I wanted was the same but with an added

<meta property="og:image:alt" content="Quarto logo">

Thanks!

@cscheid cscheid added enhancement New feature or request accessibility labels Sep 23, 2024
@cscheid cscheid added this to the v1.6 milestone Sep 23, 2024
@cscheid cscheid self-assigned this Sep 23, 2024
@mcanouil mcanouil added websites Issues creating websites listings labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility enhancement New feature or request listings websites Issues creating websites
Projects
None yet
Development

No branches or pull requests

2 participants