Nonja

Reference


Nonja uses Jinja for handling markup and dart-sass for Sass resources. Please refer to these sites for details on those projects.


Start

Creates the folders and files for a basic Nonja project.

nj start

Nonja creates a src folder to contain the source files for your project. Included in the src folder is a README.md which explains the purpose of each subfolder.


Serve

Starts a basic, insecure HTTP web development server.

nj serve

[TODO]


Build

Builds the current project, outputting the result to the build folder.

nj build

Nonja builds the project by combining the Jinja templates, invokes the package manager to build Sass resources, and generates additional site assets.

This command may also be called with the short form, b.


Generate

Tells Nonja to generate content for the project.

Pages

Tells Nonja to generate a page for the project using the specified template.

nj generate page [name] [template]

If the template parameter is omitted, Nonja assumes the page will use the default named template, _shared.html. If the template file named in the template parameter does not exist, Nonja will generate the file automatically.


Templates

Tells Nonja to generate a template.

nj generate template [name]

The name parameter does not need to include the file extension, the .html extension will be added automatically.

The resulting template file will be prefixed with an underscore, _; this is the convention Nonja uses to identify templates used to wrap other templates.


Styles

Tells Nonja to generate a Sass file.

nj generate style [name]

The name parameter does not need to include the file extension, the .scss extension will be added automatically.

The resulting file will be placed in the src/styles folder; this folder is processed by NPM or Yarn with dart-sass.


Drawings

Tells Nonja to generate a new SVG drawing.

nj generate drawing [name] [width] [height]

The name parameter does not need to include the file extension, the .svg extension will be added automatically.

If the width parameter is omitted, a default value of 400 is used. If the height parameter is omitted, a default value of 400 is used.

The resulting file will be placed in the src/drawings folder.


Data

Tells Nonja to generate a JSON data file.

nj generate data [name]

The name parameter does not need to include the file extension, the .json extension will be added automatically.

This file will contain either a JSON array or object which will then be available to a template via the data() function when used with set to define a template variable.


Git ignore

Tells Nonja to generate a .gitignore file for the project.

nj generate gitignore

The .gitignore file will be placed in the root of the project.


Docker Compose

Tells Nonja to generate a Docker Compose file for the project.

nj generate docker-compose

The docker-compose.yml file will be generated in the root of the project. This Docker Compose file will contain a single service entry for running Apache 2.4 (Alpine) using the build folder as the htdocs root.