Skip to content

Commit

Permalink
Merge pull request #4 from jsoxford/sponsors_page
Browse files Browse the repository at this point in the history
Add a sponsors page
  • Loading branch information
AverageMarcus authored Jan 15, 2018
2 parents 6a5d0f3 + 2b13bd4 commit 9aefab5
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 11 deletions.
22 changes: 12 additions & 10 deletions handlebarsHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ renderer.paragraph = function(text) {
return text;
}

const dedupe = key => events => {
const deduped = {};
events && events.forEach(event => {
event[key] && event[key].forEach(item => {
deduped[item.name] = item;
});
});
return Object.values(deduped);
}

module.exports = {
'moment': function(date, format) {
return new moment(date).format(format);
Expand Down Expand Up @@ -35,14 +45,6 @@ module.exports = {
'lowerCase': function(context) {
return context ? context.toLowerCase() : '';
},
'getSpeakers': function(events) {
const speakers = {}
events && events.forEach(event => {
event.speakers && event.speakers.forEach(speaker => {
speakers[speaker.name] = speaker;
});
});

return Object.values(speakers);
}
'getSpeakers': dedupe('speakers'),
'getSponsors': dedupe('sponsors')
}
1 change: 1 addition & 0 deletions layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<li><a href="/archive/">Previous Meetups</a></li>
<li><a href="/speakers/">Speaker Resources</a></li>
<li><a href="/hosts/">Host Resources</a></li>
<li><a href="/sponsors/">Sponsors</a></li>
<li><a href="https://docs.google.com/forms/d/e/1FAIpQLSflx7LU44PuwlyCJj-WwlP_SlrUvxAd8uaXlY7_O65c7RLpGQ/viewform?usp=sf_link">Submit a Talk</a></li>
<li>
<a href="https://www.twitter.com/JSOxford" title="Follow us on Twitter">
Expand Down
17 changes: 16 additions & 1 deletion src/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ main {
}
}

.speakers {
.speakers, .sponsors {
display: flex;
flex-wrap: wrap;
flex-direction: row;
Expand All @@ -188,6 +188,21 @@ main {

figcaption {
text-align: center;
margin-top: 8px;
}
}
}

.sponsors figure {
margin-top: 15px;
width: 50%;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;

img {
max-width: 90%;
max-height: 200px;
}
}
27 changes: 27 additions & 0 deletions src/pages/Sponsors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
layout: page.html
title: Sponsors
---

<h1>
<a href="/{{lowerCase title}}/">{{ title }}</a>
</h1>

<p>
JSOxford can only operate thanks to the kind support of our sponsors. Sponsors help us cover costs including, but not limited to, venue hire, event insurance and refreshments. We thank each for their support.
</p>

<h2>Our Wonderful Sponsors <small>(Past and Present)</small></h2>

<div class="sponsors">
{{#each (getSponsors collections.events) }}
<figure>
<img src="{{this.logo}}" alt="{{this.name}}">
<figcaption>
<a href="{{this.url}}">
{{this.name}}
</a>
</figcaption>
</figure>
{{/each}}
</div>

0 comments on commit 9aefab5

Please sign in to comment.