staticDir on a per - page basis

I like to arrange my static files according to post. That means that if I have a post content/posts/, I would store my static files in static/posts/foo/. Or take content/blog/ . I would store the static files at static/blog/bar/.

In general, the directory which I use per post would be the following:


Is there a variable that I can assign Per page which will set the staticDir accordingly ? If not, is there any other way to achieve this ? (In as Hugo figures out the Static Dir automatically based on some configuration)


That is the recommended way of organizing assets per page.

Thank you for your suggestion. I read the page bundles file. Leaf bundles seem best sorted for my use case. But one thing I couldn’t figure out from the documentation:

How would one use the file that is present in leaf bundles ? Is it the “master” file which gets published ?

Yes. The folder name by default becomes the Permalink of the Page Bundle unless otherwise specified in the front matter of the

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