Extract into partials
This commit is contained in:
parent
5b138d5ebd
commit
4529c3e7ec
|
@ -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>
|
|
3
source/_partials/experience/description.twig
Normal file
3
source/_partials/experience/description.twig
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<div class="experience__description">
|
||||||
|
{{ experience.description|raw }}
|
||||||
|
</div>
|
18
source/_partials/experience/item.twig
Normal file
18
source/_partials/experience/item.twig
Normal 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>
|
5
source/_partials/experience/logo.twig
Normal file
5
source/_partials/experience/logo.twig
Normal 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 %}
|
8
source/_partials/experience/role.twig
Normal file
8
source/_partials/experience/role.twig
Normal 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>
|
5
source/_partials/experience/website.twig
Normal file
5
source/_partials/experience/website.twig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{% if company.website %}
|
||||||
|
<a href="{{ company.website }}" class="experience__website">
|
||||||
|
{{ company.website }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
|
@ -85,7 +85,7 @@ use: [posts]
|
||||||
<h1>Experience</h1>
|
<h1>Experience</h1>
|
||||||
|
|
||||||
{% for experience in page.experiences %}
|
{% for experience in page.experiences %}
|
||||||
{% include "experience-item" with {
|
{% include "experience/item" with {
|
||||||
experience: experience,
|
experience: experience,
|
||||||
company: site.companies[experience.company]
|
company: site.companies[experience.company]
|
||||||
} %}
|
} %}
|
||||||
|
|
Loading…
Reference in a new issue