Skip to content

Matrix Mode

Whiskers has the ability to generate many files from a single template, using the matrix frontmatter key.

By default, the flavor and accent iterables are included.

If you want to generate a file for each flavor (4 flavors = 4 files), it’s as simple as defining the frontmatter below:

example.tera
---
whiskers:
version: "^X.Y.Z"
matrix:
- flavor
filename: "themes/catppuccin-{{flavor.identifier}}.json"
---
# ...

If you want to generate a file for each flavor and accent (4 flavors x 14 accents = 56 files), it’s as simple as defining the frontmatter below:

example.tera
---
whiskers:
version: "^X.Y.Z"
matrix:
- flavor
- accent
filename: "themes/{{flavor.identifier}}/catppuccin-{{flavor.identifier}}/{{accent}}.json"
---
# ...

The matrix frontmatter key can take any arbitrary amount of iterables, meaning that you can generate as many combinations as you’d like.

For example, a “normal” and “no-italics” variant for each flavor and accent (4 flavors x 14 accents x 2 variants = 112 files):

example.tera
---
whiskers:
version: "^X.Y.Z"
matrix:
- variant: ["normal", "no-italics"]
- flavor
- accent
filename: "themes/{{flavor.identifier}}/catppuccin-{{flavor.identifier}}-{{accent}}-{{variant}}.ini"
---
# Catppuccin {{flavor.name}}{% if variant == "no-italics" %} (no italics){% endif %}
[theme]
{{accent}}: {{flavor.colors[accent].hex}}