cmd: track



The syntax for the track command is:

nift track name (title) (template-path)
nsm track name (title) (template-path)


The track command is for tracking new files to be generated during a build with Nift, title and template-path are optional (default title is the specified name, and default template-path is the project-wide template path specified in the project configuration file .nsm/nift.config). Surround any names, titles and/or paths containing spaces with single or double quotes.

Note: you should not do any of the following with names, titles or paths:

  • use tabs;
  • use consecutive spaces;
  • use both single and double quotes;
  • single and double quote the entire string, eg. '"bad idea"'.
Also names cannot contain periods. If you need the output filename to contain periods other than in the extension then use a post-build script to move or copy the built file, or alternatively put everything from the first period onwards in the tracked output extension for the file.

With websites you can either put asset files like css and javascript files straight in the output/website directory and modify them from there, or you can track them similar to your pages and use n++ and f++ with them as well. For eg. scss and typescript files you can build them similar to css and javascript files but also add a post-build script to compile them to css or javscript files.

Note: When you track a file, the content file path is \$[contentdir]/\$[name]\$[contentext] and the output file path is \$[outputdir]/\$[name]\$[outputext]. For example, if you have content directory content/, content extension .content, output directory site/ and output extension .html and you track about, then the content file will be located at content/about.content and the output file will be built to site/about.html.

Note: track-dir and track-from-file are much faster for tracking large volumes of files than track.


Example of track being used:

nift track index
nift track about 'about page' 'template/page.template'
nsm track docs/installing
nsm track "John's page"