-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt sitemap adds unwanted spaces in the tags URL during the dynamic sitemap.xml generatation for Nuxt content website #305
Comments
This is fixed in v6.0.0 of the sitemap module, I'll release a bump to Nuxt SEO soon which will include this version. |
@harlan-zw Thanks a lot. I used the But I want to know if I want to replace them with my custom characters like |
You should just name the markdown files using these characters or use the frontmatter to configure. ---
sitemap:
loc: /whatever/you/want
--- This is mostly a non-concern for the module though. |
Thanks a lot for the quick response. I am not adding anything under the
@harlan-zw |
I have created a small reproducible project on CodeSandbox for your reference. |
Sorry, but this is not related to the sitemap module so I don't have capacity to help you debug this further. You should modify your navigation code to transform the string slug however you like. |
Details
I have a
Nuxt content
based application for which I have added theNuxt sitemap
dependency. Everything works fine and can generate thesitemap.xml
file during thenpm run generate
ornuxt generate command
. But facing a small issue when generating the URLs for the tags in the.md
markdown files in/content/index.md
files.I have also created the sample project on CodeSandBox for the reproduction. As you can observe in the Sitemap.xml there are various URLs with spaces after
localhost:3000/tags
. How to fix this?I have a few
tags
in my.md
files; if thetags
have spaces, then the spaces are retained in the generated URL within thesitemap.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:
I am generating the
sitemap.xml
using thenuxtjs/sitemap with ssr:true
. During the generation of the sitemap it generates the URL with spaceshttp://localhost:3000/tags/performance tests
. 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: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.Following is my complete
nuxt.config.js
file for the project:Complete nuxt.config.js file
How to avoid adding spaces during the URL creation for the tags? Is there a way to replace the spaces?
The text was updated successfully, but these errors were encountered: