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.
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.
The root folder where the whole website is defined. Contains only few global configuration files.
Additional configuration of used 3rd party tools. For example, you can define here additional nunjucks filters, or tweak parameters for minimization etc.
Process all *.sass
files with SASS compiler. Process all *.css
files with PreCss.
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.
Put all the images that you might want to process: either resize to fit certain width or height, or just optimized.
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.
The root for all used layouts.
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.
Files that will be blindly copied to the output.
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();