Replies: 3 comments 2 replies
-
Hi @apurva thanks for taking the time to give the module a go, and provide feedback. I thought that maybe I hadn't successfully caught this bug as I haven't currently got a test running for no render hook, however I have added the test and still everything seems to function fine. You can view the test site @ https://github.com/future-wd/hugo-responsive-images/tree/master/.test-site I also created a test repo, and had no luck finding the error there either. The reason that you are seeing render-hook error even with render hook disabled (Default) as theres no way of disabling the code, I just re-rout to a partial with emulates the stock markdown image handling if render_hook is disabled. Things to try:
although that probably won't fix the problem its good to know if that works. Could you please send me a link to the repository? Then I can have a look. Thanks again |
Beta Was this translation helpful? Give feedback.
-
An idea - check your go version against my docs
…On Fri, 27 Jan 2023, 1:45 pm Apurva Roy Choudhury, ***@***.***> wrote:
Hi @sean-au <https://github.com/sean-au> thank you for taking the time to
look into my issue! And thanks for sharing this module! It seems to be an
essential component to have proper responsive images with Hugo. I have been
looking for a good solution for quite a bit now and your module seems to be
the most well rounded solution out there.
I still am not able to get the module to work though. I did some further
digging and here are my findings:
- My Hugo version is v0.110.0+extended darwin/amd64. I did update to
the latest before beginning the tests with this module.
- Also upgraded the module to the recent code you checked in using hugo
mod get -u
- While my initial tests were on a large, old site thats been around
since Hugo 0.5, I tried setting u the module on another test site,
relatively newly created and had the same errors.
- I couldn't locate the NPM script you mention and was unable to run
the test-site from within the .test-site folder using Hugo server as I
received errors including failed to download modules: failed to
execute 'go [mod download]': failed to execute binary "go" with args [mod
download]: go: ***@***.***
- In my original site, I moved the module to _vendor using the command hugo
mod vendor and then deleted the _markup folder in _default from within
the module and the site began to build. (I don't intend to use the render
hooks anyways and prefer to go the shortcode route.)
- However, when I tried using the shortcode {{< picture src=image.jpg
aspect_ratio=4,3 widths=400,900 alt="Test Image" >}} I received an
error similar to earlier: "/Users/****/****.md:26:1": failed to render
shortcode "picture": failed to process shortcode: "/Users/***/_vendor/
github.com/future-wd/hugo-responsive-images/layouts/shortcodes/picture.html:16:15":
execute of template failed at <partial "hri/private/params/shortcode" .>:
error calling partial: "/Users/****/_vendor/
github.com/future-wd/hugo-responsive-images/layouts/partials/hri/private/params/shortcode.html:60:118":
execute of template failed at <$meta.shortcode_wrapper_class>: can’t
evaluate field shortcode_wrapper_class in type bool
From the looks of it, to me it seems to be some form of environmental
issue rather than a specific bug in the code - based in the fact that the
problem occurs between different projects & different code paths.
FYI - I am testing on a Mac and building locally. From the absence of
.DSStore in your git ignore file I assume you are not on MacOS. Wondering
if the problem is something to do with the Go environment on my system
(though is seems unlikely as the error is being thrown by Hugo template
execution).
My projects are in private repos, so please do let me know if you would
like me to invite you into the repo so you could take a look at the site I
am working with.
Thanks again for your time!
—
Reply to this email directly, view it on GitHub
<#55 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARTWGA35YLQBK4XECCXBVI3WUOYPBANCNFSM6AAAAAAUGI5SYQ>
.
You are receiving this because you were mentioned.Message ID:
<future-wd/hugo-responsive-images/repo-discussions/55/comments/4796145@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
All I can suggest is try adding another hugo module to this package. You can try github.com/future-wd/hugo-responsive-background-images |
Beta Was this translation helpful? Give feedback.
-
Hello community,
I have followed the setup guide and upon adding the module to my site, Hugo won't start server and responds with the following error:
Error: Error building site: "/Users/******/content/blog/******.md:1:1": "/var/folders/8d/pzcf9smn5ps7w_g56wdb7f240000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/future-wd/[email protected]/layouts/_default/_markup/render-image.html:18:15": execute of template failed: template: _default/_markup/render-image.html:18:15: executing "_default/_markup/render-image.html" at <partial "hri/private/params/render-hook" .>: error calling partial: "/var/folders/8d/pzcf9smn5ps7w_g56wdb7f240000gn/T/hugo_cache/modules/filecache/modules/pkg/mod/github.com/future-wd/[email protected]/layouts/partials/hri/private/params/render-hook.html:27:24": execute of template failed: template: partials/hri/private/params/render-hook.html:27:24: executing "partials/hri/private/params/render-hook.html" at <$meta.render_hook>: can't evaluate field render_hook in type bool Built in 2864 ms
I have tried adding the following (which is supposed to be default anyway), but with no impact.
I have also tried to localize the module into _vendor by using
hugo mod vendor
, again with no impact besides the paths changing to the _vendor directory in the error above.Unsure why the render_hook template is being called when I have not made any specific indications to use render_hooks
Any assistance about where to dig in to find a solution would be greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions