Post asset folder

Hello.I just tried to migrate from hexo to hugo.

However,there is something wrong with the asset of each post.I went through , but I still feel confused.

Hexo: there is a config called post_asset_folder ,it allows each post has its own asset folder (folder name is same as post title).
for example:


then,I can add images to with a relative path:

![image a](./test_title/a.png)

then I can preview it locally with vscode.and all the images are in seperate folder.

Hugo: I find that all the images should be in the static folder. for example:


in the the link looks like:

![image a](/a.png)

I can only preview it using “hugo server” with the browser. and it is hard to keep all the images well organized,unless i create a similar folder tree in the static folder.

By the way there is another small program:

I use git to manage my notes. when using hexo I can new a site and clone my note into _posts dir and it is done.

when using the hugo.if i clone my notes into content folder,the images will not show as expected.

either I create a new repo containing the hugo dir(content,staic…etc) and fix the image links. or I create a new repo to manage all the images and fix the image links.

So,is there a way to work aroud with the post asset folder?
or is it possible to add such feature?


So,is there a way to work aroud with the post asset folder?
or is it possible to add such feature?

The behavior you described already exists

I think an understanding of hugo’s page bundles would be what you’re looking for.

1 Like

thank you very much. I think the doc is kinda misguiding .(or probably it is just my problam.) After some searching I figured it out.

I will write it down here .

when you new a post
hugo new
hugo will create “” with title: "test" in the content folder.


if you want to use page bundle (the leaf branch).

  1. create a folder named test
  2. rename to
  3. mv into test folder
  4. import the bundles using relative path: ![image a](a.jpg)

maybe this will be more specific.

thank you anyway.

1 Like

You’re most welcome @misaka