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/foo.md, I would store my static files in static/posts/foo/. Or take content/blog/bar.md . I would store the static files at static/blog/bar/.

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

static/{{.Section}}/{{.File.TranslationBaseName}} 

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)

See

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 index.md 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 index.md.

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