c94bec26ec
git-subtree-dir: packages/mustache git-subtree-mainline:9458a72c57
git-subtree-split:d0335a925d
1.1 KiB
1.1 KiB
mustache
Mustache (Handlebars) view generator for the Angel web server framework.
Thanks so much @c4wrd for his help with bringing this project to life!
Installation
In pubspec.yaml
:
dependencies:
angel_mustache: ^2.0.0
Usage
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
.