Default support for common OpenGraph metadata #3331
Replies: 1 comment 1 reply
-
Thanks for the feedback. Would you mind sharing what you tried searching on the documentation? We are always looking to improve the documentation and we might be able to improve the search experience for this topic. In Starlight, everything rendered in the
Depending on the use cases, different approaches may be more suitable. In the case of Open Graph images, if a single image is used across the site, the The documentation also references a few resources that may be useful:
For other use cases, e.g. structured data using JSON-LD, the same approaches can be used to add the necessary |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlight
are you using?0.35.1
What is your idea?
Generally there is a minimum set of OpenGraph metadata that is recommended to be supported in order for software tools to generate descriptive previews from a provided URL. Either it is unclearly documented, or Starlight does not support this set at the moment. In particular support for
og:image
is missing.og:image
to be used inastro.config.mjs
.og:image
.<head>
for broadest support.Why is this feature necessary?
In my Starlight landing page the following
<head>
metadata is generated:Several OpenGraph metadata elements are missing, most notably
og:image
, but also e.g. additional props to specify size of this image. See the specification of OpenGraph protocol at https://ogp.meIn addition there's a whole host of best-practices on the internet to ensure the best support across browsers and tools. To get that level of support it may be needed to also add JSON-LD format for the metadata. The best-practices vary over time, and I don't know what they currently are. For instance it might be necessary to also fill the
<description>
element besidesog:description
.Note that many static site generators offer easy ways to set opengraph metadata out of the box.
Do you have examples of this feature in other projects?
Four years ago I implemented OG support in https://fedi.foundation which I am now porting to Astro. At the time this was the issue with information resources and examples of JSON-LD to add: https://codeberg.org/socialcoding/fedi-foundation/issues/4
This is the entire
<head>
section that Jekyll generates based on config and frontmatter settings:Participation
Beta Was this translation helpful? Give feedback.
All reactions