astrolib
astrolib copied to clipboard
Fixed og prefix: "og:" shouldn't be a prefix to open graph article, book, or profile tags
I've made the following changes:
in packages/seo/src/utils/buildTags.ts:
- Added an optional
ogPrefixflag parameter for thecreateOpenGraphTagfunction, which is by default true (i.e., includes the "og:" prefix by default) - For Article, Profile, and Book Opengraph types, the use of the "og:" prefix is incorrect. For these, I passed in
falsefor theogPrefixflag. 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:
- https://stackoverflow.com/questions/29748013/what-is-the-correct-implementation-of-the-open-graph-article-type
- 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",