🧝in 1.9.2-alpha

Scaffold

Scaffold is used to generate extensions to Elfin, like filters, collections, etc.

scaffold can also be called in its short form–scf.

Options

Individual scaffolds can also define their own options, but the ones above are available to every scaffold.

Scaffolds

filter

Creates an 11ty filter (specifically a Universal Filter).

$ elf scaffold filter new_filter
$ elf scf filter new_filter
$ elf scf filter new_filter --stub ~/filter.stub --custom-argument 'custom value' -o

shortcode

Create an 11ty shortcode (specifically a Universal Shortcode).

$ elf scaffold shortcode new_shortcode
$ elf scf shortcode new_shortcode
$ elf scf shortcode new_shortcode --stub ~/shortcode.stub --custom-argument 'custom value' -

collection

Creates an 11ty collection. You can optionally pass an argument to --glob to define the glob used to collect files, i.e. elf scaffold collection ships --glob 'ships/**/*.md'. If you don’t, the collection generated will get all files.

Options

$ elf scaffold collection new_collection
$ elf scf collection new_collection
$ elf scf collection new_collection --stub ~/collection.stub --custom-argument 'custom value' -o --glob 'new/**/*.md'

generator

Creates a generator for Elf, but defined in your project’s elf.config.js.

Part of the generator stub is used itself to generate stubs; this means that we need to set custom delimiters so that it can contain {{ }} without them being evaluated.

See generator.stub for an example.

Options

$ elf scaffold generate new_generator
$ elf scf generate new_generator
$ elf scf generate new_generator --stub ~/generator.stub --custom-argument 'custom value' -o --desc "A new collection" --singular "single"