Where is the intended directory structure for the Resources metadata example?

Hi All,

I’m reading the Page Resources documentation and confused about what kind of directory structure is required to learn from the resources metadata example configuration.

For example:

Let’s say I’ve run these commands and now have this directory structure:

rm -rf *
mkdir -p content layouts/_default
touch config.yml
echo '{{ .Content }}' > layouts/_default/single.html
echo '* hello foo' > content/foo.md
hugo server &
├── config.yml
├── content
│   └── foo.md
├── layouts
│   └── _default
│       └── single.html
└── resources

4 directories, 3 files

And I have some file that contains some resources metadata:

date: "2018-01-25"
- name: header
  src: images/sunset.jpg

And some jpg file:

file sunset.jpg
sunset.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 144x144, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=5, orientation=upper-left, xresolution=74, yresolution=82, resolutionunit=2], baseline, precision 8, 628x216, frames 3

And I want to run curl localhost:1313/foo/ and see something related the sunset.jpg printed to screen.


  • What should the file that contains the resources metadata be named?
  • Where should the file that contains the resouces metadata be moved?
  • Where should the sunset.jpg file be moved?
  • What needs to go in the content/foo.md file?

The simplest way would be to use Page Bundles for your Resources.