Skip to content

Commit

Permalink
Add an exemple in EXAMPLES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Jul 11, 2024
1 parent aefb850 commit dd2ed79
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Exemple for automatic widget inclusion

First you can verify that all widgets are found with the `listwidget` command.\
Then the `makewidget` command will create a file `content/templates/<engine>/allwidgets.html`, that groups all the widgets found, and is automatically imported as `widgets` in all pages.\

The line `{% import 'allwidgets.html' as widgets %}` is added at the beginning of each `Body` section of pages.

For instance, if we have 3 widgets : `navbar.html`, `header.html` and `footer.html` we can use them in pages :

```jinja
{{ widgets.navbar(...) }}
{{ widgets.header(...) }}
{{ widgets.footer(...) }}
```

0 comments on commit dd2ed79

Please sign in to comment.