0

I'm setting up pages on my personal website(hugo academics by wowchemy) and here is the structure of one of the folders I have:

.
├── ABF.md
├── EXE.md
├── Figures
│   ├── sampling.gif
│   └── sampling_compressed.gif
├── HREMD.md
├── MetaD.md
├── REUS.md
├── TREMD.md
├── US.md
├── _index.md
├── alchemical_MetaD.md
├── appendix.md
├── intro.md
└── test.gif

In _index.md, I have the following lines to read in a GIF file:

<center>
<img src="Figures/sampling_compressed.gif">
</center>

In intro.md, which is in the same folder as _index.md, I also have the same lines to read in the same GIF file. However, in localhost, the GIF file is shown in the page made by _index.md, but not the one built by intro.md. How can I solve the problem and why is this happening? Thanks in advance!

Jack
  • 81
  • 3
  • 11

1 Answers1

1

Your assumptions about the output structure are wrong. Hugo builds _index.md in the root of you folder, while the intro.md file (when processed with pretty URL's) is built in a subfolder: intro/index.html.

That being said... I tested your setup and an image in a Section directory (which is a directory with an _index.md file) is not processed by default. I would solve this by moving the image to the static directory so you can reference it from any file in the same way (with an absolute path), especially because this image does not belong to just one page.

If it WERE to be used by just one page, you could have turned the intro.md into intro/index.md and make that directory a Page bundle in which you could put your image and reference it by using the resources variable.

Mr. Hugo
  • 11,887
  • 3
  • 42
  • 60