---
title: urls.URLize
linkTitle: urlize
description: Takes a string, sanitizes it for usage in URLs, and converts spaces to hyphens.
categories: [functions]
keywords: []
menu:
docs:
parent: functions
function:
aliases: [urlize]
returnType: string
signatures: [urls.URLize INPUT]
relatedFunctions:
- urls.Anchorize
- urls.URLize
aliases: [/functions/urlize]
---
The following examples pull from a content file with the following front matter:
{{< code-toggle file="content/blog/greatest-city.md" fm=true copy=false >}}
title = "The World's Greatest City"
location = "Chicago IL"
tags = ["pizza","beer","hot dogs"]
{{< /code-toggle >}}
The following might be used as a partial within a [single page template][singletemplate]:
{{< code file="layouts/partials/content-header.html" >}}
{{ .Title }}
{{ with .Params.location }}
{{ end }}
{{ with .Params.tags }}
{{ end }}
{{< /code >}}
The preceding partial would then output to the rendered page as follows:
```html
The World's Greatest City
```
[singletemplate]: /templates/single-page-templates/