Merge master

This commit is contained in:
Oliver Davies 2015-08-13 20:56:45 +01:00
commit 0c3523972c
7 changed files with 66 additions and 51 deletions

View file

@ -74,7 +74,7 @@ meetups:
url: http://www.accessiblebristol.org.uk
udiff:
name: unified.diff
name: Unified Diff
logo: unified-diff.png
url: http://unifieddiff.co.uk
@ -83,3 +83,14 @@ hightlightjs: default
digitalocean_referral: a913b4b00d4a
default_date_format: jS F, Y
availability:
day:
available: no
start: ~
end: ~
evenings:
available: limited
start: 2015-08-10
end: ~

View file

@ -1,10 +0,0 @@
From,To
about,/
blog/2012/07/nomensa-accessible-media-player-drupal,/blog/install-nomensa-media-player-drupal/
cv,https://gist.github.com/opdavies/d096d553b80140a342d4
drupalgive,https://www.drupal.org/u/opdavies
projects,/services/
portfolio,/services/
speaking,/talks/
terms-and-conditions,/terms/
work,/services/
1 From To
2 about /
3 blog/2012/07/nomensa-accessible-media-player-drupal /blog/install-nomensa-media-player-drupal/
4 cv https://gist.github.com/opdavies/d096d553b80140a342d4
5 drupalgive https://www.drupal.org/u/opdavies
6 projects /services/
7 portfolio /services/
8 speaking /talks/
9 terms-and-conditions /terms/
10 work /services/

View file

@ -1,34 +0,0 @@
#!/usr/bin/env php
<?php
$csv = __DIR__ . '/redirects.csv';
$template = <<<EOS
---
layout: redirect
destination: %DESTINATION%
---
EOS;
$row = 0;
if (($handle = fopen($csv, 'r')) !== FALSE) {
while (($data = fgetcsv($handle, filesize($csv))) !== FALSE) {
$row++;
if ($row > 1) {
$templateData = [
'%DESTINATION%' => $data[1],
];
$output = strtr($template, $templateData);
$filename = str_replace('/', '-', $data[0]);
file_put_contents("source/$filename.html", $output);
echo "Written to $filename.html\n";
}
}
}
fclose($handle);

View file

@ -0,0 +1,41 @@
<div class="availability">
<h2>Availability</h2>
<div class="content">
{% set now = "now"|date('U') %}
{% for type, data in site.availability %}
{% if type == 'day' %}
{% if data.available == 'yes' %}
{% set text = 'Available for day contract work' %}
{% elseif data.available == 'no' %}
{% set text = 'Not available for day contract work' %}
{% endif %}
{% elseif type == 'evenings' %}
{% if data.available == 'yes' %}
{% set text = 'Available for weekend/evening freelance work' %}
{% elseif data.available == 'limited' %}
{% set text = 'Limited availability for weekend/evening freelance work' %}
{% elseif data.available == 'no' %}
{% set text = 'Not available for weekend/evening freelance work' %}
{% endif %}
{% endif %}
{% if data.start %}
{% if data.start|date('U') > now %}
{% set text = text ~ ' starting ' ~ data.start|date('F Y') %}
{% if data.end %}
{% set text = text ~ ',' %}
{% endif %}
{% endif %}
{% endif %}
{% if data.end %}
{% set text = text ~ ' until ' ~ data.end|date('F Y') %}
{% endif %}
<p class="availability__{{ data.available }}">{{ text }}.</p>
{% endfor %}
</div>
</div>

View file

@ -10,8 +10,8 @@
<a class="navbar-brand" href="/">{{ site.title }}</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<div id="navbar" class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-right">
{% for link in site.main_menu %}
<li class="nav__{{ link.title|lower }}"><a href="{{ link.href }}">{{ link.title }}</a></li>
{% endfor %}

View file

@ -5,4 +5,6 @@
<img src="/assets/images/da-individual-member.png" alt="Drupal Association Individual Member">
</a>
</section>
{% include 'availability' %}
</div>

View file

@ -1,6 +1,11 @@
<li>{% spaceless %}
<strong>{{ talk.date|date('F') }}</strong> - {{ talk.location }} -
<a href="{{ talk.url }}" title="{{ talk.title }}">
{{ talk.title }}
</a>
<strong>
{{ talk.date|date('jS F') }}
{% else %}
{{ talk.date|date('F') }}
{% endif %}
</strong> - {{ talk.location }} -
{% if talk.title_link -%}<a href="{{ talk.title_link }}" title="{{ talk.title }}">{%- endif -%}
{{ talk.title }}
{%- if talk.title_link -%}</a>{%- endif -%}
{% endspaceless %}</li>