+
{{ PODUCT.name }}
+
{{ PRODUCT.description }}
+
Buy it for {{ PRODUCT.price }}$ !
+
+{% endmacro %}
+```
+With two version of blocks `jinja2/blocks/prod1/product.html` and `jinja2/blocks/prod2/product.html` :
+```jinja
+{% from "widgets/product.html" import product %}
+{{ product(
+ PRODUCT =
+ {
+ "name": "product1"
+ "description": "..."
+ "price": "12"
+ }
+) }}
+```
+```jinja
+{% from "widgets/product.html" import product %}
+{{ product(
+ PRODUCT =
+ {
+ "name": "product2"
+ "description": "..."
+ "price": "36"
+ }
+) }}
+```
+And finally we can use this blocks with :
+```jinja
+{% from "blocks/block.html" import block %}
+{{ block(
+ NAME = "product"
+ VERSION = "prod1"
+)}}
+{{ block(
+ NAME = "product"
+ VERSION = "prod2"
+)}}
+```
+
# Exemple for automatic widget inclusion
First you can verify that all widgets are found with the `listwidget` command.\
diff --git a/README.md b/README.md
index c1317d7..7f76fc1 100644
--- a/README.md
+++ b/README.md
@@ -102,6 +102,20 @@ This directory is for the static content, like images, CSS and JavaScript files
It is accessible in templates by the Jinja or Django `static` function. \
See the [Django doc](https://docs.djangoproject.com/en/5.0/howto/static-files/#configuring-static-files) for static files, or the [Jinja2 version](https://docs.djangoproject.com/en/5.0/topics/templates/#module-django.template.backends.django).
+### Blocks or widgets
+Widgets are reusable templates used to factor some content in pages. Widgets will be searched in the templates directories, in `