Skip to content

mrled/hugo-test-ogimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero byte image POC

I ran into a problem where Hugo would sometimes generate a zero byte image with images.Filter. I narrowed it down to:

  • At least two pages have no title in their frontmatter
  • hugo is run with --ignoreCache

It doesn't happen every time so you have to run it in a loop. On my machine, this is pretty reliable, usually producing a zero-byte image on the first or second try. Sometimes it takes four or five iterations through the loop, but not usually more than that.

I have seen the behavior on both my ARM64 macOS machine running hugo from homebrew and x86_64 Linux machines running hugo from Alpine Linux APK under Alpine 3.18, 3.19, and edge. Most testing has been done on my Mac.

Behavior POC

For instance, to run with --ignoreCache and trigger the bug:

while sh -c 'rm -rf resources public; hugo --ignoreCache; scripts/checkimg.sh'; do true; done

To run without --ignoreCache:

while sh -c 'rm -rf resources public; hugo; scripts/checkimg.sh'; do true; done

You can add a title to either of the content/test1.md or content/test2.md pages and run with --ignoreCache and the bug will not trigger.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published