Help with link images to see from absolute path including "/static"?

I’m using HUGO to build my blog and I want to read it in local with but I have a problem with the view of images.
I can’t link images properly in Obsidian and the result is that the image does not exist, because the “/static” folder is not refereed when linking an image.

I would like to see the articles of my blog with Obsidian and not rendering every time to see in localhost with hugo server .

├── assets/
├── content/
	├── descriptions/
	├── post/
├── public/
├── resources/
├── static/
	├── img/
	     ├── test.jpg
	     ├── sample-video.mp4
└── themes/

The article has a link to test.jpgbut I can’t see the content in Obsidian with this link format ![test|100x200](/img/test/test.jpg#center)


Put the links in HUGO as:

  1. Absolute path from vault: ![Test|100x200](/static/img/test/test.jpg#center) or ![Test|100x200](static/img/test/test.jpg#center)
  2. Relative path: ![Test|100x200](../../static/img/test/Test.jpg#center) or Test
  3. File name: ![Test|100x200](Test.jpg#center)

How can I do that? Thanks.

Create an images directory in the root of your project:

├── a.jpg
├── b.jpg
└── c.jpg

Then mount it to static/images in your site configuration.

source = 'static'
target = 'static'

source = 'images'
target = 'static/images'

Then reference the image in your markdown using an absolute (leading slash) path:

![alt text](/images/a.jpg)

Thank you very much, I was struggling with this for a long time.
Just what you said, I move my folder img/ to the root project and add to the config.yml:

    - source: static
      target: static
    - source: img
      target: static/img

Now I can use and HUGO framework very nicely.

1 Like

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