HUGO

How to ignore specific files?

I use “draw io” to create diagrams and use the “draw io” CLI to render PNG files. When I want to publish my site the “draw io” files should be ignored. I tried the setting ignoreFiles = ["\\.drawio$"]. But that does not have any effect. The “draw io” files are copied to the output folder.

My directory structure looks like this:

├── content
│   └── posts
│       └── 2021
│           └── 11
│               └── post-1
│                   ├── img
│                   │   ├── diagram-1.drawio
│                   │   ├── diagram-1.png
│                   │   ├── diagram-2.drawio
│                   │   └── diagram-2.png
│                   └── index.md

hugo config output

ignorefiles = [\.drawio$]

hugo version output (installed via homebrew):

hugo v0.89.4+extended darwin/amd64 BuildDate=unknown

I suggest you have a look at excludeFiles/includeFiles here:

1 Like

ignoreFiles = [ "\\.drawio$"]

HTH

1 Like

Thanks @bep, adding the following to my configuration toml was the solution:

[module]
[[module.mounts]]
  source = 'content'
  target = 'content'
  excludeFiles = ['posts/**/*.drawio']
2 Likes

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