You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to extract a domain name from a URL so I can tell people where they are going. I'm using a regex now, but obviously it's a bit naïve. It would be nice to have a function in Hugo to do this.
I figure it would probably make more sense to return a map with entries like scheme, host, port, path, query, etc., instead of restricting it to the domain. Basically, what Parse in net/url does.
It would also be very useful if it could include the effective TLD+1 in the return value, using the public suffix list. There is already a go package to make it easy.
The text was updated successfully, but these errors were encountered:
I'd like to be able to extract a domain name from a URL so I can tell people where they are going. I'm using a regex now, but obviously it's a bit naïve. It would be nice to have a function in Hugo to do this.
I figure it would probably make more sense to return a map with entries like scheme, host, port, path, query, etc., instead of restricting it to the domain. Basically, what Parse in net/url does.
It would also be very useful if it could include the effective TLD+1 in the return value, using the public suffix list. There is already a go package to make it easy.
The text was updated successfully, but these errors were encountered: