-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image render hook does not work with page resources any more #6851
Comments
I have a test site that builds fine with 0.64 with more or less the same construct as yours: https://agitated-kilby-da786e.netlify.com/2019/12/30/blog-post/ Meaning there must be "something else" at play in your case. |
Thanks for your quick reply, Bep!
Great photo. You live in a beautiful country. |
I don't see how, but if an image that was found (and displayed) in 0.63 does not show up in 0.64 -- that sounds like a real bug ...? |
Ok, now I know what caused the error—testing your code: In a branch bundle (
Just noticed that this happens with my own image shortcodes, too. I am reopening this issue because I do not know whether this is intended. Thanks a lot, @bep! |
@Brixy sure, but as it works for me you need to provide more context. Site source link? |
hugo-image-render-hook-test.zip Attached you find a minimal example. I simply used your render hook code because this should definitely work. The output part for the image is just
The responsive part is missing completely. Thanks for investigating. |
Just added a figure short code to demonstrate that it fails with Moreover I noticed that the file name now seems to play a role. After renaming some image files in a real project (sorry: the company has not open sourced it) the figure shortcode works. |
I am using |
The same behavior in my case for Hugo 0.64 extended (Win 64). ...
resources:
- src: image.jpg
--- In {{with .Resources.ByType "image"}}
<!-- You won't see a message below in browser console -->
<script>console.log("You have an image");</script>
{{end}} No building errors appears in Hugo terminal. |
I cannot reproduce the reports in this issue on my end. In my projects image render hooks with Page Resources called via @Brixy when I test the homepage of your test repo I am seeing a "Yep!" being rendered by your figure shortcode and an image being rendered by the respective Markdown Render Hook template. @serg it seems to me that you are having a different issue, this one is about Markdown Render Hooks and Page Resources. Not the Homepage template and Page Resources. May I suggest that you open a support ticket in the forum along while sharing your repo or at least a simplified version . |
The only relevant change in this Hugo version was to the module/theme file mounts logic. It has plenty of tests, but the devil is in the details (this is esp. true of you consider Windows vs Linux vs MacOs etc.) There is a zip file above that should fail. Someone will look into it soon, and I'm sorry about all of this, but these changes are made with noble motivation, to bring this project forward. |
Introduced in Hugo 0.64.0 Fixes gohugoio#6851
Introduced in Hugo 0.64.0 Fixes gohugoio#6851
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. |
Image render hook does not work with page resources any more
Before 0.64 this was possible:
With 0.64 the combination of
.Page.Resources
and render hooks do not seem to work. Responsive images with markdown render hook are not possible any more.Error message:
Not quite sure what the reason is; so I cannot tell if this is a bug.
Thanks a lot.
The text was updated successfully, but these errors were encountered: