Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorishermans/enchanter
A static site generator with some similarity to the express library
https://github.com/jorishermans/enchanter
expressjs javascript javascript-library static-site-generator
Last synced: 11 days ago
JSON representation
A static site generator with some similarity to the express library
- Host: GitHub
- URL: https://github.com/jorishermans/enchanter
- Owner: jorishermans
- License: mit
- Created: 2017-01-22T19:25:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-01T21:01:33.000Z (over 7 years ago)
- Last Synced: 2024-10-11T06:42:53.303Z (about 1 month ago)
- Topics: expressjs, javascript, javascript-library, static-site-generator
- Language: JavaScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Enchanter
Enchanter is a minimalistic site generator, build up your site on an easy way.
Following a part of the api of express.js.```js
var enchanter = require('enchanter');
var app = enchanter();app.page('/', function(request, response) {
// do some mongodb queries :)
response.render('template', {title: "home", message: "body"});
});app.generateAll();
```You can also generate a specific path with the following code:
```js
app.generate('/');app.generate('/about');
```## Installation
```bash
$ npm install enchanter
```## Use express
Generate a site with express as parameter.
```js
var enchanter = require('enchanter');
var express = require(express);var app = enchanter(express);
```
When you start your application with
```
node index -d
```
It will start the application with express.
This should be easy while your are developing your application or you want a dynamic and a static generation part.## Events
after - happens at the end of a generate phase.
```js
app.on('after', (page) => {
console.log('end generating ...');
});
```## Issues
Please fill an issue when a part of the express api is not covered for you use case!