CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
5.07k stars 1.67k forks source link

Embedding large gifs doesn't get past the Build action #1014

Closed Libberator closed 7 months ago

Libberator commented 7 months ago

What happened?

I have some large .gif files I'd like to embed in my blog. And I'm using the following markdown syntax:

![Image Description](localImageFile.gif)

Yes, the file exists and is in the correct folder; no silly mistakes on my part. It works for .png files no problem. But while the build action is running hugo --minify --gc, it will encounter errors (see the logs).

UPDATE: Okay, I've tested it on a GIF that is 1.33MB and 17MB by theirself and they work. But when I test my larger gifs (24MB), it breaks. Will it support larger gif embeddings or is there another way to accomplish that? ...I guess I should make them smaller or just post a link to them in the meantime.

Hugo version

0.125.4

Theme version

3.25

What browsers are you seeing the problem on?

No response

More information about the browser

No response

Relevant log output

Run hugo --minify --gc
Start building sites … 
hugo v0.125.4-cc3574ef4f41fccbe88d9443ed066eb10867ada2+extended linux/amd64 BuildDate=2024-04-25T13:27:26Z VendorInfo=gohugoio

ERROR render of "page" failed: "/home/runner/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.25.0/layouts/_default/single.html:27:7": execute of template failed: template: _default/single.html:27:7: executing "main" at <partial "article/article.html" .>: error calling partial: "/home/runner/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.25.0/layouts/partials/article/article.html:2:7": execute of template failed: template: partials/article/article.html:2:7: executing "partials/article/article.html" at <partial "article/components/header" .>: error calling partial: "/home/runner/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.25.0/layouts/partials/article/components/header.html:34:7": execute of template failed: template: partials/article/components/header.html:34:7: executing "partials/article/components/header.html" at <partialCached "article/components/details" . .RelPermalink>: error calling partialCached: partial "article/components/details" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.

Total in 30537 ms

Error: error building site: render: failed to render pages: render of "home" failed: "/home/runner/.cache/hugo_cache/modules/filecache/modules/pkg/mod/github.com/!cai!jimmy/hugo-theme-stack/v3@v3.25.0/layouts/index.html:9:15": execute of template failed: template: index.html:9:15: executing "main" at <partial "article-list/default" .>: error calling partial: partial "article-list/default" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.

Error: Process completed with exit code 1.

Link to Minimal Reproducible Example

.

Libberator commented 7 months ago

okay, I solved it after testing some more things. Interestingly, I didn't run into this issue with my previous jekyll template. As a workaround hack, I just modified the config.toml with

timeout = 180

so that it had enough time to process the larger files. But that's not a good long-term solution and I'll need to decrease my file sizes by a lot. Thanks for being a rubber ducky, bug ticket.

EDIT: For anyone running into the same issue, convert your gifs to .webm format (it reduced a 15MB down to 450KB, keeping quality) and add this hugo-video shortcode to your submodules so that you can embed webm videos.