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

@ -4,7 +4,7 @@ sculpin_content_types:
taxonomies:
- tags
projects:
permalink: projects/:slug_title/
permalink: projects/:filename/
taxonomies:
- skills
- tags

View file

@ -1,21 +0,0 @@
.project--skills
ul
list-style: none
margin-left: 0
padding-left: 0
li
display: inline-block
margin-right: 5px
img
max-height: 30px
.project--company__has-logo
a:link,
a:hover
border-bottom: 0
display: block
img
max-height: 50px

View file

@ -0,0 +1,13 @@
.project
&--company__has-logo
a:link,
a:hover
border-bottom: 0
display: block
img
max-height: 50px
&__website
@extend .btn
@extend .btn-primary

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 %}

View file

@ -1,30 +1,18 @@
{% extends 'page' %}
{% block content_wrapper %}
<main class="col-md-9">
{{ page.blocks.content_top|raw }}
{{ page.blocks.content|raw }}
{{ page.blocks.content_bottom|raw }}
</main>
{% endblock %}
{% if page.image -%}
<img src="/assets/images/projects/{{ page.image.name ?: page.image }}" alt="{{ page.image.alt }}">
{%- endif %}
{% block content_top %}
{{ parent() }}
{% block content %}{% endblock %}
{% if page.image %}
<div class="project--image">
<img class="img-responsive" src="/assets/images/projects/{{ page.image }}" alt="The {{ page.title }} website.">
</div>
{% endif %}
{% endblock %}
{% block content_bottom %}
{% if page.website %}
<div class="project--website">
<a href="{{ page.website }}" class="btn btn-primary">View the website</a>
</div>
<a class="project__website" href="{{ page.website }}">
View the website
</a>
{% endif %}
{{ include('project-skills') }}
{{ include('project-company') }}
{{ include('projects/skills') }}
{{ include('projects/company') }}
{% endblock %}

View file

@ -4,7 +4,9 @@ website: http://road.cc
tags:
- drupal
- drupal-7
image: roadcc.png
image:
name: roadcc.png
alt: The new road.cc website
company: microserve
role: Lead Developer
skills: [drupal, php, git, less]