Ignore Content Files in Hugo

How to ignore content files when rendering website with Hugo.
23 Jun 2025 23 Jun 2025 1 min read Hugo

To tell Hugo to ignore files in the content directory, use this configuration in your hugo.yaml file:


module:
  mounts:
    - source: 'content'
      target: 'content'
      # Exclude files from the 'content' directory
      excludeFiles:
        - '**/__README.md'
        - '**/*.drawio'

See also: Official Documentation on this feature

Note

Hugo also supports the ignoreFiles directive but using the module way seems to be preferred.