platform/packages/mustache/README.md
Tobe O c94bec26ec Add 'packages/mustache/' from commit 'd0335a925d7199f3a5988ca10da36fee38ce0c43'
git-subtree-dir: packages/mustache
git-subtree-mainline: 9458a72c57
git-subtree-split: d0335a925d
2020-02-15 18:29:03 -05:00

35 lines
1.1 KiB
Markdown

# mustache
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/angel_dart/discussion)
[![version](https://img.shields.io/pub/v/angel_mustache.svg)](https://pub.dartlang.org/packages/angel_mustache)
[![build status](https://travis-ci.org/angel-dart/mustache.svg?branch=master)](https://travis-ci.org/angel-dart/mustache)
Mustache (Handlebars) view generator for the [Angel](https://github.com/angel-dart/angel)
web server framework.
Thanks so much @c4wrd for his help with bringing this project to life!
# Installation
In `pubspec.yaml`:
```yaml
dependencies:
angel_mustache: ^2.0.0
```
# Usage
```dart
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'});
}
```
# Options
- **partialsPath**: A path within the viewsDirectory to search for partials in.
Default is `./partials`.
- **fileExtension**: The file extension to search for. Default is `.mustache`.