ignoreFiles in config doesn't seem to work properly

Hello,

I have a folder in my static folder called /vids/ and in my config.toml I have ignoreFiles = “/vids/”. This /vids/ folder contain some very large video files, perhaps 2GB+ each.

The problem I have is very slow compilation for the first compilation (minutes). Subsequent compilations are equally slow if I’m also running hugo server in a separate terminal. In any event, even if it’s just the first compilation that is slow, it doesn’t make sense to me why hugo is processing this file in some way. Is there any way around this?

Thanks

So,

How ignoreFiles works is a longer story (short version: It ignores content files), but I would recommend that you rather have a look at

There’s a includeFiles/excludeFiles on each mount, which should give you a fine grained control of what to include for each of the logical mount points (e.g. static).

I’d like to hear that story on how IgnoreFiles works. I will have a go at the mounts thing but the format of IgnoreFiles looked more straight forward to me.

It ignores files in /content.

Maybe it should be renamed to IgnoreContentFiles :smiley:

Or removed.

1 Like

I did a little more digging (perhaps I should of done that first) and I came across this:

To exclude specific files from the content, data, and i18n directories

and it then goes on to say that:

To ignore a file using the absolute file path:

ignoreFiles : ^/home/user/project/content/test.md$

So, it appears I could of provided the absolute filesystem path to static.

I dunno if IgnoreFiles should be removed or extended to cover static folders.

It’s going to be deprecated and then eventually removed.

1 Like

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