Markdown syntax image PATH readable by both editor & Hugo

Hi there. I’m working on my first Hugo site.

I have an image in /{site URL}/static/images/ and I can get it to work in my local preview (hugo server -D) if I use that URL in my Markdown.

Here’s the thing, though. I am using an editor that gives a preview, and it would be super nice to use that editor’s features. What I want to do is:

  1. Drag and drop the image into the editor (which works)
  2. Look at the image in the editor (which works)
  3. Save, and have Hugo parse the path in the Markdown, which the editor understands (doesn’t work)
  4. Maybe even have Hugo figure out what happens to the images in the static directory, since I don’t care.

I mean… the whole point of a site generator is that I don’t need to worry about where images are stored. Right?

Unfortunately, if I want to add images to a page using my editor of choice, I have to use a path that Hugo understands but makes no sense to the editor. So I can’t edit a document and see the images at the same time.

Why can’t I provide a full path to the image on disk (so my editor can see it) and have Hugo go get it from there (for local preview) and copy it into the static directory (for deployment)?

You may want to track https://github.com/gohugoio/hugo/issues/6545

1 Like