You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The functions and methods below cannot resolve a path to a page if (a) the filename (including the extension) contains multiple dots, and (b) the path argument passed to the function or method does not include the file extension.
If, on an existing site, you implement a link render hook that resolves link destinations (no extension) to pages, the render hook will not be able to find the page, limiting your ability to create portable links. Again, this only applies to filenames with multiple dots.
The path used in the examples above is from the Hugo docs site.
Overview
The functions and methods below cannot resolve a path to a page if (a) the filename (including the extension) contains multiple dots, and (b) the path argument passed to the function or method does not include the file extension.
Examples
Path arg does not have file extension
{{ .Page.GetPage "news/2021/0.91.2-relnotes" }}
{{ .Site.GetPage "news/2021/0.91.2-relnotes" }}
{{ .Page.Ref (dict "path" "news/2021/0.91.2-relnotes") }}
{{ .Page.RelRef (dict "path" "news/2021/0.91.2-relnotes") }}
{{ ref . "news/2021/0.91.2-relnotes" }}
{{ relref . "news/2021/0.91.2-relnotes" }}
Path arg has file extension
{{ .Page.GetPage "news/2021/0.91.2-relnotes.md" }}
{{ .Site.GetPage "news/2021/0.91.2-relnotes.md" }}
{{ .Page.Ref (dict "path" "news/2021/0.91.2-relnotes.md") }}
{{ .Page.RelRef (dict "path" "news/2021/0.91.2-relnotes.md") }}
{{ ref . "news/2021/0.91.2-relnotes.md" }}
{{ relref . "news/2021/0.91.2-relnotes.md" }}
Motivation
If, on an existing site, you implement a link render hook that resolves link destinations (no extension) to pages, the render hook will not be able to find the page, limiting your ability to create portable links. Again, this only applies to filenames with multiple dots.
The path used in the examples above is from the Hugo docs site.
This enhancement would also resolve #9918.
The text was updated successfully, but these errors were encountered: