-
Notifications
You must be signed in to change notification settings - Fork 227
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
Usage of absURL for internal links prevents hostname changes #80
Comments
@VeitSanner - This was a simple fix so I jumped the gun early, but I want to note that this has future issues within the theme. If you ever use Site.BaseURL, the site will have to be rebuilt. Other issue cases similarly persist. What are you thoughts on this? |
My understanding is that most of the site should be be working with relative URLs. So that I would be able to click through the generated site and verify that it is working. If there are some links which cannot be generated using a relative URL, that would be fine for me. E.g. I have added JSON LD elements to provide additional information on blog posts. And here I do need the absolute URL. I believe that RSS might be another area where absolute URLs are needed. But that should be rather the exception than the norm. |
Can someone let me know why we need to specify a |
@VeitSanner - I totally agree with you in that sense. I am going to try to find more information on the intended purpose of @mtjandra - I'm not really sure. I'm working on trying to find that information. I'm guessing its for SEO because as far as I understand |
So there is a discussion that occurred on the Hugo board. It seems that The issue that comes with your case is any kind of data that is connected to the
Will gladly get this fixed tonight, I just need some more thoughts and input. The other option would be to leave it as is, and encourage people that may have this issue to use |
@pacollins as far as I can see there are always going to be some links which would need the absolute URL incl. the hostname. Every URL which is provided to an external system has to be an absolute URL. That applies among others:
The resource hint you mention instruct the browser to resolve the DNS name as soon as possible, and in the case of |
I will put together another PR with this, but that leads me to this question - does changing to relURLs solve your initial problem if functions such as RSS, Google Search, and Site Map don't work without rebuilding the site? |
@pacollins, it would be fine if some areas of the site don't work due to the usage of the absolute URL. |
I have created #83, would you mind reviewing that all the appropriate URLs have been changed. I think I got it all changed. I searched the directory for EDIT: After reviewing, |
I revisited the Hugo page regarding URL Management and there they refer to |
Updated |
Share links are provided to a third party, henc, only an absolute URL would work. Yes, I’m fine with that. Thanks for your quick responses. |
Expected Behavior
When I change the hostname or DNS name of the server, all internal links of the site should still work. Hence, the usage of
is preferred over
This behavior is needed when the generated site is promoted to a staging environment before it is promoted to the live environment.
Current Behavior
Currently, many of the internal links are generated including the baseurl value from
config.toml
. When the hostname changes many links break.Possible Solution
relURL
should be used overabsURL
.instead of
Your Environment
Hugo Version:
Hugo Static Site Generator v0.30.2 darwin/amd64 BuildDate: 2017-11-01T22:26:30+01:00
The text was updated successfully, but these errors were encountered: