Fix duplication on project pages

Issue #26
This commit is contained in:
Oliver Davies 2016-06-07 22:13:07 +01:00
parent 7791277d55
commit 04c83f9c8b
9 changed files with 58 additions and 83 deletions

View file

@ -1,25 +0,0 @@
{% if page.company %}
{% set company = site.companies[page.company] %}
<div class="project--company{% if company.logo %} project--company__has-logo{% endif %}">
{% if page.freelance %}
<h2>Built for</h2>
{% else %}
<h2>Built whilst at</h2>
{% endif %}
{% if company.logo %}
{% set name = '<img src="/assets/images/experience/' ~ company.logo ~ '" alt="' ~ company.title ~ '">' %}
{% else %}
{% set name = company.title %}
{% endif %}
{% if company.website %}
<a href="{{ company.website }}" title="{{ company.title }}">
{{ name|raw }}
</a>
{% else %}
{{ name|raw }}
{% endif %}
</div>
{% endif %}

View file

@ -1,14 +0,0 @@
{% if page.skills %}
<div class="project--skills">
<h2>Skills</h2>
<ul>
{% for item in page.skills %}
{% set skill = site.skills[item] %}
<li>
<img src="/assets/images/skills/{{ skill.image }}" alt="{{ skill.title }}" title="{{ skill.title }}">
</li>
{% endfor %}
</ul>
</div>
{% endif %}

View file

@ -0,0 +1,21 @@
{% if page.company %}
{% set company = site.companies[page.company] %}
<div class="project__company project__company--{{ company.logo ? 'has-logo' : 'no-logo' }}">
<h2>Built {{ page.freelance ? 'for' : 'whilst at' }}</h2>
{% if company.logo %}
{% set name = '<img src="/assets/images/experience/' ~ company.logo ~ '" alt="' ~ company.name ~ '">' %}
{% else %}
{% set name = company.name %}
{% endif %}
{% if company.website %}
<a href="{{ company.website }}" title="{{ company.name }}">
{{ name|raw }}
</a>
{% else %}
{{ name|raw }}
{% endif %}
</div>
{% endif %}

View file

@ -0,0 +1,11 @@
{% if page.skills %}
<div class="project--skills">
<h2>Skills</h2>
<ul>
{% for item in page.skills|sort %}
<li>{{ site.skills[item].title }}</li>
{% endfor %}
</ul>
</div>
{% endif %}