1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-01-18 08:54:46 +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,6 +9,7 @@
{% else %} {% else %}
{% set repo_type = "" %} {% set repo_type = "" %}
{% endif %} {% endif %}
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}" class="md-source" data-md-source="{{ repo_type }}"> <a href="{{ config.repo_url }}" title="{{ i18n.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">
@ -21,3 +22,4 @@
{{ config.repo_name }} {{ config.repo_name }}
</div> </div>
</a> </a>
{% endblock %}

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,6 +38,7 @@
{% endif %} {% endif %}
<!-- Repository containing source --> <!-- Repository containing source -->
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ i18n.t('source.link.title') }}" <a href="{{ config.repo_url }}" title="{{ i18n.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 %}
@ -51,3 +52,4 @@
{{ config.repo_name }} {{ config.repo_name }}
</div> </div>
</a> </a>
{% endblock %}