Open christianlupus opened 2 hours ago
I should have access to .Page that points to the page containing the link.
That's is how it works. I'm guessing a little, but what I think you mean is that if you do something like this in the homepage template:
{{ range site.RegularPages }}
{{ .Content }} // the page you as .Page in the render hooks for .Content is "." (e.g. `/posts/page1`) and not $ (the home page)
{{ end }}
You expect the .Content
in the range
loop to get the home page in the hooks.
Does the above describe the problem?
I have a homepage that I want to customize with render hooks for a certain section. I created the corresponding folder
layouts/glossary/_markup/
and a filerender-link.html
inside. According to the documentation (or at least my understanding of it), in the render hook, I should have access to.Page
that points to the page containing the link.If you put a (debug) script in the
render-link.html
file containingand create a link in the section (glossary in my case), you will see, that
.Page
is the page object of the pointed-to page.So, either one should be done in my opinion
.Page
refers to the page that the link points toPersonally, I think it would be useful to have access to the local page, I see benefits for both solutions.
What version of Hugo are you using (
hugo version
)?I use the NPM package hugo-extended@0.134.3.
Does this issue reproduce with the latest release?
This is the latest version I can find on NPM and the latest version here on GitHub. I have not build hugo from scratch to test on master.