Ignore Content Files in Hugo

How to ignore content files when rendering website with Hugo.
10 Jan 2024 10 Jan 2024 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.