Rendering differences between serve and deploy (using Store)

I use the Store function to retrieve content between pages, and it’s pretty cool.
But there is a difference between serve and deploy rendering: when I serve Hugo I have all the content, including data retrieved with the Store function, but when I deploy it some content are not generate.

My test repository are here, and the difference are visible on the section pages:

  • home: I have all my definitions retrieved from the section (the definitions are tagged in the sections with the shortcode definition.html)
  • sections: when I serve the sections pages the definitions are displayed (the definitions are called with the shortcode call.html), but not when I deploy it.

Any idea why the two modes (serve and deploy) have different renderings? Is it an effect from the Store function?

(My Hugo version: v0.111.3)

Hugo renders pages in parallel. You are trying to access Store values before the content containing the “definition” shortcode has been rendered.

1 Like

Oh thanks it’s make totally sense (and it’s exactly what you explained to me in a previous post)! So I have to force to render the content where the shortcode “definition” are, before the content where the shortcode “call” are, with something like {{ $bidule := .WordCount }} (or other methods, is that right?

We are agree on the fact that I can’t define a render order? Is Hugo really renders all pages in parallel (I’m just curious about that point)?

You can’t do what you want to do.

PAGE A

definition-set “book” “something with pages”

definition-get “album”

PAGE B

definition-set “album” “something with songs”

definition-get “book”

:chicken: :egg: :chicken: :egg: :chicken: :egg: :chicken: :egg: :chicken: :egg:

Rendering of Page A requires rendering of Page B which requires rendering of Page A…

1 Like

Thanks to remind me a simple logical principle :hatching_chick:
(So I will create a data set)

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.