Skip to content

Static Files

loripam edited this page Feb 5, 2021 · 3 revisions

file

Static custom files can be included in a template, and can be declared in an ns file using the static key.

Static File Types

A template can declare any number of static file types. Their handlebars files are stored in the static directory, and they also should be listed in the config doc. For instance:

static:
  modal:
    suffix: 'Modal.js'

This declaration from the sample template declares a modal static file type.

It produces files in the static/modal directory.

Declaring Static Files in the ns file

Here is a sample declaration:

static:
  modal:
    application:
      slug: Application
    appTitle:
      slug: AppTitle
    getStarted:
      slug: GetStarted

The static object contains a key for each static type that a code base is using. In this case, 3 instances of the static modal file type are declared, and each is given a slug. The generated files can have section names and custom code locations, as with dynamic and standard files.