Setting open-graph and twitter images for all chapters of a Quarto book #11914
Replies: 1 comment 1 reply
-
Your quote is partial:
Source: https://quarto.org/docs/websites/website-tools.html#social-metadata Unfortunately as you did not provide a small reproducible example for example using |
Beta Was this translation helpful? Give feedback.
-
Description
I was under the impression that if I set
image
in_quarto.yml
(and setopen-graph
andtwitter-card
totrue
) than that image will be used for all chapters in a Quarto book (where chapters are in different HTML files). This seems to be logical, as one would probably want to see the same sharing image no matter what concrete chapter is shared from the same book.However, it seems to me that
index.qmd
) thecover-image
is used asog:image
andtwitter:image
(instead of theimage
),og:image
andtwitter:image
(instead of theimage
),image
is only used asog:image
andtwitter:image
if the chapter is not the first one and it does not contain a single image.Isn't it a bug...? Especially because the documentation says "by default, Quarto will use the image value from the format metadata", and this is exactly what I have done, provided an image value in the format metadata -- yet, Quarto will use different image (probably in all cases, if we do not have chapters without image!).
A minimal reproducible example:
_quarto.yml
:index.qmd
:chap1.qmd
:Now, if you render this, the main page's HTML will include
<meta property="og:image" content="cover.png">
(and similarly fortwitter:image
) while Chapter 1's HTML will include<meta property="og:image" content="chap1.png">
(and similarly fortwitter:image
). I.e., theimage
I have set above,ogimage.jpg
does not even appear...!Beta Was this translation helpful? Give feedback.
All reactions