Open jmooring opened 1 year ago
Not in favour of this proposal as I am using it in my templating.
It is an older variable and there are still projects from 5 years ago that make use of it.
Please don’t make breaking changes because some things seem unclear.
This needs to at least wait (and in any case, we can limit the change to the documentation to start with).
Updated documentation.
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.
I'm reopening this because we recently introduced the concept of logical paths, and the easiest way to describe a logical path is the path between two nodes on a node tree, either relative to each other or absolute from the root of the tree.
In a data structure, the term "node" is never limited to a parent. https://en.wikipedia.org/wiki/Tree_(data_structure)
But our existing definition of node is limited to page kinds home
, section
, taxonomy
, term
, 404
, and maybe some others, but the definition excludes page kind page
.
I would like to deprecate .Page.IsNode
recommending the use of not .IsPage
instead. .IsPage
returns false
for page kinds home
, section
, taxonomy
, term
, 404
, and maybe some others.
This is not a technical issue... .IsNode
works fine. This is about the language of Hugo, the opportunity to clarify concepts in documentation, and to use terminology that is generally accepted.
Alternatively we could rename .Page.IsNode
(and how we name it internally) to .Page.IsList
per:
https://github.com/gohugoio/hugo/blob/master/resources/page/page.go#L214
IsNode returns whether this is an item of one of the list types in Hugo,
@bep Please comment when you have a moment. Thanks.
Why?
if not .IsPage
instead)