mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '83bef6955e014d40c0f00db9cebe09113154e999'
This commit is contained in:
34
docs/content/en/functions/relref.md
Normal file
34
docs/content/en/functions/relref.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: relref
|
||||
# linktitle: relref
|
||||
description: Looks up a content page by relative path.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [cross references, anchors]
|
||||
signature: ["relref . CONTENT"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: [ref]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
|
||||
|
||||
```
|
||||
{{ relref . "about.md" }}
|
||||
```
|
||||
|
||||
{{% note "Usage Note" %}}
|
||||
`relref` looks up Hugo "Regular Pages" only. It can't be used for the homepage, section pages, etc.
|
||||
{{% /note %}}
|
||||
|
||||
These functions are used in two of Hugo's built-in shortcodes. You can see basic usage examples of both `ref` and `relref` in the [shortcode documentation](/content-management/shortcodes/#ref-and-relref).
|
||||
|
||||
For an extensive explanation of how to leverage `ref` and `relref` for content management, see [Cross References](/content-management/cross-references/).
|
Reference in New Issue
Block a user