Relative image path to content / github preview support

How do I have images in same directory or sub directory of a article? For example if my content is in content/dir1/page1.md, images can be in content/dir1 or a sub directory. That way github can view the content properly. It’s also much easier for users to update the content. Finding and storing images in static forder may be best technical solution, but it’s inconvenient for non technical users, which limits it’s usage. Ditto for github preview support, which works if images are in same or sub directory of content.

There seems to be some discussion I found on the forum, but it wasn’t clear to me if it’s supported and how. I tried putting images in same folder and didn’t work for me by default.

1 Like

Agree.
It would be brilliant if the paths in Hugo & Github could be aligned, it would make laying out pages so much easier.

For example; if the page displays OK in Github, it will display OK in Hugo.

Paul

The Docker kids added that feature (Docker uses Hugo for their docs), but they were not “great” in documenting that feature …

Do not ask me how it works or how you set it up. I might know. But don’t ask :slight_smile:

Thanks, setting it to “true” and putting images in same folder as .md file works for github, but does not work for hugo. Hugo converts filename.md to ‘filename/index.html’. So the image still stays one level up from index.html for hugo.

Any help how to configure it so it works for both hugo and github preview will be appreciated.

1 Like