Serving pdf files Hugo creates folders with "index.pdf"

Hi All,

I recently migrated from wordpress to Hugo, and I am very happy with the results. I have a very basic website with my papers in pdf format (I’m an academic). When generating the site, for every pdf file Hugo creates a folder with the name of the pdf and and a file “index.pdf” in it. What am I doing wrong?

Thanks!

Try to put

uglyurls = true

In your config. But in your case I would consider putting the pdfs into /static until this bug (see below) is fixed.

Not sure who decided what was pretty and not. As to why this is happening for PDF files I would say is an obvious bug.

Nice if you could put register a bug at https://github.com/spf13/hugo

1 Like

Can you provide an example path to one of the pdf files (before and after) in the bug report you file?

The uglyurls did it, thanks. I was already putting the pdfs into /static.

Should I still file a bug report, even if the uglyurls flag solved my problem?

Wait, actually that didn’t work at all. It replaced to pdfs with 2kb files.

Bug report: https://github.com/spf13/hugo/issues/1213