@ju52 this happens both on my development machine (in the post above) and the server, where it actually takes longer, around 150 000ms. I don’t see the machines’ resources being at risk for the moment.
I just ran a test, without images and the same thing happens. Could the problem be in the baseof.html ?
Maybe if I could set the header image for posts and instagram photos there, saving it as a variable it would cut down on render time.
How are you syndicating your photos from Instagram to your Hugo website?
On your local machine is there some kind of an automated trigger that generates the site whenever a new Instagram photo is published? If yes then that might be the culprit for the abnormal render time.
Anyway it is difficult to say what might be going on without seeing an example of the actual use case and not just the theme.
instagram photos are fetched by 4k Stogram. And then I use a modification of a script that I saw here on the forum to convert the photos to page bundles.
I think you were the one that shared the script I based on.
And the github link I shared contains an exampleSite with a reduced version of my content. The full source code contains content I can’t make public.
These last few hours I was looking into the way I manage page resources, because there are a few repeat calls to .Resouces.GetMatch. Since I use blocks, I tried to save them as a scratch variable to avoid repeating the same procedure. No luck. It just outputs an error when I try to save the object in scratch.
Ok. That was a bash script to generate the bundles before generating a Hugo Site. So it seems that you are not doing anything funky with automated triggers etc.
Then I suppose that you can try to clean up that /instagrams/single.html template.
At first glance the following seems like a double call: {{ $instagram := (.Page.Resources.GetMatch "header").Permalink | relURL }}
Why use that and not the following since you want a relative URL: {{ $instagram := (.Page.Resources.GetMatch "header").RelPermalink }}
Again these seem like double calls: {{ .PrevInSection.URL | relLangURL }} {{ .NextInSection.URL | relLangURL }}
(although I admit I am not familiar with Hugo’s multilingual features)
Try out these small changes and then check out those metrics again.
Also a final tip: stop using .URL and instead use .Permalink or .RelPermalink
@alexandros hmm okay something on my end then, thanks
@brunoamaral just ended up downloading a zip of your repo. But when I try to build your example site, I get an error because you don’t have a content/ folder. Maybe just add a dummy one for now, with a .gitkeep inside
Edit: so I added a dummy content/ folder, but when rebuilding your example site, I get this now
$ hugo server --source exampleSite --config exampleSite/config.toml --themesDir ../.. --theme Hugo-Now-UI-master
Building sites … ERROR 2018/11/27 16:10:15 render of "taxonomyTerm" failed: execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.
ERROR 2018/11/27 16:10:15 render of "home" failed: execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.
Total in 131 ms
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute of template failed: panic in Execute: runtime error: invalid memory address or nil pointer dereference. See "https://github.com/gohugoio/hugo/issues/5327" for the reason why we cannot provide a better error message for this.
@brunoamaral As @zwbetz said you need to have all those folders in your exampleSite under /content/ otherwise the test site will not generate.
Anyway I already did that but now I’m getting the following for every single image in your bundles:
ERROR 2018/11/28 00:07:32 failed to render pages: render of "page" failed: "/home/alex/Desktop/Hugo-Now-UI/layouts/_default/baseof.html:95:16": execute of template failed: template: _default/single.html:95:16: executing "_default/single.html" at <.Fill>: error calling Fill: fill /home/alex/Desktop/Hugo-Now-UI/exampleSite/content/page/elements/images/IMG_0160.JPG: image: unknown format
Something is wrong with the JPGs in your bundles. They’re not recognized on my end in Xubuntu 18.04