Closed joshuaiz closed 1 year ago
Hey @joshuaiz have you tried to generate the SEO data in the MainLayout frontmatter section? You can avoid these conditionals in the template to solve these errors.
@achamorro-dev that's exactly what I am doing. Passing props then generating the values in frontmatter to use in the component.
If I try to load two versions of <SEO>
as above, I get very strange behavior.
In the end, I ended up just rolling my own SEO component which is working out great.
Hey @joshuaiz, sorry you felt like you had to implent your own SEO component. (Though I always encourage rolling your own specific solution!)
You have a few errors in your SEO props, e.g. the OpenGraph.image.imageAlt prop that doesn't exist. Though beyond this, I can't seem to reproduce these errors.
Hello,
Thanks for this package.
Running into an issue when conditionally loading the
<SEO />
component with different data.Here is a minimal example.
Here is
[product].astro
Then here is
MainLayout.astro
:^^ if I try to load
<SEO />
conditionally like this I get very strange errors as if the home page is trying to load[product].astro
.Bottom line is, this doesn't work...how can we dynamically load data into
<SEO />
?