Closed michael-picard closed 1 week ago
Same issue here, worth noting it only appears to happen with images generated by the nuxt/image module, at least for me.
@just-h @michael-picard
I am also facing the same issue with Nuxt/Content
. Have you guys found any workaround or alternative approach for this? I am also following up on this and posted here: https://github.com/harlan-zw/nuxt-seo/issues/298
Due to this issue, my production deployment has been blocked so wanted to see if I can figure out a work-around until we have a final fix.
Same issue here, worth noting it only appears to happen with images generated by the nuxt/image module, at least for me.
@just-h
I guess its works for both Nuxt images and normal images because in my case I tried with both and both seem to fail to generate for images: https://github.com/harlan-zw/nuxt-seo/issues/298
I've tested with 6.0.0-rc.4 and it appears to be working correctly, please upgrade.
@michael-picard @Aravinda93 Manually adding 6.0.0-beta.5 of the sitemap module fixed it for me. As of right now the lastest nuxt-seo module itself still loads the beta.2 of the sitemap as a dependency, where the issue appears to be present for my stack, so adding the sitemap module separately seems to be a functioning workaround.
@michael-picard @Aravinda93 Manually adding 6.0.0-beta.5 of the sitemap module fixed it for me. As of right now the lastest nuxt-seo module itself still loads the beta.2 of the sitemap as a dependency, where the issue appears to be present for my stack, so adding the sitemap module separately seems to be a functioning workaround.
@just-h
Thanks a lot its working fine now with ssr:true
and able to get the images in sitemap.xml
file. But I am facing one small issue:
I have a few tags
in my .md
files; if the tags
have spaces, then the spaces are retained in the generated URL within the sitemap.xml
file. Can you please let me know how to fix this?
I have a Nuxt content website with some of the markdown files in /content/index.md with tags such as:
navigation:
linkTitle: "Introduction"
tags : ["Testing tools", "performance tests", "process automation", "supply chain management", "load tests"]
I am generating the sitemap.xml
using the nuxtjs/sitemap with ssr:true
during the generation of the sitemap it generates the URL with spaces such as:
<url>
<loc>http://localhost:3000/tags/performance tests</loc>
<xhtml:link rel="alternate" href="http://localhost:3000/tags/performance tests" hreflang="x-default" />
<xhtml:link rel="alternate" href="http://localhost:3000/tags/performance tests" hreflang="en" />
</url>
Since it generates the URL with spaces they are invalid but URLs are valid when I navigate to them then they are present with spaces:
http://localhost:3000/tags/performance%20tests
How to ensure the sitemap adds appropriate spaces and checks for valid URLs before generating the sitemap.xml
using Nuxt Sitemap and replacing the spaces with URL-safe characters.
Describe the bug
My site is generated with Nuxt content. Despite the page content being inside a
main
tag the sitemap shows zero image when there is one.Reproduction
https://stackblitz.com/~/github.com/michael-picard/cv-2024?file=README.md&initialPath=/blog/languages/php/php-weakmap
System / Nuxt Info