1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Documentation

This commit is contained in:
squidfunk 2022-09-11 16:49:28 +02:00
parent 54d0a992b7
commit d9ce9bd933

View File

@ -170,18 +170,20 @@ Then, e.g. to override the site title, add the following lines to `main.html`:
{% endblock %} {% endblock %}
``` ```
If you intend to add some code to a block rather than to replace it altogether with new content, use `{{ super() }}` right after the `{% block %}` statement to include the original block content. This is particularly useful when adding some third-party widgets to your docs, e.g., for chatting with support or submitting a ticket. For example, if your widget script is hosted on `widgets.example.com`, add the following lines to `main.html`: If you intend to __add__ something to a block rather than to replace it
altogether with new content, use `{{ super() }}` inside the block to include the
original block content. This is particularly useful when adding third-party
scripts to your docs, e.g.
```html ``` html
{% extends "base.html" %} {% extends "base.html" %}
{% block scripts %} {% block scripts %}
<!-- Add scripts that need to run before here -->
{{ super() }} {{ super() }}
<!-- Add scripts that need to run afterwards here -->
<script id="snippet" src="https://widgets.example.com/snippet.js> </script>
{% endblock %} {% endblock %}
```
The following template blocks are provided by the theme: The following template blocks are provided by the theme: