Add meetup and nav-item partials

This commit is contained in:
Oliver Davies 2018-05-28 22:45:27 +02:00
parent b0a751e8b1
commit fa9652df3e
4 changed files with 79 additions and 57 deletions

View file

@ -207,48 +207,6 @@ latest_posts: 5
linkedin:
url: http://uk.linkedin.com/in/opdavies
meetups:
- name: Drupal Bristol
logo: drupal-bristol.jpeg
url: 'http://www.drupalbristol.org.uk'
- name: DrupalCamp Bristol
logo: drupalcamp-bristol.png
url: 'http://www.drupalcampbristol.co.uk'
- name: PHPSW
logo: phpsw.jpeg
url: 'http://phpsw.uk'
navigation:
- title: About
href: '/'
pattern: '^/.$'
- title: Experience
href: '/experience'
pattern: '^/experience/?$'
- title: Talks
href: '/talks'
pattern: '^/talks/?'
- title: 'Open Source'
href: '/opensource'
pattern: '^/opensource/?$'
- title: Blog
href: '/blog'
pattern: '^/blog/?'
- title: Book
href: '/test-driven-drupal'
pattern: '^/test-driven-drupal/?'
- title: Contact
href: '/contact'
pattern: '^/contact/?'
packagist:
name: opdavies
url: https://packagist.org/users/opdavies

View file

@ -49,13 +49,47 @@
</div>
<nav class="hidden w-full md:w-2/3 lg:w-3/4 md:flex md:flex-wrap md:justify-end" role="navigation">
{% for link in site.navigation %}
<a href="{{ link.href }}" class="-mx-4 p-4 md:border-b-2 md:border-transparent md:ml-4 md:mr-0 md:p-0 {{ loop.first ? 'border-t border-grey-lighter md:border-t-0 md:border-transparent' }} {{ page.url matches '#' ~ link.pattern ~ '#' ? 'md:bg-transparent md:border-blue' }}">
<span class="flex items-center h-full">
{{- link.title -}}
</span>
</a>
{% endfor %}
{% include 'nav-item.html.twig' with {
title: 'About',
href: '/',
pattern: '^/.$',
} %}
{% include 'nav-item.html.twig' with {
title: 'Experience',
href: '/experience',
pattern: '^/experience/?$',
} %}
{% include 'nav-item.html.twig' with {
title: 'Talks',
href: '/talks',
pattern: '^/talks/?',
} %}
{% include 'nav-item.html.twig' with {
title: 'Open Source',
href: '/opensource',
pattern: '^/opensource/?$',
} %}
{% include 'nav-item.html.twig' with {
title: 'Blog',
href: '/blog',
pattern: '^/blog/?',
} %}
{% include 'nav-item.html.twig' with {
title: 'Book',
href: '/test-driven-drupal',
pattern: '^/test-driven-drupal/?$',
} %}
{% include 'nav-item.html.twig' with {
title: 'Contact',
href: '/contact',
pattern: '^/contact/?',
} %}
</nav>
</div>
</header>
@ -88,14 +122,24 @@
<div class="mt-2">
<h2 class="mb-2">Things that I organise</h2>
<ul class="list-reset flex">
{% for meetup in site.meetups %}
<li>
<a href="{{ meetup.url }}" title="{{ meetup.name }}" class="dib mr-4">
<img src="{{ site.images_url }}/build/images/meetups/{{ meetup.logo }}" alt="{{ meetup.name }} logo" class="h-16">
</a>
</li>
{% endfor %}
<ul class="list-reset inline-flex">
{% include 'meetup.html.twig' with {
name: 'Drupal Bristol',
logo: 'drupal-bristol.jpeg',
url: 'http://www.drupalbristol.org.uk',
} %}
{% include 'meetup.html.twig' with {
name: 'DrupalCamp Bristol',
logo: 'drupalcamp-bristol.png',
url: 'http://www.drupalcampbristol.co.uk',
} %}
{% include 'meetup.html.twig' with {
name: 'PHPSW',
logo: 'phpsw.jpeg',
url: 'http://phpsw.uk',
} %}
</ul>
</div>
</footer>

View file

@ -0,0 +1,10 @@
<li class="mr-2">
<a href="{{ url }}">
<img
class="h-16"
src="/build/images/meetups/{{ logo }}"
title="{{ name }}"
alt="{{ name }} logo"
>
</a>
</li>

View file

@ -0,0 +1,10 @@
{% set classes = [
'-mx-4 p-4 md:border-b-2 md:border-transparent md:ml-4 md:mr-0 md:p-0',
loop.first ? 'border-t border-grey-lighter md:border-t-0 md:border-transparent',
page.url matches '#' ~ pattern ~ '#' ? 'md:bg-transparent md:border-blue',
] %}
<a href="{{ href }}" class="{{ classes|join(' ')|trim }}">
<span class="flex items-center h-full">
{{- title -}}
</span>
</a>