Hugo: relLangURL adds base url when given value is absolute url with different protocol

Created on 18 Aug 2019  路  6Comments  路  Source: gohugoio/hugo

When using relLangURL and passing it values such as irc://example, Hugo thinks the value is relative and prepends base url. I think it's because of this condition which returns false and that url doesn't fall through:

helpers/url.go:218

(!strings.HasPrefix(in, baseURL) && strings.HasPrefix(in, "http")) || strings.HasPrefix(in, "//")

I think it should change to another condition which checks if protocol or "//" is provided in the value which would make it an absolute url.

Enhancement

Most helpful comment

I would appreciate any response on this issue.

All 6 comments

Is there any extra information I can provide? I can try and work on it if it's approved.

It would be extremely useful to use different protocols such as tel: and even custom protocols for use in an intranet environment.

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.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

I would appreciate any response on this issue.

Any news on this issue?

I'm also trying to use a tel: link and getting http://127.0.0.1:4321/tel:/[phonenumber]
Please fix this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaushalmodi picture kaushalmodi  路  3Comments

antifuchs picture antifuchs  路  3Comments

crash-dive picture crash-dive  路  3Comments

chrissparksnj picture chrissparksnj  路  3Comments

vielmetti picture vielmetti  路  3Comments