Comments (8)
@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](https://private-user-images.githubusercontent.com/34550806/320904394-6efa87e2-c1cc-4a20-bb2f-2c13bd1b5d60.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyODQ2MjgsIm5iZiI6MTcyMjI4NDMyOCwicGF0aCI6Ii8zNDU1MDgwNi8zMjA5MDQzOTQtNmVmYTg3ZTItYzFjYy00YTIwLWJiMmYtMmMxM2JkMWI1ZDYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI5VDIwMTg0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiZDc4NWQ0ZmQ2NDVjZWI1N2VjNTMxZmYyZjEyODc0ZDUwNmRhYTZiNDFiYWNhNGZiNGM3NDdiZWYyN2M0ZGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uxKt-Dm-4w-t3czxu8WIOZGlYRUEyA5sN4SvBjaXJzs)
from sitemap.
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.
@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.
@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.
can we pass the original H3Event to dynamic source fetch in buildSitemap -> resolveSitemapSources -> fetchDataSource and proxy more headers like "host"
from sitemap.
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.
I reproduce and check the link below.
- The log in dynamic endpoint can only get 'localhost',
- 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.
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)
- This XML Sitemap contains 0 URLs HOT 6
- Sitemap Caching – sitemap.xml doesn’t update on Netlify host unless cacheMaxAgeSeconds is set to 0 HOT 4
- Image discovery can pull valid src values but invalid image:loc values such as data:, blob:, or file:
- Feature Request: Video Discovery HOT 2
- Various warning when running with Nuxt3
- "postinstall": "pnpm dev:prepare" issue HOT 5
- Cloudflare Pages fails because of dependency Node compatibility HOT 2
- 如何添加额外的协议 HOT 4
- When only linking to an external site map is configured, the multiple-sitemaps warning should be canceled
- i18n: How to generate dynamic urls per language? HOT 7
- i18n: How to disable indexing of custom route paths (translated route paths) HOT 7
- [Bug] 5xx if too many pages & languages HOT 2
- Conditionally allow runtime logic to prevent dynamic sitemap creation from defineSitemapEventHandler
- Homepage down HOT 1
- Dynamic URLs with i18n will not automatically add a language prefix HOT 3
- False multi-sitemap warning HOT 1
- Sitemap URL returns 500 error when accessed directly HOT 1
- docs: subdomain routing + sitemap HOT 1
- fix: [xsl] project/website name (inside h2 tag) exposing project name from package.json without any ability to hide/change it HOT 1
- help: sitemap-lastmod feature is forced to transfer iso type HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sitemap.