Skip to content

Conversation

@piedoom
Copy link
Contributor

@piedoom piedoom commented Jan 29, 2026

This adds a unique opengraph description to posts with several fallbacks. I thought it may be a useful addition with #2351, but let me know your thoughts for or against this change.

Currently, all posts have the same static text opengraph description:

Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!"

First, if a description is provided in the page's frontmatter, it will take priority as the opengraph description. It does not appear that any articles have a description today.

In the case of no specified description, it will default to the first 150 characters of the post as the opengraph description.

If there is no content (e.g., the page is an index or category page) the description will default to the original text.

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible C-Webdev S-Needs-Review A-Cross-Cutting Impacts multiple parts of the website labels Jan 29, 2026
@alice-i-cecile
Copy link
Member

opengraph description

Can you explain like I'm not a web dev what this is used for, and how it's traditionally set up? :)

@piedoom
Copy link
Contributor Author

piedoom commented Jan 29, 2026

Opengraph descriptions are shown on social media when sharing posts. Currently, all descriptions default to the aforementioned string as you can see here:

image

With this change, that text instead would be the first 150 characters of the page contents (or a bit shorter depending on the site), which I think gives a little more context to the post when shared. e.g.:

"Thanks to 174 contributors, 659 pull requests, community reviewers, and our generous donors, we're happy to announce the Bevy 0.18 release on crates.i…"

Any *.md files with a description value in their front matter can override this generated text to their discretion.

Edit: I should also mention this only really applies to news posts and the learn tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Cross-Cutting Impacts multiple parts of the website C-Feature A new feature, making something new possible C-Webdev S-Needs-Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants