jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
908 stars 50 forks source link

The media attribute is ignored when included in extend.meta #75

Closed jasontyping closed 11 months ago

jasontyping commented 11 months ago

Since astro-seo does not have built in support for meta elements with the name "theme-color", the preferred method to include those meta elements would be to use extend.meta. Those meta elements can use a "media" attribute.

Extending the meta element in astro-seo would look something like this: { name: "theme-color", media: "(prefers-color-scheme: dark)", content: theme_color_dark },

However, astro-seo seems to ignore the media attribute so that the output will just look something like this, missing the media attribute: <meta content="#010101" name="theme-color">

Workaround is just to enter the meta tag the old fashioned way in the source. But perhaps astro-seo can support this use case.

jonasmerlin commented 11 months ago

Hey @jasontyping, thank you for your feedback! I think this request is very reasonable, but since there is an existing workaround and I sadly don't have enough time to add features to astro-seo right now, I would have to count on someone creating a PR for this. Maybe you want to give it a try?

jasontyping commented 11 months ago

Yes, I have this update in PR #78.