From 4529c3e7ec814c04dbda9aed038c1f8ce46b6897 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 13 Mar 2017 07:21:33 +0000 Subject: [PATCH] Extract into partials --- source/_partials/experience-item.twig | 37 -------------------- source/_partials/experience/description.twig | 3 ++ source/_partials/experience/item.twig | 18 ++++++++++ source/_partials/experience/logo.twig | 5 +++ source/_partials/experience/role.twig | 8 +++++ source/_partials/experience/website.twig | 5 +++ source/experience.twig | 2 +- 7 files changed, 40 insertions(+), 38 deletions(-) delete mode 100644 source/_partials/experience-item.twig create mode 100644 source/_partials/experience/description.twig create mode 100644 source/_partials/experience/item.twig create mode 100644 source/_partials/experience/logo.twig create mode 100644 source/_partials/experience/role.twig create mode 100644 source/_partials/experience/website.twig diff --git a/source/_partials/experience-item.twig b/source/_partials/experience-item.twig deleted file mode 100644 index bfc356fb..00000000 --- a/source/_partials/experience-item.twig +++ /dev/null @@ -1,37 +0,0 @@ -{% set classes = [ - 'experience', - 'is-flex', - company.logo ? 'has-logo', - experience.featured ? 'is-featured', -] %} - -
-
-

{{ company.name }}

- - {% if company.website %} - - {{ company.website }} - - {% endif %} - -
- {% spaceless %} - {{ experience.role ~ ' from ' ~ experience.start ~ ' to ' ~ experience.end|default('Present') }} - {% if experience.location %} - ({{ experience.location }}) - {% endif %} - {% endspaceless %}. -
- -
- {{ experience.description|raw }} -
-
{# /.inner #} - - {% if company.logo %} - - {% endif %} -
diff --git a/source/_partials/experience/description.twig b/source/_partials/experience/description.twig new file mode 100644 index 00000000..4342b243 --- /dev/null +++ b/source/_partials/experience/description.twig @@ -0,0 +1,3 @@ +
+ {{ experience.description|raw }} +
diff --git a/source/_partials/experience/item.twig b/source/_partials/experience/item.twig new file mode 100644 index 00000000..51b6fbdf --- /dev/null +++ b/source/_partials/experience/item.twig @@ -0,0 +1,18 @@ +{% set classes = [ + 'experience', + 'is-flex', + company.logo ? 'has-logo', + experience.featured ? 'is-featured', +] %} + +
+
+

{{ company.name }}

+ + {{ include('experience/website') }} + {{ include('experience/role') }} + {{ include('experience/description') }} +
{# /.inner #} + + {{ include('experience/logo') }} +
diff --git a/source/_partials/experience/logo.twig b/source/_partials/experience/logo.twig new file mode 100644 index 00000000..d6a0efa7 --- /dev/null +++ b/source/_partials/experience/logo.twig @@ -0,0 +1,5 @@ +{% if company.logo %} + +{% endif %} diff --git a/source/_partials/experience/role.twig b/source/_partials/experience/role.twig new file mode 100644 index 00000000..6f0f2b99 --- /dev/null +++ b/source/_partials/experience/role.twig @@ -0,0 +1,8 @@ +
+ {% spaceless %} + {{ experience.role ~ ' from ' ~ experience.start ~ ' to ' ~ experience.end|default('Present') }} + {% if experience.location %} + ({{ experience.location }}) + {% endif %} + {% endspaceless %}. +
diff --git a/source/_partials/experience/website.twig b/source/_partials/experience/website.twig new file mode 100644 index 00000000..e6cb0ed3 --- /dev/null +++ b/source/_partials/experience/website.twig @@ -0,0 +1,5 @@ +{% if company.website %} + + {{ company.website }} + +{% endif %} diff --git a/source/experience.twig b/source/experience.twig index 6f9cddb5..a040eb03 100644 --- a/source/experience.twig +++ b/source/experience.twig @@ -85,7 +85,7 @@ use: [posts]

Experience

{% for experience in page.experiences %} - {% include "experience-item" with { + {% include "experience/item" with { experience: experience, company: site.companies[experience.company] } %}