Code Monkey home page Code Monkey logo

Comments (8)

Bakusedu avatar Bakusedu commented on July 30, 2024 1

@kishori-patil1 try adding the following to your nuxt.config.ts to add your hostname:

site: {
	url: process.env.BASE_URL, // url to your nuxt app
},

See: https://nuxtseo.com/sitemap/getting-started/installation

Screenshot 2024-04-09 at 16 16 45

from sitemap.

chenyuncai avatar chenyuncai commented on July 30, 2024 1

the config field "site.url " in nuxt.config is always prefixed in final sitemap links, but maybe it is not needed for all case.

On my case, we deploy one application with many sub-domains.

solution1: remove site.url in nuxt.config.ts and return loc with full href in dynamic endpoint
solution2: need sitemap module to avoid to add site.url again when links already has "http" prefix.

from sitemap.

kishori-patil1 avatar kishori-patil1 commented on July 30, 2024

@Bakusedu Hi, I tried this. But still I am getting the similar output.
Well, I am setting the host when I run the application. so it is taking only that value.
Is there any other way where we can add the different/multi domain urls to the sitemap?

from sitemap.

kishori-patil1 avatar kishori-patil1 commented on July 30, 2024

@Bakusedu @harlan-zw Hi, One thing I have observed that, the sources array in sitemap config object, it fetches the sitemaps from the external endpoints which are mentioned in the array.
So when I visit the /sitemap_index.xml, The request call gets hit. Now, I have all the data, but when I want to see, let's say 0-sitemap.xml, the request call again gets hit. In my understanding, this should not happen since you already have the data.
Can you please help me understanding the behaviour of sources config as well as can we add sources for each sitemap in Automatic chunking?

from sitemap.

chenyuncai avatar chenyuncai commented on July 30, 2024

can we pass the original H3Event to dynamic source fetch in buildSitemap -> resolveSitemapSources -> fetchDataSource and proxy more headers like "host"

from sitemap.

harlan-zw avatar harlan-zw commented on July 30, 2024

I have tried to replicate both issues here:

  • Absolute URLs getting prefixed with the site URL
  • Absolute URLs hostname getting stripped for the site path

I was not able to replicate either, please provide a Stackblitz reproduction if you'd like me to explore further. See https://nuxtseo.com/og-image/getting-started/stackblitz

If you have feature requests outside of these issues please make them as their own issue so they can be tracked and discussed properly.

from sitemap.

chenyuncai avatar chenyuncai commented on July 30, 2024

I reproduce and check the link below.

  1. The log in dynamic endpoint can only get 'localhost',
  2. When i18n enabled, the returned urls are prefixed with site.url

https://stackblitz.com/edit/nuxt-starter-w4gkcw?file=server%2Fapi%2Fsitemap.ts

from sitemap.

harlan-zw avatar harlan-zw commented on July 30, 2024

Thank you @chenyuncai, seems like this was a specific issue with absolute URLs in dynamic sources with i18n enabled.

Should be fixed in v5.1.5.

from sitemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.