Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/judas-christ/static2000-nunjucks

Nunjucks adapter for Static2000
https://github.com/judas-christ/static2000-nunjucks

Last synced: 9 days ago
JSON representation

Nunjucks adapter for Static2000

Awesome Lists containing this project

README

        

# static2000-nunjucks

> This package has moved into the [Static2000 monorepo](https://github.com/judas-christ/static2000).

Nunjucks adapter for [Static2000](https://github.com/judas-christ/static2000).

## Installation

Via npm:

```bash
npm install static2000-nunjucks
```

## Usage

Install, create templates and content as `.html` files and run [static2000](https://github.com/judas-christ/static2000) with `templateAdapter` specified:

```bash
static2000 --templateAdapter static2000-nunjucks
```

or

```js
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:

```html+django
{{ globals.myMacro() }}
```

### Global functions

The global functions are available without namespace in the templates:

```html+django
{% set visiblePages = query({ visible: true }) %}
```