How do I have an HTML file as a page resource?

I just casually went ahead and saved my partial as a page resource for a post, say content/posts/foo/partial.html. However, I think Hugo started evaluating that HTML file, because of which my builds are now failing by stating:

~/G/ main !2 ?1 ❯ hugo server                                  ✘ 255
Start building sites … 
hugo v0.93.1+extended linux/amd64 BuildDate=unknown
Error: Error building site: "/home/subaru/GitHub/": unmarshal failed: invalid character '{' looking for beginning of object key string
Built in 18 ms

How do I tell Hugo to ignore that file?


ignoreFiles = ['posts/foo/partial.html']

Page resources that are content files (md, adoc, org, rst, html) are processed. As you have found, that can be a problem if you want to insert a file’s .Content into something. I’ve handled this in the past by using a global resource instead (put it in the assets directory).

I brought this up for discussion here:

The original issue title was “Global resource vs page resource discrepancies for markdown files”.


Thanks. I’ll ignore all HTML page resources globally.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.