Skip to content

Commit

Permalink
Change "canonical" to "logical" when describing Page.Path
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Feb 17, 2024
1 parent e328b86 commit 429eb98
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions content/en/methods/page/Path.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Path
description: Returns the canonical page path of the given page.
description: Returns the logical path of the given page.
categories: []
keywords: []
action:
Expand All @@ -13,24 +13,24 @@ action:

{{< new-in 0.123.0 >}}

The `Path` method on a `Page` object returns the canonical page path of the given page, regardless of whether the page is backed by a file.
The `Path` method on a `Page` object returns the logical path of the given page, regardless of whether the page is backed by a file.

```go-html-template
{{ .Path }} → /posts/post-1
```

This value is neither a file path nor a relative URL. It is a canonical identifier for each page, independent of content format, language, and URL.
This value is neither a file path nor a relative URL. It is a logical identifier for each page, independent of content format, language, and URL.

{{% note %}}
Beginning with the release of [v0.92.0] in January 2022, Hugo emitted a warning whenever the `Path` method was called. The warning indicated that this method would change in a future release.
Beginning with the release of [v0.92.0] in January 2022, Hugo emitted a warning whenever calling the `Path` method. The warning indicated that this method would change in a future release.

The meaning of, and value returned by, the `Path` method on a `Page` object changed with the release of [v0.123.0] in February 2024.

[v0.92.0]: https://github.com/gohugoio/hugo/releases/tag/v0.92.0
[v0.123.0]: https://github.com/gohugoio/hugo/releases/tag/v0.123.0
{{% /note %}}

To determine the canonical page path for pages backed by a file, Hugo starts with the file path, relative to the content directory, and then:
To determine the logical path for pages backed by a file, Hugo starts with the file path, relative to the content directory, and then:

1. Strips the file extension
2. Strips the language identifier
Expand Down

0 comments on commit 429eb98

Please sign in to comment.