Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/judas-christ/static2000-nunjucks
- Owner: judas-christ
- License: mit
- Created: 2015-02-26T10:24:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T20:55:14.000Z (about 4 years ago)
- Last Synced: 2024-04-14T12:53:36.842Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 }) %}
```