Removed blocks in partials - Jinja doesn't support them

This commit is contained in:
squidfunk 2019-02-09 18:02:46 +01:00
parent 9d46c27a9e
commit a27372eee3
7 changed files with 53 additions and 73 deletions

View File

@ -155,14 +155,10 @@ The Material theme provides the following template blocks:
| `hero` | Wraps the hero teaser | | `hero` | Wraps the hero teaser |
| `htmltitle` | Wraps the `<title>` tag | | `htmltitle` | Wraps the `<title>` tag |
| `libs` | Wraps the JavaScript libraries, e.g. Modernizr | | `libs` | Wraps the JavaScript libraries, e.g. Modernizr |
| `repo` | Wraps the repository link in the header bar |
| `scripts` | Wraps the JavaScript application logic | | `scripts` | Wraps the JavaScript application logic |
| `source` | Wraps the linked source files | | `source` | Wraps the linked source files |
| `search_box` | Wraps the search form in the header bar |
| `site_meta` | Wraps the meta tags in the document head | | `site_meta` | Wraps the meta tags in the document head |
| `site_name` | Wraps the site name in the header bar |
| `site_nav` | Wraps the site navigation and table of contents | | `site_nav` | Wraps the site navigation and table of contents |
| `social` | Wraps the social links in the footer |
| `styles` | Wraps the stylesheets (also extra sources) | | `styles` | Wraps the stylesheets (also extra sources) |
For more on this topic refer to the [MkDocs documentation][4] For more on this topic refer to the [MkDocs documentation][4]

View File

@ -50,9 +50,7 @@
<a href="https://squidfunk.github.io/mkdocs-material/"> <a href="https://squidfunk.github.io/mkdocs-material/">
Material for MkDocs</a> Material for MkDocs</a>
</div> </div>
{% block social %}
{% include "partials/social.html" %} {% include "partials/social.html" %}
{% endblock %}
</div> </div>
</div> </div>
</footer> </footer>

View File

@ -15,7 +15,6 @@
</div> </div>
<div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
{% block site_name %}
{% if config.site_name == page.title %} {% if config.site_name == page.title %}
{{ config.site_name }} {{ config.site_name }}
{% else %} {% else %}
@ -26,16 +25,13 @@
{{ page.title }} {{ page.title }}
</span> </span>
{% endif %} {% endif %}
{% endblock %}
</div> </div>
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block search_box %}
{% if "search" in config["plugins"] %} {% if "search" in config["plugins"] %}
<label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
{% include "partials/search.html" %} {% include "partials/search.html" %}
{% endif %} {% endif %}
{% endblock %}
</div> </div>
{% if config.repo_url %} {% if config.repo_url %}
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">

View File

@ -9,7 +9,6 @@
{% else %} {% else %}
{% set repo_type = "" %} {% set repo_type = "" %}
{% endif %} {% endif %}
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}"> <a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}">
{% if repo_type %} {% if repo_type %}
<div class="md-source__icon"> <div class="md-source__icon">
@ -22,4 +21,3 @@
{{ config.repo_name }} {{ config.repo_name }}
</div> </div>
</a> </a>
{% endblock %}

View File

@ -96,9 +96,7 @@
</div> </div>
<!-- Social links --> <!-- Social links -->
{% block social %}
{% include "partials/social.html" %} {% include "partials/social.html" %}
{% endblock %}
</div> </div>
</div> </div>
</footer> </footer>

View File

@ -50,7 +50,6 @@
<div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__cell md-flex__cell--stretch">
<div class="md-flex__ellipsis md-header-nav__title" <div class="md-flex__ellipsis md-header-nav__title"
data-md-component="title"> data-md-component="title">
{% block site_name %}
{% if config.site_name == page.title %} {% if config.site_name == page.title %}
{{ config.site_name }} {{ config.site_name }}
{% else %} {% else %}
@ -61,13 +60,11 @@
{{ page.title }} {{ page.title }}
</span> </span>
{% endif %} {% endif %}
{% endblock %}
</div> </div>
</div> </div>
<!-- Button to open search dialogue --> <!-- Button to open search dialogue -->
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block search_box %}
{% if "search" in config["plugins"] %} {% if "search" in config["plugins"] %}
<label class="md-icon md-icon--search md-header-nav__button" <label class="md-icon md-icon--search md-header-nav__button"
for="__search"></label> for="__search"></label>
@ -75,7 +72,6 @@
<!-- Search interface --> <!-- Search interface -->
{% include "partials/search.html" %} {% include "partials/search.html" %}
{% endif %} {% endif %}
{% endblock %}
</div> </div>
<!-- Repository containing source --> <!-- Repository containing source -->

View File

@ -38,7 +38,6 @@
{% endif %} {% endif %}
<!-- Repository containing source --> <!-- Repository containing source -->
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" <a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}"
class="md-source" data-md-source="{{ repo_type }}"> class="md-source" data-md-source="{{ repo_type }}">
{% if repo_type %} {% if repo_type %}
@ -52,4 +51,3 @@
{{ config.repo_name }} {{ config.repo_name }}
</div> </div>
</a> </a>
{% endblock %}