-
Notifications
You must be signed in to change notification settings - Fork 211
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
Use property
attribute for OpenGraph title and image
#3213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to the issue @RogueCode007! There are some changes required to make the code work properly. Additionally, after making these changes, you will need to update the tests.
frontend/src/utils/og.ts
Outdated
import type { MetaPropertyName } from "vue-meta/types/vue-meta" | ||
import type { MetaPropertyProperty } from "vue-meta/types/vue-meta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These types are imported from the vue-meta
package and must use the name set by that package. Please revert this change.
frontend/src/utils/og.ts
Outdated
name: "robots", | ||
property: "robots", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The robots meta tag must use name
and content
. Please revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RogueCode007, og.ts
only creates the meta for single result pages (single image and single audio).
To change the meta
for other pages, you'll need to update these lines:
openverse/frontend/src/constants/meta.ts
Lines 27 to 31 in 0d95b62
{ hid: "og:title", name: "og:title", content: "Openverse" }, | |
{ | |
hid: "og:image", | |
name: "og:image", | |
content: "/openverse-default.jpg", |
ah thanks! i was wondering what was wrong
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work, @RogueCode007 ! Thank you for your contribution 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, LGTM. Tested locally and everything works. Thanks for the contribution @RogueCode007!
property
attribute for OpenGraph title and image
Fixes
Fixes #3211 by @sarayourfriend
Description
Change OpenGraph tags for title, description, and image from using a name attribute to using a property attribute instead.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin