Hugo: Issue with image scaling from shortcodes

Created on 31 Dec 2017  Â·  15Comments  Â·  Source: gohugoio/hugo

There is a dependency issue there; it works if you trigger a second build. This would probably work if we use the source instead of the published image as source, which also makes more sense.

See https://discourse.gohugo.io/t/hugo-0-32-related-questions-discussions/9770/3

Bug

Most helpful comment

@jensamunch this is now fixed in 0.32.2. I have verified it on Netlify here: https://next--gohugoio.netlify.com/about/new-in-032/ ... i.e. I deleted the /resource dir from the GitHub repo; I would, however, recommend that you commit that folder to Git as it will make the builds much faster.

All 15 comments

I have looked into this and tried to add a failing test for it. The issue isn't what I thought initially; seems to be some kind of race where it doesn't fail all of the time. I will have to look into this more closely. In fact, I can not reproduce it at all at the moment.

Never mind, I can reproduce it now.

@RickCogley I will cut a release with a patch for this tomorrow -- this should be clear-cut, but you could give it a spin if you want.

Of course @bep, I'll test. Thank you for fixing it so quickly over your
holiday! :-)

On Mon, Jan 1, 2018 at 10:26 PM, Bjørn Erik Pedersen <
[email protected]> wrote:

@RickCogley https://github.com/rickcogley I will cut a release with a
patch for this tomorrow -- this should be clear-cut, but you could give it
a spin if you want.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/gohugoio/hugo/issues/4202#issuecomment-354653315, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAfRSJNqgTn0CRN02Oqw79lTAZPZTmhLks5tGNz5gaJpZM4RP2LQ
.

--
Rick Cogley
rick.[email protected] | M: 090-9959-5452

  • Bilingual IT solutions and management firm—eSolia*eSolia Year End
    Holiday
    : 28th Dec through 4 Jan Inclusive, back in office from 5th Jan
    2018.

--
This email message and any attachments are confidential, and are meant to
be read by the intended recipient only. If you are not the intended
recipient, we would request you delete this message or any attachments
without reading or distributing, and kindly advise eSolia Inc. (contacts:
esolia.com/about http://esolia.com/about). Thank you in advance.

Ok @bep, happy new year, and I tested after compiling.

This time it still required two runs after I updated the post in question, but, it did work. What I did:

  • added back the delete commands in my deploy script, so that the source folder gets deleted completely before it's sent to the server via rsync
  • updated the post with the image resource (changed tags, updated date, nothing to do with the resource image itself)
  • git commit and push
  • published using my script
  • confirmed the post, but the shortcode is broken again, so that bit of html is broken on the published page
  • re-published using my script
  • confirmed again, and this time the html appears fine
  • look at git status, and notice that the image has been regenerated, and is appearing as "untracked"

Anyway, it appears to work somehow. I'll let you know what else I see if anything.

Thanks again.
Rick

~
Hugo Static Site Generator v0.33-DEV-3DD8C1C0 darwin/amd64 BuildDate: 2018-01-02T20:09:15+09:00
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.9.2"
~

@bep sorry. After I added back the delete lines, I did not re-source .zshrc so it is likely that my deploy script was still not deleting. I restarted my terminal, to be sure .zshrc would reload, and tried again. This time, no problem after refreshing the post again (script fully deleted the source folder before the rsync); the published post appears normal.

Thanks. I have also added some shortcode examples here:

https://gohugo.io/about/new-in-032/#image-processing-examples

cool! I'll use your shortcode so I can learn something from it. :-)

cool! I'll use your shortcode so I can learn something from it. :-)

The scratch construct is "uglish", but that will improve when this is fixed (Go 1.11):

https://github.com/golang/go/issues/10608

Hi Bep!

I am so incredibly excited about this update! Doing images in this way changes everything!
So I threw myself at this fix but still getting errors when deploying to Netlify..

Locally hugo -v throws no errors..any thoughts?

screen shot 2018-01-02 at 13 55 51

Locally hugo -v throws no errors..any thoughts?

Yes; I just tested with the Hugo docs when deleting the resources folder. I didn't test this good enough :-) And I'm not totally sure what happens, either, but I'll reopen this and have another look.

The workaround for Netlify is, I think, to build locally and commit your resources folder to your Git repo (which is the recommended workflow in any case).

@jensamunch this is now fixed in 0.32.2. I have verified it on Netlify here: https://next--gohugoio.netlify.com/about/new-in-032/ ... i.e. I deleted the /resource dir from the GitHub repo; I would, however, recommend that you commit that folder to Git as it will make the builds much faster.

amazing @bep - i just can't believe what you've done with this project!

screen shot 2018-01-24 at 2 34 27 pm
I am getting same error please help me out altough i am using latest version

Was this page helpful?
0 / 5 - 0 ratings