-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Document absURL and relURL’s behaviours with leading /
slash
#469
Comments
This has come up many times before.. I believe it's a bug.. but we need to document whatever the current behavior is. Here's a recent thread with lots of detailed discussion. |
/
slash/
slash
/
slash/
slash
Okay, here is a historical account of what led to today's absURL behaviour:
|
See also https://discourse.gohugo.io/t/problem-with-relurl-on-hugo-themes-demo-sites/11850 (Problem with And MunifTanjim/minimo#121. Is it really a Hugo bug as @MunifTanjim suggested? Or is it something else? Oh! Indeed! Running hugo with the environment variable |
Extensive discussion |
@anthonyfok You're welcome. Here's a test page (that I also link in the discourse thread you linked), that summarizes the absURL vs relURL vs canonifyURLs: https://hugo-sandbox.netlify.com/subdir-canonify-true/. This inconsistency definitely looks like a bug to me. I hope it gets fixed. |
/
slash/
slash
Not sure what the issue is, but I just wanted to point out that:
So, whatver you do to verify "correctness", if will have to be the rendered output (and not some debug output of Hope that helps. |
Thank you for the clarification, @ bep!
There are actually a few separate issues that got kind of mixed into one single GitHub issue about clarifying absURL/relURL documentation:
So, yes, it suddenly became a lot more complicated than I thought. (I went dumbfounded... my head sort of exploded.) But your clairification did ease my fear a lot. :-) Moving forward:
|
Also see gohugoio/hugo#4733 |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
This addresses changes made in: gohugoio/hugo#10002 Closes #469
absURL
and relURLseems to ignore the sub-folder of the baseURL when it is given a path with a leading/
slash, but that behaviour isn't documented in https://gohugo.io/functions/absurl https://gohugo.io/functions/relurl.See theNewDynamic/gohugo-theme-ananke#103 for example.
TODO: Study AbsURL() and RelURL() in helpers/url.go (and maybe fix the comments there too) before touching hugoDocs
The text was updated successfully, but these errors were encountered: