-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update index.js #41
base: main
Are you sure you want to change the base?
Update index.js #41
Conversation
Prefixed the url with self.baseUrl in line 494, so the sitemap will be valid if baseUrl is configured in the module, but not at application level.
Is the idea with this change to allow a different domain for the sitemap from what is configured for the application? Why would you want to do that? UPDATE: Nevermind! I see that's in the documentation already. |
Slightly off-topic, but an answer to your question: we're using it for a website that switches languages based on subdomain, so we don't define baseUrl in app.js. Of course that in itself causes all kinds of trouble with the sitemap, SEO, Open Graph and so on. So I will probably look into the workflow module for one of the next releases. |
Hmm. This would break the module for most people because self.baseUrl defaults to the apostrophe top-level baseUrl, which will already be present in But, we went down the road of suggesting that this option is a viable alternative to setting the global baseUrl long ago. Even if the workflow module is a better answer really. So it makes sense to fix it, but the logic has to check whether |
You're absolutely right. Happy to improve that. |
Added check if baseUrl is set in app.js. If not, prefixing the url with self.baseUrl, but only if set...
In the fix I'm proposing now, baseUrl in app.js always wins if set. Not sure if that is intended behaviour. The other way around would imply removing the baseUrl from the page url. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that should do it.
Prefixed the url with self.baseUrl in line 494, so the sitemap will be valid if baseUrl is configured in the module, but not at application level.