少于1分钟
将以下英文翻译为中文:
https://gohugo.io/functions/urlize/
Takes a string, sanitizes it for usage in URLs, and converts spaces to hyphens.
urlize INPUT
The following examples pull from a content file with the following front matter:
xxxxxxxxxx2 1{{ upper “BatMan” }} → “BATMAN"2{{ “BatMan” | upper }} → “BATMAN"go-html-template
=== “yaml”
``` yaml
---
location: Chicago IL
tags:
- pizza
- beer
- hot dogs
title: The World's Greatest City
---
```
=== “toml”
``` toml
+++
location = 'Chicago IL'
tags = ['pizza', 'beer', 'hot dogs']
title = "The World's Greatest City"
+++
```
=== “json”
``` json
{
"location": "Chicago IL",
"tags": [
"pizza",
"beer",
"hot dogs"
],
"title": "The World's Greatest City"
}
```
The following might be used as a partial within a single page template:
layouts/partials/content-header.html
|
|
The preceding partial would then output to the rendered page as follows:
|
|