From a4ea3402d1c95a52f4341d411790a16e131d71b3 Mon Sep 17 00:00:00 2001 From: Ricardo N Feliciano Date: Wed, 13 Dec 2017 17:10:19 -0500 Subject: [PATCH] Fix ref and relref function pages. --- content/functions/ref.md | 10 +++++++--- content/functions/relref.md | 12 ++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/content/functions/ref.md b/content/functions/ref.md index ac35cc8b7..d63c0a89d 100644 --- a/content/functions/ref.md +++ b/content/functions/ref.md @@ -11,7 +11,7 @@ menu: docs: parent: "functions" keywords: [cross references, anchors] -signature: ["ref CONTENT"] +signature: ["ref . CONTENT"] workson: [] hugoversion: relatedfuncs: [relref] @@ -19,12 +19,16 @@ deprecated: false aliases: [] --- -`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink: +`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink: ``` -{{ ref "about.md" }} +{{ 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/). diff --git a/content/functions/relref.md b/content/functions/relref.md index 32d7075c8..ea992af2f 100644 --- a/content/functions/relref.md +++ b/content/functions/relref.md @@ -11,20 +11,24 @@ menu: docs: parent: "functions" keywords: [cross references, anchors] -signature: ["relref CONTENT"] +signature: ["relref . CONTENT"] workson: [] hugoversion: -relatedfuncs: [relref] +relatedfuncs: [ref] deprecated: false aliases: [] --- -`ref` and `relRef` look up a content page by relative path (`relref`) or logical name (`ref`) to return the permalink: +`ref` and `relref` look up a content page by logical name (`ref`) or relative path (`relref`) to return the permalink: ``` -{{ relref "about.md" }} +{{ 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/).