angel_compiled_mustache
This is an Angel wrapper for the lightweight compiled_mustache render engine.
Installation
In pubspec.yaml
:
- dependencies:
- angel_compiled_mustache: ^1.1.0
Usage
- configureServer(Angel app) async {
- // Run the plug-in
- await app.configure(compiled_mustache(new Directory('views')));
- // Render `hello.mustache`
- await res.render('hello', {'name': 'world'});
- }
Options
- fileExtension: The file extension to search for.Default is
.mustache
. - defaultLayout: The default layout file to use if none is specified during the render process.Default is
main
- layoutsPath: The path within the viewsDirectory to search for layouts in.Default is
./layouts
- pagesPath: The path within the viewsDirectory to search for pages in.Default is
./pages
- partialsPath: A path within the viewsDirectory to search for partials in.Default is
./partials
. - fileSystem: The FileSystem to use to find the above paths.Default is
const LocalFileSystem()