Updated Jinja

This commit is contained in:
thomashii@dukefirehawk.com 2023-05-27 15:07:30 +08:00
parent 82b78fdaef
commit f2c9ab23eb
2 changed files with 4 additions and 2 deletions

View file

@ -3,6 +3,7 @@
## 8.0.0
* Require Dart >= 3.0
* Update `jinja` to 0.4.2
## 7.0.0

View file

@ -1,5 +1,6 @@
import 'package:angel3_framework/angel3_framework.dart';
import 'package:jinja/jinja.dart';
import 'package:jinja/loaders.dart';
/// Configures an Angel server to use Jinja2 to render templates.
///
@ -28,7 +29,7 @@ AngelConfigurer jinja({
createLoader ??= () {
return FileSystemLoader(
extensions: ext,
path: path,
paths: [path],
followLinks: followLinks,
);
};
@ -47,7 +48,7 @@ AngelConfigurer jinja({
);
app.viewGenerator = (path, [values]) {
return env.getTemplate(path).render.renderMap(values) as String;
return env.getTemplate(path).render(values);
};
};
}