Folder structure

Site source is well structured.

Spignite expects certain directory structure. The structure is part of the defaults and can be easily modified. The defaults exist only to speed up the initial project setup.

project/
├── out/
├── src/
│ ├── config/
│ ├── css/
│ ├── data/
│ ├── images/
│ ├── js/
│ ├── layouts/
│ ├── site/
│ └── static/
├── package.json
└── spig.js

To enable defaults - and therefore, the above structure, your spig.js must call Spig.hello() right before any user definition.

out

The resulting website will be created here. Note that Spignite does not delete this folder; during the development some files can be accumulated while you are working on the website. Make sure you clean this folder before final run and deployment.

src

The root folder where the whole website is defined. Contains only few global configuration files.

src/config

Additional configuration of used 3rd party tools. For example, you can define here additional nunjucks filters, or tweak parameters for minimization etc.

src/css

Process all *.sass files with SASS compiler. Process all *.css files with PreCss.

src/data

Put any number of data *.json files here - Spginite will read it on rutime. This way any data can become part of the site context, available from everywhere.

src/images

Put all the images that you might want to process: either resize to fit certain width or height, or just optimized.

src/js

Home of all javascripts. It has a concept of bundles - when a folder is named as *.js - all it's javascripts will be merged into one ouput files named as a folder.

src/layouts

The root for all used layouts.

src/site

The content, usually written in markdown. Spignite supports any renderer, so you can write content in nunjucks, too - helpful on complex pages. This folder may contain additional resources, like images.

src/static

Files that will be blindly copied to the output.

spig.js

The main Spignite definition. While defaults are not mandatory, it is advisable to have them enabled.

const { Spig } = require('spignite');
​
Spig.hello();
​
// user operations
​
Spig.run();