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

Issue with image scaling from shortcodes #4202

Closed
bep opened this Issue Dec 31, 2017 · 15 comments

Comments

Projects
None yet
4 participants
@bep
Member

bep commented Dec 31, 2017

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

@bep bep self-assigned this Dec 31, 2017

@bep bep added the Bug label Dec 31, 2017

@bep bep added this to the v0.32.1 milestone Dec 31, 2017

bep added a commit to bep/hugo that referenced this issue Jan 1, 2018

bep added a commit that referenced this issue Jan 1, 2018

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 1, 2018

Member

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.

Member

bep commented Jan 1, 2018

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.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 1, 2018

Member

Never mind, I can reproduce it now.

Member

bep commented Jan 1, 2018

Never mind, I can reproduce it now.

@bep bep closed this in 16e1d99 Jan 1, 2018

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 1, 2018

Member

@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.

Member

bep commented Jan 1, 2018

@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.

bep added a commit that referenced this issue Jan 1, 2018

resource: Use the correct Destination FS
Source and destination will be the same when this happens, but it should be correct.

See #4202
@RickCogley

This comment has been minimized.

Show comment
Hide comment
@RickCogley

RickCogley Jan 1, 2018

Contributor
Contributor

RickCogley commented Jan 1, 2018

@RickCogley

This comment has been minimized.

Show comment
Hide comment
@RickCogley

RickCogley Jan 2, 2018

Contributor

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"
Contributor

RickCogley commented Jan 2, 2018

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"
@RickCogley

This comment has been minimized.

Show comment
Hide comment
@RickCogley

RickCogley Jan 2, 2018

Contributor

@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.

Contributor

RickCogley commented Jan 2, 2018

@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.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 2, 2018

Member

Thanks. I have also added some shortcode examples here:

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

Member

bep commented Jan 2, 2018

Thanks. I have also added some shortcode examples here:

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

@RickCogley

This comment has been minimized.

Show comment
Hide comment
@RickCogley

RickCogley Jan 2, 2018

Contributor

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

Contributor

RickCogley commented Jan 2, 2018

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

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 2, 2018

Member

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):

golang/go#10608

Member

bep commented Jan 2, 2018

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):

golang/go#10608

@jensamunch

This comment has been minimized.

Show comment
Hide comment
@jensamunch

jensamunch Jan 2, 2018

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

jensamunch commented Jan 2, 2018

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

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 2, 2018

Member

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).

Member

bep commented Jan 2, 2018

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).

@bep bep reopened this Jan 2, 2018

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 2, 2018

Member

See #4213

Member

bep commented Jan 2, 2018

See #4213

@bep bep closed this Jan 2, 2018

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jan 3, 2018

Member

@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.

Member

bep commented Jan 3, 2018

@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.

@jensamunch

This comment has been minimized.

Show comment
Hide comment
@jensamunch

jensamunch Jan 3, 2018

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

jensamunch commented Jan 3, 2018

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

@saiarung27

This comment has been minimized.

Show comment
Hide comment
@saiarung27

saiarung27 Jan 24, 2018

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

saiarung27 commented Jan 24, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment