mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
This commit is contained in:
29
docs/content/en/methods/page/Aliases.md
Normal file
29
docs/content/en/methods/page/Aliases.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Aliases
|
||||
description: Returns the URL aliases as defined in front matter.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related: []
|
||||
returnType: '[]string'
|
||||
signatures: [PAGE.Aliases]
|
||||
---
|
||||
|
||||
The `Aliases` method on a `Page` object returns the URL [aliases] as defined in front matter.
|
||||
|
||||
For example:
|
||||
|
||||
{{< code-toggle file=content/about.md fm=true >}}
|
||||
title = 'About'
|
||||
aliases = ['/old-url','/really-old-url']
|
||||
{{< /code-toggle >}}
|
||||
|
||||
To list the aliases:
|
||||
|
||||
```go-html-template
|
||||
{{ range .Aliases }}
|
||||
{{ . }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
[aliases]: /content-management/urls/#aliases
|
Reference in New Issue
Block a user