judas-christ / static2000-nunjucks

Nunjucks adapter for Static2000

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static2000-nunjucks

This package has moved into the Static2000 monorepo.

Nunjucks adapter for Static2000.

Installation

Via npm:

npm install static2000-nunjucks

Usage

Install, create templates and content as .html files and run static2000 with templateAdapter specified:

static2000 --templateAdapter static2000-nunjucks

or

var static2000 = require('static2000');

static2000({ templateAdapter: 'static2000-nunjucks' });

Globals

Global include

This adapter includes [templates folder]/includes/globals.html in all files, templates and content, so macros defined there are available both in the body of content and in templates:

{{ globals.myMacro() }}

Global functions

The global functions are available without namespace in the templates:

{% set visiblePages = query({ visible: true }) %}

About

Nunjucks adapter for Static2000

License:MIT License


Languages

Language:JavaScript 100.0%