Eric Burel @ericburel.tech · Feb 16

I am trying to load the sitemap top-level, so I can use it in "getStaticPaths" and also render it to generate the nav bar, but it doesn't seem to work as expected I'll cut that in two steps, first generating the paths, then displaying the sitemap in the page

0 likes 1 replies

?

Replies

Eric Burel · Feb 16

Well actually I think the issue is that the context around "getStaticPaths" is not really a closure, if I want a value, I need to get it again in this function, separately Next.js works the same way actually This means some code is repeated twice, I need to abstract it by defining a function