mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-09 12:24:11 +03:00
Squashed 'docs/' content from commit fdea5430f
git-subtree-dir: docs git-subtree-split: fdea5430f89dfd849d39212abdf5ace0a4763e5a
This commit is contained in:
commit
b9bd35d72e
735 changed files with 38220 additions and 0 deletions
34
content/en/functions/ref.md
Normal file
34
content/en/functions/ref.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
title: ref
|
||||
linktitle: ref
|
||||
description: Looks up a content page by logical name.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [cross references, anchors]
|
||||
signature: ["ref . CONTENT"]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: [relref]
|
||||
deprecated: false
|
||||
aliases: []
|
||||
---
|
||||
|
||||
`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink:
|
||||
|
||||
```
|
||||
{{ ref . "about.md" }}
|
||||
```
|
||||
|
||||
{{% note "Usage Note" %}}
|
||||
`ref` 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/).
|
Loading…
Add table
Add a link
Reference in a new issue