Blake uses jinja templates for HTML generation. There is currently only single jinja package for Dart and it does not support every functionality. However, variables, expressions, control structures, and template inheritance works.
Template must have a .html
extension. All templates must be within templates
directory (you can customize this location in config.yaml
).
├── templates
│ ├── shortcodes
│ └── page.html
Templates directory contains shortcodes
subdirectory. This directory
must be used to place your shortcodes. Therefore, by default all shortcodes
should be located in templates/shortcodes/
directory.
Below is an example of a simple template for pages.
<!doctype html>
<html lang="en">
<head>
<title>{{ title }}</title>
</head>
<body>
{{ content }}
</body>
</html>