Hello.
Is it possible to extract only the domain name from a URL?
https://www.example.com > example
Thanks
I tried something like this:
{{ $url := urls.Parse "https://www.example.com" }}
{{ $name := slice $url.Host "." }}
ā¦?
EDIT
Got it
{{ $url := urls.Parse "https://www.example.com" }}
{{ $name := split $url.Host "." }}
{{ index $name 1 }}