Templates

Structure

For the purposes of the AppArchetype gem, a template is a manifest and folder pair.

For command line usage they should be kept in location set by the ARCHETYPE_TEMPLATE_DIR environment variable.

A template could look like this:

 - 📁 $ARCHETYPE_TEMPLATE_DIR
 | - 📁 my_template
 | - | - 📁 template/
 | - | - | - 📄 file.erb
 | - | - | - 📄 file2.txt
 | - | - 📄 manifest.json

The Manifest file is a JSON or Jsonnet document that specifies the variables to be used when the template is rendered. It should be named manifest.json or manifest.jsonnet

The Folder is simply a directory in your file system that is the contains the template files. It can be any shape you like so long as it’s contained in the template directory.

Creating a New Template

You can create a new template in the ARCHETYPE_TEMPLATE_DIR by running:

archetype new

Dotfiles

AppArchetype will not automatically render any file or folder that begins with a . unless they have a {{dot}} prefix. This ensures that any system generated dot file does not pollute any rendered template unless we want it to.

To make a dotfile render simply add {{dot}} to the beginning of the file or folder:

{{dot}}.gitignore