-
-
Notifications
You must be signed in to change notification settings - Fork 63
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 does not include the images even though the Nuxt content pages contain many images. #298
Comments
Did you try following Automatic Image Discovery? |
@harlan-zw
Previously I was just using the
Do I need to add anything for the |
@harlan-zw I tried the approach you mentioned but seems like its not working. Any suggestion, please? |
Sorry looks like I missed that part. The quickest and easiest way for me to help you is by providing a reproduction, there's even already a Nuxt Content starter for you https://stackblitz.com/edit/nuxt-starter-a5qk3s?file=nuxt.config.ts You've given me a lot of information but not a lot I can do without replicating the issue, this feature works as far as I know, there are tests in place for it. |
@harlan-zw I have my contents/images in |
@harlan-zw As per your request I have added my reproduction code here CodeSandBox if you get a chance can you please have a look and provide some solution? |
I had a look at this and it seems like the regex parsing was broken for the I've pushed up a fix which is in v6.0.0-beta.4 of the sitmeap module, you can upgrade to it by deleting your lock file + node_modules and re-installing. If you still have issues please use this as a reproduction https://stackblitz.com/edit/nuxt-starter-a5qk3s?file=app.vue, the codesandbox has issues running. |
Thanks a lot for the response and quick fix. For some reason I am still facing the issue. As per you suggestion I did the following in my project:
For some reason I am still unable to get any images in my As requested by you I tried on Stackblitz but for some reason unable to upload dummy images there and it suddenly breaks for some reason not sure why. I am facing some issues on Stackblitz. I have updated code in both CodeSandBox and on Stackblitz. Can you please have a look and let me know how to get the images in Thanks a lot in advance. |
Additionally, I tried the following:
Then I ran the I am getting the following contents in my sitemap.xml. I can see only the page-related things but not the images that I have added to my I hope I am doing everything correctly, still, I do not get anything. |
Just wanted to confirm if I can try something to fix the issue. Anything is required from my side for you to fix the issue? |
Is there any alternative way or work-around to fix the issue for now until the final fix has been added to @nuxt/sitemap? Looking forward to some approach or fix. |
The issue seems to be quite simple, you have disabled If you're using Saying that I did do some testing with your setup and noticed some duplicate |
Thanks a lot its working fine now with I have a few I have a Nuxt content website with some of the markdown files in /content/index.md with tags such as:
I am generating the
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 |
I am developing a
Nuxt content
website for documentation purposes and using theNuxt Sitemap
in it.I have created a similar repo as my original project on CodeSandBox. Can someone please have a look and provide some solutions on the automatic generation of sitemap for images in the Nuxt Content project?
I am adding the
sitemap
information to my/content/docs
with all themarkdown
or .md files such as:/content/docs/introduction/index.md
:I can generate the
sitemap.xml
file during thenpm run generate
but this generates theurl
only for the routes that are present in/content/docs
where I have added thesitemap
information to myindex.md
files such as this in:I have many images within this
index.md
file but these images are for some reason not included in thesitemap.xml
file. I don't want to specify each image in my all.md
files rather want a dynamic approach whereNuxt Content/Sitemap
can automatically scan and include all images in my/content/docs
so it's all included insitemap.xml
file.I added the following:
This will add only the specified image here to my
sitemap.xml
file. However, I have a lot of images in different .md files within myNuxt content /content/docs
. How to include all dynamically and directly without specifying each of them here innuxt.config.js
file?And a file in
/server/api/__sitemap__/urls.ts
but this also does not make any difference and I do not get my images or videos in sitemap.xml file:layouts/default.vue
with<main>
something like this:Previously I was just using the
<slot />
. Even after adding the<main>
when I generate the.output
I don't see image-related things insitmap.xml
.References:
Is there any way to achieve this?
The text was updated successfully, but these errors were encountered: