Back to Hugo

glob slice

docs/content/en/quick-reference/glossary/glob-slice.md

0.161.1655 B
Original Source

A glob slice is a slice of glob patterns. Within the slice, a glob can be negated by prefixing it with an exclamation mark (!) and one space. Matches in negated patterns short-circuit the evaluation of the rest of the slice, and are useful for early coarse grained exclusions.

The following example illustrates how to use glob slices to define a sites matrix in your project configuration:

toml
[sites.matrix]
languages = [ "! no", "**" ]
versions = [ "! v1.2.3", "v1.*.*", "v2.*.*" ]
roles = [ "{member, guest}" ]

The versions example above evaluates as: (not v1.2.3) AND (v1.*.* OR v2.*.*).