Refactor to macros
This commit is contained in:
parent
37e4e80831
commit
8c32c6131d
|
@ -110,7 +110,22 @@ experiences:
|
||||||
|
|
||||||
First Acquia certified Drupal 8 Developer and back-end specialist.
|
First Acquia certified Drupal 8 Developer and back-end specialist.
|
||||||
---
|
---
|
||||||
|
{% macro roleText(experience) %}
|
||||||
|
{{- experience.role }} from {{ experience.start }} to {{ experience.end|default('Present') -}}
|
||||||
|
{%- if experience.location %} ({{ experience.location }}){% endif %}.
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro companyUrl(site, company) %}
|
||||||
|
{{ company.url ~ '?utm_source=' ~ site.short_url ~ '&utm_medium=experience' }}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro companyLogoUrl(company) %}
|
||||||
|
{{- '/images/experience/' ~ company.logo -}}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% import _self as helpers %}
|
||||||
|
|
||||||
<div class="listing">
|
<div class="listing">
|
||||||
{% for experience in page.experiences|reverse %}
|
{% for experience in page.experiences|reverse %}
|
||||||
{% set company = site.companies[experience.company] %}
|
{% set company = site.companies[experience.company] %}
|
||||||
|
@ -122,14 +137,13 @@ experiences:
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
{% if company.url -%}
|
{% if company.url -%}
|
||||||
<a class="inline-block text-blue mb-1" href="{{ company.url }}?utm_source={{ site.short_url }}&utm_medium=experience">
|
<a class="inline-block text-blue mb-1" href="{{ helpers.companyUrl(site, company) }}">
|
||||||
{{- company.url -}}
|
{{- company.url -}}
|
||||||
</a>
|
</a>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<div class="text-grey-dark">
|
<div class="text-grey-dark">
|
||||||
{{- experience.role }} from {{ experience.start }} to {{ experience.end|default('Present') -}}
|
{{ helpers.roleText(experience) }}
|
||||||
{%- if experience.location %} ({{ experience.location }}){% endif %}.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -142,7 +156,7 @@ experiences:
|
||||||
|
|
||||||
{% if company.logo %}
|
{% if company.logo %}
|
||||||
<div class="flex-none mt-2 mb-4 ml-4 w-16 sm:w-24 lg:w-32">
|
<div class="flex-none mt-2 mb-4 ml-4 w-16 sm:w-24 lg:w-32">
|
||||||
<img src="/images/experience/{{ company.logo }}" alt="{{ company.name }} logo">
|
<img src="{{ helpers.companyLogoUrl(company) }}" alt="{{ company.name }} logo">
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue