1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-01-18 00:46:47 +01:00

Put repo block definition in source.html

This commit is contained in:
squidfunk 2017-01-06 19:08:09 +01:00
parent 56207162fe
commit fde28c3f47
4 changed files with 37 additions and 37 deletions

View File

@ -38,13 +38,11 @@
{% endblock %} {% endblock %}
</div> </div>
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block repo %} {% if config.repo_url %}
{% if config.repo_url %} <div class="md-header-nav__source">
<div class="md-header-nav__source"> {% include "partials/source.html" %}
{% include "partials/source.html" %} </div>
</div> {% endif %}
{% endif %}
{% endblock %}
</div> </div>
</div> </div>
</nav> </nav>

View File

@ -9,15 +9,17 @@
{% else %} {% else %}
{% set repo_type = "" %} {% set repo_type = "" %}
{% endif %} {% endif %}
<a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}"> {% block repo %}
{% if repo_type %} <a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}">
<div class="md-source__icon"> {% if repo_type %}
<svg viewBox="0 0 24 24" width="24" height="24"> <div class="md-source__icon">
<use xlink:href="#{{ repo_type }}" width="24" height="24"></use> <svg viewBox="0 0 24 24" width="24" height="24">
</svg> <use xlink:href="#{{ repo_type }}" width="24" height="24"></use>
</svg>
</div>
{% endif %}
<div class="md-source__repository">
{{ config.repo_name }}
</div> </div>
{% endif %} </a>
<div class="md-source__repository"> {% endblock %}
{{ config.repo_name }}
</div>
</a>

View File

@ -79,13 +79,11 @@
<!-- Repository containing source --> <!-- Repository containing source -->
<div class="md-flex__cell md-flex__cell--shrink"> <div class="md-flex__cell md-flex__cell--shrink">
{% block repo %} {% if config.repo_url %}
{% if config.repo_url %} <div class="md-header-nav__source">
<div class="md-header-nav__source"> {% include "partials/source.html" %}
{% include "partials/source.html" %} </div>
</div> {% endif %}
{% endif %}
{% endblock %}
</div> </div>
</div> </div>
</nav> </nav>

View File

@ -38,16 +38,18 @@
{% endif %} {% endif %}
<!-- Repository containing source --> <!-- Repository containing source -->
<a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}" {% block repo %}
class="md-source" data-md-source="{{ repo_type }}"> <a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}"
{% if repo_type %} class="md-source" data-md-source="{{ repo_type }}">
<div class="md-source__icon"> {% if repo_type %}
<svg viewBox="0 0 24 24" width="24" height="24"> <div class="md-source__icon">
<use xlink:href="#{{ repo_type }}" width="24" height="24"></use> <svg viewBox="0 0 24 24" width="24" height="24">
</svg> <use xlink:href="#{{ repo_type }}" width="24" height="24"></use>
</svg>
</div>
{% endif %}
<div class="md-source__repository">
{{ config.repo_name }}
</div> </div>
{% endif %} </a>
<div class="md-source__repository"> {% endblock %}
{{ config.repo_name }}
</div>
</a>