Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Function to parse URLs #3849
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.