Ignoring docx files

To my surprise, Hugo just rendered a bunch of docx files. I tried to add ignoreFiles = [ “\.docx$” ] to config.toml but it seems not to have any effect.

Am I doing something wrong? If not, Is there a workaround for this behaviour ?

@brunoamaral Where are these files? In static/?

They are located in the content directory.

That’s probably why Hugo is processing them. Files in your /static folder are copied over directly…

@rdwatters yes, I know that anything in /static is copied. These files are in the content/ directory and I tried to configure hugo not to process them with the setting mentioned.

In this setup, I can’t move or remove the docx files from their location, which is why I am trying to find a workaround.

1 Like

Hugo will only copy unknown files in /content, but ignoreFiles should work if you really want files in content that doesn’t belong there.

Use correct TOML string formatting.

ignoreFiles = [ "\\.docx$" ]

# or use literal strings
ignoreFiles = [ '\.docx$' ]

I am facing the same problem with hugo v0.89.4+extended darwin/amd64. Is there a solution available?

You are responding to a five years old topic.

Please open a new topic that describes the problem you’re having.

Also see: