| 1 |
--- |
| 2 |
title: Slug |
| 3 |
description: Returns the URL slug of the given page as defined in front matter. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: string |
| 9 |
signatures: [PAGE.Slug] |
| 10 |
--- |
| 11 |
|
| 12 |
{{< code-toggle file=content/recipes/spicy-tuna-hand-rolls.md fm=true >}} |
| 13 |
title = 'How to make spicy tuna hand rolls' |
| 14 |
slug = 'sushi' |
| 15 |
{{< /code-toggle >}} |
| 16 |
|
| 17 |
This page will be served from: |
| 18 |
|
| 19 |
https://example.org/recipes/sushi |
| 20 |
|
| 21 |
To get the slug value within a template: |
| 22 |
|
| 23 |
```go-html-template |
| 24 |
{{ .Slug }} → sushi |
| 25 |
``` |