Excluding Files

How to exclude (or include) additional paths in Qgoda.

By default, Qgoda does not process hidden files and directories (name starts with a dot .). Top-level files and directories that have names beginning with an underscore _ are also excluded.

Excluding Additional Files

You can change this default behavior by configuring additional file name patterns in the variable exclude in the configuration file _qgoda.yml.

Example:

exclude:
- /node_modules
- /package.json
- /webpack.config.js
- assets/images/**/*.xcf

This will also exclude the top-level directory node_modules, and the top-level files package.json and webpack.config.js. Likewise, all XCF files (the image format of The Gimp in the directory assets/images and all of its descendant directories are excluded.

Please see Pattern Lists for the gory details of search patterns and lists of search patterns in Qgoda.

Automatically Excluded Files

Internally, Qgoda does not use the configured exclusion list directly but a slightly extended one. For the above example it looks like this:

exclude:
- .*
- /_*
- /node_modules
- /package.json
- /webpack.config.js
- assets/images/**/*.xcf
- /_site

The first two lines exclude files and directories that have names beginning with a dot (.) or top-level files and directories that have names beginning with an underscore.

The last line is always appended and a safe-guard against configuration errors. Unintentionally including the output directory _site would lead to an infinite recursion. The output directory is therefore always added to the exclusion list.

Including Files

There is no configuration variable include. You can exclude otherwise excluded files by prepending a pattern with an exclamation mark !. The pattern is then negated:

exclude:
- /node_modules
- /package.json
- /webpack.config.js
- assets/images/**/*.xcf
- "!/_posts"

This would now enable processing of all the files in the top-level directory _posts.

Beware though that you cannot re-include files or directories, when one of their parent directories is already excluded.

Example:

exclude:
- /archive
- "!/archive/2017"

The second pattern is invalid and ignored because /archive is a parent directory of /archive/2017.

This behavior has performance reasons. When Qgoda collects files, it does not descend into excluded directories. In the above example, it would not read the contents of archive and would therefore never see the subdirectory archive/2017.

That leads to a little problem if you want to re-include a subdirectory of an automatically excluded directory, for example _experiments/stable. The top-level directory _experiments is automatically excluded by Qgoda. In order to re-include it, you would have to do the following:

exclude:
- "!/_experiments"
- /_experiments/*
- "!/_experiments/stable"

You have to keep in mind that Qgoda has prepended this list with /_* (see above). Line 1 re-includes _experiments. Line 2 excludes all its subdirectories again. And line 3 selectively re-includes _experiments/stable.

Excluding Files From Being Watched

There is another configuration variable exclude-watch that specifies files and directories that should not be watched. If you omit that variable, the contents of exclude is taken instead.

Note that Qgoda by default re-includes the directory _views.

Example:

exclude-watch:
- assets/movies

The list that is really used by Qgoda looks like this:

exclude-watch:
- .*
- /_*
- "!/_views"
- assets/movies
- /_site

You can see that the directory _views has been re-included because it contains layout and design files.

This website uses cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy.