Closed cpeaustriajc closed 1 year ago
The component throws an error when I pass a URL type as an argument, this fixes that error so that when creating a URL for social images.
Example:
--- import { SEO } from "astro-seo"; import aboutImage from "~/assets/images/image.jpg"; const openGraphImage = await getImage({ src: aboutImage, format: "jpeg" }); const canonicalUrl = new URL(Astro.url.pathname, Astro.site); const socialImageUrl = new URL(openGraphImage.src, Astro.url) --- <html> <head> <SEO openGraph={{ // Throws an error because it only accepts string image: socialImageUrl, url: canonicalUrl }} /> </head> <body> <!-- Body Content --> </body> </html
@jaycedotbin Thank you for this contribution! I added a test and merged it and it will land with the next version.
This has been released as part of v0.7.5
The component throws an error when I pass a URL type as an argument, this fixes that error so that when creating a URL for social images.
Example: