2017-04-05 18:37:26 +00:00
|
|
|
# mustache
|
2017-04-05 22:46:38 +00:00
|
|
|
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/angel_dart/discussion)
|
2017-11-18 18:39:10 +00:00
|
|
|
[![version](https://img.shields.io/pub/v/angel_mustache.svg)](https://pub.dartlang.org/packages/angel_mustache)
|
2017-04-05 22:43:15 +00:00
|
|
|
[![build status](https://travis-ci.org/angel-dart/mustache.svg?branch=master)](https://travis-ci.org/angel-dart/mustache)
|
|
|
|
|
2017-04-05 18:38:35 +00:00
|
|
|
Mustache (Handlebars) view generator for the [Angel](https://github.com/angel-dart/angel)
|
|
|
|
web server framework.
|
2016-04-22 02:22:33 +00:00
|
|
|
|
2017-04-05 22:43:38 +00:00
|
|
|
Thanks so much @c4wrd for his help with bringing this project to life!
|
2017-04-05 22:43:15 +00:00
|
|
|
|
2016-04-22 02:22:33 +00:00
|
|
|
# Installation
|
|
|
|
In `pubspec.yaml`:
|
|
|
|
|
2017-04-05 18:37:26 +00:00
|
|
|
```yaml
|
|
|
|
dependencies:
|
2018-11-08 15:56:00 +00:00
|
|
|
angel_mustache: ^2.0.0
|
2017-04-05 18:37:26 +00:00
|
|
|
```
|
|
|
|
|
2016-04-22 02:22:33 +00:00
|
|
|
# Usage
|
2017-04-05 18:38:35 +00:00
|
|
|
```dart
|
2017-11-18 18:39:10 +00:00
|
|
|
const FileSystem fs = const LocalFileSystem();
|
|
|
|
|
|
|
|
configureServer(Angel app) async {
|
|
|
|
// Run the plug-in
|
|
|
|
await app.configure(mustache(fs.directory('views')));
|
|
|
|
|
|
|
|
// Render `hello.mustache`
|
|
|
|
await res.render('hello', {'name': 'world'});
|
|
|
|
}
|
2016-05-02 23:28:37 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
# Options
|
|
|
|
- **partialsPath**: A path within the viewsDirectory to search for partials in.
|
2017-04-05 18:37:47 +00:00
|
|
|
Default is `./partials`.
|
2017-04-05 18:37:26 +00:00
|
|
|
- **fileExtension**: The file extension to search for. Default is `.mustache`.
|