2022-01-04 12:03:52 +00:00
|
|
|
# Mustache View Template for Angel3
|
2017-04-05 22:43:15 +00:00
|
|
|
|
2022-01-04 12:03:52 +00:00
|
|
|
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_mustache?include_prereleases)
|
2021-06-26 10:24:52 +00:00
|
|
|
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
|
|
|
|
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
|
2022-01-04 12:03:52 +00:00
|
|
|
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/mustache/LICENSE)
|
2021-06-26 10:24:52 +00:00
|
|
|
|
2022-01-04 12:03:52 +00:00
|
|
|
A service that renders Mustache template into HTML view for [Angel3](https://angel3-framework.web.app/) 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
|
|
|
|
2021-06-26 10:24:52 +00:00
|
|
|
## Installation
|
|
|
|
|
2016-04-22 02:22:33 +00:00
|
|
|
In `pubspec.yaml`:
|
|
|
|
|
2017-04-05 18:37:26 +00:00
|
|
|
```yaml
|
|
|
|
dependencies:
|
2022-01-04 12:03:52 +00:00
|
|
|
angel3_mustache: ^3.1.0
|
2017-04-05 18:37:26 +00:00
|
|
|
```
|
|
|
|
|
2021-06-26 10:24:52 +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
|
|
|
```
|
|
|
|
|
2021-06-26 10:24:52 +00:00
|
|
|
@# Options
|
|
|
|
|
2016-05-02 23:28:37 +00:00
|
|
|
- **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`.
|