Closed jmooring closed 8 months ago
This was resolved with https://github.com/gohugoio/hugo/pull/11894
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
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 https://github.com/gohugoio/hugo/issues/9918.