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 %}
</div>
<div class="md-flex__cell md-flex__cell--shrink">
{% block repo %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
{% endblock %}
{% if config.repo_url %}
<div class="md-header-nav__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</div>
</div>
</nav>

View File

@ -9,15 +9,17 @@
{% else %}
{% set repo_type = "" %}
{% endif %}
<a href="{{ config.repo_url }}" title="{{ i18n.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>
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ i18n.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 }}
</div>
{% endif %}
<div class="md-source__repository">
{{ config.repo_name }}
</div>
</a>
</a>
{% endblock %}

View File

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

View File

@ -38,16 +38,18 @@
{% endif %}
<!-- Repository containing source -->
<a href="{{ config.repo_url }}" title="{{ i18n.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>
{% block repo %}
<a href="{{ config.repo_url }}" title="{{ i18n.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 }}
</div>
{% endif %}
<div class="md-source__repository">
{{ config.repo_name }}
</div>
</a>
</a>
{% endblock %}