diff --git a/docs/customization.md b/docs/customization.md index c7fef75e5..48f5cb5f9 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -155,14 +155,10 @@ The Material theme provides the following template blocks: | `hero` | Wraps the hero teaser | | `htmltitle` | Wraps the `` tag | | `libs` | Wraps the JavaScript libraries, e.g. Modernizr | -| `repo` | Wraps the repository link in the header bar | | `scripts` | Wraps the JavaScript application logic | | `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_name` | Wraps the site name in the header bar | | `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) | For more on this topic refer to the [MkDocs documentation][4] diff --git a/material/partials/footer.html b/material/partials/footer.html index d7333d090..b87b84f24 100644 --- a/material/partials/footer.html +++ b/material/partials/footer.html @@ -50,9 +50,7 @@ <a href="https://squidfunk.github.io/mkdocs-material/"> Material for MkDocs</a> </div> - {% block social %} - {% include "partials/social.html" %} - {% endblock %} + {% include "partials/social.html" %} </div> </div> </footer> diff --git a/material/partials/header.html b/material/partials/header.html index e50903880..8e2c35eac 100644 --- a/material/partials/header.html +++ b/material/partials/header.html @@ -15,27 +15,23 @@ </div> <div class="md-flex__cell md-flex__cell--stretch"> <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 }} + {% else %} + <span class="md-header-nav__topic"> {{ config.site_name }} - {% else %} - <span class="md-header-nav__topic"> - {{ config.site_name }} - </span> - <span class="md-header-nav__topic"> - {{ page.title }} - </span> - {% endif %} - {% endblock %} + </span> + <span class="md-header-nav__topic"> + {{ page.title }} + </span> + {% endif %} </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> - {% block search_box %} - {% if "search" in config["plugins"] %} - <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> - {% include "partials/search.html" %} - {% endif %} - {% endblock %} + {% if "search" in config["plugins"] %} + <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> + {% include "partials/search.html" %} + {% endif %} </div> {% if config.repo_url %} <div class="md-flex__cell md-flex__cell--shrink"> diff --git a/material/partials/source.html b/material/partials/source.html index a0417b88c..0869cb91f 100644 --- a/material/partials/source.html +++ b/material/partials/source.html @@ -9,17 +9,15 @@ {% else %} {% set repo_type = "" %} {% endif %} -{% block repo %} - <a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}"> - {% if repo_type %} - <div class="md-source__icon"> - <svg viewBox="0 0 24 24" width="24" height="24"> - <use xlink:href="#__{{ repo_type }}" width="24" height="24"></use> - </svg> - </div> - {% endif %} - <div class="md-source__repository"> - {{ config.repo_name }} +<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}"> + {% if repo_type %} + <div class="md-source__icon"> + <svg viewBox="0 0 24 24" width="24" height="24"> + <use xlink:href="#__{{ repo_type }}" width="24" height="24"></use> + </svg> </div> - </a> -{% endblock %} + {% endif %} + <div class="md-source__repository"> + {{ config.repo_name }} + </div> +</a> diff --git a/src/partials/footer.html b/src/partials/footer.html index 62f4f1851..afa3daec4 100644 --- a/src/partials/footer.html +++ b/src/partials/footer.html @@ -96,9 +96,7 @@ </div> <!-- Social links --> - {% block social %} - {% include "partials/social.html" %} - {% endblock %} + {% include "partials/social.html" %} </div> </div> </footer> diff --git a/src/partials/header.html b/src/partials/header.html index a576fdc55..33c0fe955 100644 --- a/src/partials/header.html +++ b/src/partials/header.html @@ -50,32 +50,28 @@ <div class="md-flex__cell md-flex__cell--stretch"> <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 }} + {% else %} + <span class="md-header-nav__topic"> {{ config.site_name }} - {% else %} - <span class="md-header-nav__topic"> - {{ config.site_name }} - </span> - <span class="md-header-nav__topic"> - {{ page.title }} - </span> - {% endif %} - {% endblock %} + </span> + <span class="md-header-nav__topic"> + {{ page.title }} + </span> + {% endif %} </div> </div> <!-- Button to open search dialogue --> <div class="md-flex__cell md-flex__cell--shrink"> - {% block search_box %} - {% if "search" in config["plugins"] %} - <label class="md-icon md-icon--search md-header-nav__button" - for="__search"></label> + {% if "search" in config["plugins"] %} + <label class="md-icon md-icon--search md-header-nav__button" + for="__search"></label> - <!-- Search interface --> - {% include "partials/search.html" %} - {% endif %} - {% endblock %} + <!-- Search interface --> + {% include "partials/search.html" %} + {% endif %} </div> <!-- Repository containing source --> diff --git a/src/partials/source.html b/src/partials/source.html index 7e0b53b28..7f206fe58 100644 --- a/src/partials/source.html +++ b/src/partials/source.html @@ -38,18 +38,16 @@ {% endif %} <!-- Repository containing source --> -{% block repo %} - <a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" - class="md-source" data-md-source="{{ repo_type }}"> - {% if repo_type %} - <div class="md-source__icon"> - <svg viewBox="0 0 24 24" width="24" height="24"> - <use xlink:href="#__{{ repo_type }}" width="24" height="24"></use> - </svg> - </div> - {% endif %} - <div class="md-source__repository"> - {{ config.repo_name }} +<a href="{{ config.repo_url }}" title="{{ lang.t('source.link.title') }}" + class="md-source" data-md-source="{{ repo_type }}"> + {% if repo_type %} + <div class="md-source__icon"> + <svg viewBox="0 0 24 24" width="24" height="24"> + <use xlink:href="#__{{ repo_type }}" width="24" height="24"></use> + </svg> </div> - </a> -{% endblock %} + {% endif %} + <div class="md-source__repository"> + {{ config.repo_name }} + </div> +</a>