Extract into partials

This commit is contained in:
Oliver Davies 2017-03-13 07:21:33 +00:00
parent 5b138d5ebd
commit 4529c3e7ec
7 changed files with 40 additions and 38 deletions

View file

@ -1,37 +0,0 @@
{% set classes = [
'experience',
'is-flex',
company.logo ? 'has-logo',
experience.featured ? 'is-featured',
] %}
<div class="{{ classes|sort|join(' ') }}">
<div class="inner">
<h2>{{ company.name }}</h2>
{% if company.website %}
<a href="{{ company.website }}" class="experience__website">
{{ company.website }}
</a>
{% endif %}
<div class="experience__role">
{% spaceless %}
{{ experience.role ~ ' from ' ~ experience.start ~ ' to ' ~ experience.end|default('Present') }}
{% if experience.location %}
({{ experience.location }})
{% endif %}
{% endspaceless %}.
</div>
<div class="experience__description">
{{ experience.description|raw }}
</div>
</div>{# /.inner #}
{% if company.logo %}
<div class="experience__logo">
<img src="{{ site.images_url }}/assets/images/experience/{{ company.logo }}" alt="{{ company.name }} logo">
</div>
{% endif %}
</div>

View file

@ -0,0 +1,3 @@
<div class="experience__description">
{{ experience.description|raw }}
</div>

View file

@ -0,0 +1,18 @@
{% set classes = [
'experience',
'is-flex',
company.logo ? 'has-logo',
experience.featured ? 'is-featured',
] %}
<div class="{{ classes|sort|join(' ') }}">
<div class="inner">
<h2>{{ company.name }}</h2>
{{ include('experience/website') }}
{{ include('experience/role') }}
{{ include('experience/description') }}
</div>{# /.inner #}
{{ include('experience/logo') }}
</div>

View file

@ -0,0 +1,5 @@
{% if company.logo %}
<div class="experience__logo">
<img src="{{ site.images_url }}/assets/images/experience/{{ company.logo }}" alt="{{ company.name }} logo">
</div>
{% endif %}

View file

@ -0,0 +1,8 @@
<div class="experience__role">
{% spaceless %}
{{ experience.role ~ ' from ' ~ experience.start ~ ' to ' ~ experience.end|default('Present') }}
{% if experience.location %}
({{ experience.location }})
{% endif %}
{% endspaceless %}.
</div>

View file

@ -0,0 +1,5 @@
{% if company.website %}
<a href="{{ company.website }}" class="experience__website">
{{ company.website }}
</a>
{% endif %}

View file

@ -85,7 +85,7 @@ use: [posts]
<h1>Experience</h1>
{% for experience in page.experiences %}
{% include "experience-item" with {
{% include "experience/item" with {
experience: experience,
company: site.companies[experience.company]
} %}