urls.Parse.md (630B)
1 ---
2 title: urls.Parse
3 description: Parse parses a given url, which may be relative or absolute, into a URL structure.
4 date: 2017-09-25
5 publishdate: 2017-09-25
6 lastmod: 2017-09-25
7 categories: [functions]
8 menu:
9 docs:
10 parent: "functions"
11 keywords: [urls]
12 signature: ["urls.Parse URL"]
13 workson: []
14 hugoversion:
15 deprecated: false
16 aliases: []
17 ---
18
19 `urls.Parse` takes a url as input
20
21
22 ```
23 {{ $url := urls.Parse "http://www.gohugo.io" }}
24 ```
25
26 and returns a [URL](https://godoc.org/net/url#URL) structure. The struct fields are accessed via the `.` notation:
27
28 ```
29 {{ $url.Scheme }} → "http"
30 {{ $url.Host }} → "www.gohugo.io"
31 ```