v0.5.0
This release adds 3 new CLI commands:
make:layout <filename> --directory?
Scaffolds a new Layout based on the default Layout from the Starter, at an optional --directory
path. If the path provided in the --directory
option does not exist, it will be created.
Example:
# scaffold a Layout in src/layouts
maizzle make:layout my-layout.njk
# use a custom directory
maizzle make:layout my-layout.njk --directory=src/layouts/amp
# the above is the same as
maizzle make:layout my-layout.njk -d=src/layouts/amp
# paths can be relative to project root, i.e. one level above
maizzle make:layout my-layout.njk -d=../amp-layouts
make:template <filename> --directory?
Scaffolds a new Template at an optional --directory
path. --directory
option usage is identical to make:layout
above.
This is the content of the Template:
---
title: "Example title"
---
{% extends "src/layouts/default.njk" %}
{% block template %}
{% endblock %}
make:config <env> --full?
Scaffolds a new config.<env>.js
in the project root. <env>
is the environment name, i.e. staging
.
By default, a minimal config is output, which only defines the build.destination.path
:
module.exports = {
build: {
destination: {
path: 'build_staging',
},
},
}
For a full config, use the --full
option. The full config is based on the Starter's config.js, and has comments removed.
Example:
# outputs minimal `config.staging.js`
maizzle make:config staging
# outputs full `config,staging.js`
maizzle make:config staging --full
# shorter `--full` option
maizzle make:config staging -f
For all commands, if the target file already exists it will not be overwritten, and an error will be thrown.