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

Fixed og prefix: "og:" shouldn't be a prefix to open graph article, book, or profile tags #25

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

surya-ven
Copy link

I've made the following changes:

in packages/seo/src/utils/buildTags.ts:

  1. Added an optional ogPrefix flag parameter for the createOpenGraphTag function, which is by default true (i.e., includes the "og:" prefix by default)
  2. For Article, Profile, and Book Opengraph types, the use of the "og:" prefix is incorrect. For these, I passed in false for the ogPrefix flag. For example:
createOpenGraphTag("profile:first_name", config.openGraph.profile.firstName, false)

I've also added tests to validate all of the above changes.

Sources to validate this format:

  1. https://stackoverflow.com/questions/29748013/what-is-the-correct-implementation-of-the-open-graph-article-type
  2. https://ogp.me/ (it's more subtle, but it does state that article, book, and profile don't have "verticals", i.e., the official "og" namespace).

Additionally, I've also updated the package.json files for both the seo and analytics packages to accept Astro v5 as dependencies (including dev):
"astro": "^1.2.1 || ^2.0.0 || ^3.0.0-beta.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant