content: Consolidate configuration documentation

This commit is contained in:
Joe Mooring authored and GitHub committed 2025-03-05 04:50:06 -08:00
1 parent 727ef6f665
commit b6cae5cbc6
911 files changed
+10902 -11171

No files matched your search

+17 -20
View File
@@ -3,27 +3,27 @@ title: RelRef
description: Returns the relative URL of the page with the given path, language, and output format.
categories: []
keywords: []
action:
related:
- methods/shortcode/Ref
- functions/urls/Ref
- functions/urls/RelRef
returnType: string
signatures: [SHORTCODE.RelRef OPTIONS]
params:
functions_and_methods:
related:
- methods/shortcode/Ref
- functions/urls/Ref
- functions/urls/RelRef
returnType: string
signatures: [SHORTCODE.RelRef OPTIONS]
---
The map of option contains:
## Usage
path
: (`string`) The path to the page, relative to the `content` directory. Required.
The `RelRef` method accepts a single argument: an options map.
lang
: (`string`) The language (site) to search for the page. Default is the current language. Optional.
## Options
outputFormat
: (`string`) The output format to search for the page. Default is the current output format. Optional.
{{% include "_common/ref-and-relref-options.md" %}}
The examples below show the rendered output when visiting a page on the English language version of the site:
## Examples
The following examples show the rendered output for a page on the English version of the site:
```go-html-template
{{ $opts := dict "path" "/books/book-1" }}
@@ -36,9 +36,6 @@ The examples below show the rendered output when visiting a page on the English
{{ .RelRef $opts }} → /de/books/book-1/index.json
```
By default, Hugo will throw an error and fail the build if it cannot resolve the path. You can change this to a warning in your site configuration, and specify a URL to return when the path cannot be resolved.
## Error handling
{{< code-toggle file=hugo >}}
refLinksErrorLevel = 'warning'
refLinksNotFoundURL = '/some/other/url'
{{< /code-toggle >}}
{{% include "_common/ref-and-relref-error-handling.md" %}}