summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions/urls.Parse.md
blob: 67673421095d45bdc71a45fabd5c90f53740de61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
title: urls.Parse
description: Parse parses a given url, which may be relative or absolute, into a URL structure.
date: 2017-09-25
publishdate: 2017-09-25
lastmod: 2017-09-25
categories: [functions]
menu:
  docs:
    parent: "functions"
keywords: [urls]
signature: ["urls.Parse URL"]
workson: []
hugoversion:
deprecated: false
aliases: []
---

`urls.Parse` takes a url as input


```go-html-template
{{ $url := urls.Parse "http://www.gohugo.io" }}
```

and returns a [URL](https://godoc.org/net/url#URL) structure. The struct fields are accessed via the `.` notation:

```go-html-template
{{ $url.Scheme }} → "http"
{{ $url.Host }} → "www.gohugo.io"
```