Since media in /static is not supported by it, i’ve created a folder called /uploads under /content. In the root of /content/uploads, I’ve added an index.md and made it a headless bundle with:
---
headless: true
---
I’ve then added multiple images under /content/uploads. However, I’m not able to access the images. In development mode, if I try to access localhost/uploads/image1.jpeg, it returns a 404.
What could be the issue? Not really sure what I’m missing.
I’ve accessed the headless bundle, looked for filenames with .jpg and got the RelPermalink for each of them (or I thought I did lol). Didn’t manage to get anything to appear in the HTML though.
I’ve tried different glob patterns, to no avail. I’ve also printed out the value of imagesPage and it isn’t returning anything, so I believe the problem resides there?
Not sure if it helps, but:
Hugo Static Site Generator v0.57.2/extended linux/amd64 BuildDate: unknown
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.12.8"
I started fresh from the quickstart example and simply added the /uploads folder to /content, as well as the same images and index.md. Then in index.html layout I simply pasted the code that I’ve written above and they rendered as expected.
Then, back to the original project: I’ve found out that if I remove my “translation by content directory” configs the images are rendered properly. My /content folder structure is:
There’s your explanation. /uploads is not under any language contentDir.
You could add an /uploads/ bundle under each language, and only have the resources in one of them. The other languages should then inherit the resources: Multilingual mode | Hugo
Or try put them under /assets/uploads/ and resources.Get instead: Hugo Pipes | Hugo