Welcome to mirror list, hosted at ThFree Co, Russian Federation.

urls.Parse.md « functions « en « content « docs - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d0ade0f8f939d790511bfa6f941b27097a37696 (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
32
---
title: urls.Parse
description: Parse parses a given url, which may be relative or absolute, into a URL structure.
godocref: https://godoc.org/net/url#URL
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


```
{{ $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:

```
{{ $url.Scheme }} → "http"
{{ $url.Host }} → "www.gohugo.io"
```