Skip to content

Commit

Permalink
Add some lines about permalinks tokens in front matter
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 2, 2024
1 parent 328fe56 commit 82bb250
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion content/en/content-management/urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ multilingual|`about`|`https://example.org/de/about/`

If you set both `slug` and `url` in front matter, the `url` value takes precedence.

#### Permalinks tokens in front matter

{{< new-in "0.131.0" >}}

You can also use [Permalinks tokens](#tokens) in the `url` front matter. This is typically used in `cascade` sections:

{{< code-toggle file=content/foo/bar/_index.md fm=true >}}
title ="Bar"
[[cascade]]
[cascade.params]
url = "/:sections[last]/:slug"
{{< /code-toggle >}}


## Site configuration

### Permalinks
Expand Down Expand Up @@ -233,7 +247,9 @@ public/
#### Tokens
Use these tokens when defining the URL pattern.
Use these tokens when defining the URL pattern. These can both be used in the `permalinks` configuration and in the front matter [url](#permalinks-tokens-in-front-matter).
`:filename`
`:year`
: The 4-digit year as defined in the front matter `date` field.
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
command = "hugo --gc --minify"

[build.environment]
HUGO_VERSION = "0.130.0"
HUGO_VERSION = "0.131.0"

[context.production.environment]
HUGO_ENV = "production"
Expand Down

0 comments on commit 82bb250

Please sign in to comment.