Exclude a folder inside static

Am trying to exclude a folder inside static folder from the build. I have added the following to config.yaml but it doesn’t seem to work.

ignoreFiles: 
  - "/static/admin/.*"

Any tips?

https://gohugo.io/getting-started/configuration/#ignore-content-files-when-rendering

ignoreFiles

will cause Hugo to ignore content files

So this:

ignoreFiles: 
  - "/static/admin/.*"

Will not build these:

content
└── static
    └── admin
        ├── bar.md
        └── foo.md

Related:

You cannot currently exclude anything from the static directory.

3 Likes

Thank you @jmooring

ignoreFiles also works for files and folders under the dataDir.

1 Like

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