Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Seattle pilot page #152

Open
wants to merge 5 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion content/chapters/seattle.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"city": "Seattle"
"city": "Seattle",
"photo": "chapters/seattle.jpg",
"meetup": "https://www.meetup.com/WSC-Seattle"
}
14 changes: 12 additions & 2 deletions content/sponsors/climate-corporation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
"url": "https://climate.com/",
"logo": "/images/climate-corporation.jpg",
"sponsorships": [
{ "year": "2019", "level": "Local Meetup SEA", "conf_sponsor": false },
{ "year": "2019", "level": "Local Meetup SF", "conf_sponsor": false }
{
"year": "2019",
"level": "Local Meetup SEA",
"conf_sponsor": false,
"city": "Seattle"
},
{
"year": "2019",
"level": "Local Meetup SF",
"conf_sponsor": false,
"city": "San Francisco"
}
]
}
7 changes: 6 additions & 1 deletion content/sponsors/glympse.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"url": "https://www.glympse.com",
"logo": "/images/glympse.jpg",
"sponsorships": [
{ "year": "2019", "level": "Local Meetup SEA", "conf_sponsor": false }
{
"year": "2019",
"level": "Local Meetup SEA",
"conf_sponsor": false,
"city": "Seattle"
}
]
}
63 changes: 48 additions & 15 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
const path = require('path')
const { createFilePath } = require('gatsby-source-filesystem')

// Add slug field based on filepath to content nodes
// We use this slug to create the path for the automatically generated pages
exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions

if (
node.internal.type === `MarkdownRemark` ||
node.internal.type === `ChaptersJson`
) {
const value = createFilePath({ node, getNode })
createNodeField({
name: `slug`,
node,
value,
})
}
}

// Create subpages from markdown and chapter pages from json
exports.createPages = ({ actions, graphql }) => {
const { createPage } = actions

Expand All @@ -24,41 +43,55 @@ exports.createPages = ({ actions, graphql }) => {
}
}
}
allChaptersJson {
edges {
node {
id
city
photo
fields {
slug
}
}
}
}
}
`).then(result => {
if (result.errors) {
result.errors.forEach(e => console.error(e.toString()))
return Promise.reject(result.errors)
}

const pages = result.data.allMarkdownRemark.edges
const subPages = result.data.allMarkdownRemark.edges
const chapterPages = result.data.allChaptersJson.edges

pages.forEach(edge => {
subPages.forEach(edge => {
const id = edge.node.id
createPage({
path: edge.node.fields.slug,
tags: edge.node.frontmatter.tags,
component: path.resolve(
`src/templates/${String(edge.node.frontmatter.templateKey)}.js`
),
// additional data can be passed via context
context: {
id,
},
})
})
})
}

exports.onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions

if (node.internal.type === `MarkdownRemark`) {
const value = createFilePath({ node, getNode })
createNodeField({
name: `slug`,
node,
value,
chapterPages.forEach(edge => {
const id = edge.node.id
const city = edge.node.city
const photo = edge.node.photo
createPage({
path: edge.node.fields.slug,
component: path.resolve(`src/templates/chapter.js`),
context: {
id,
city,
photo,
},
})
})
}
})
}
1 change: 0 additions & 1 deletion src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const Header = () => {
<Img
fixed={data.file.childImageSharp.fixed}
alt="Write/Speak/Code logo in full color"
className={styles.logo}
/>
</Link>
<Menu />
Expand Down
35 changes: 35 additions & 0 deletions src/components/hero/hero.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.overlay {
background: linear-gradient(
to right,
RGBA(255, 255, 255, 0.5),
RGBA(255, 255, 255, 0.5)
);
width: 100%;
height: 100%;
display: table;
}

.hero {
margin: 4em 2em;
@media screen and (min-width: 50em) {
margin: 8em 2em;
}
@media screen and (min-width: 95em) {
max-width: var(--container);
margin: 8em auto;
}

h1,
a {
display: inline;
background: var(--white);
padding: 0.25em 0.5em;
}
a {
background-color: var(--mint);
}
}

.cta {
margin-top: 1em;
}
35 changes: 35 additions & 0 deletions src/components/hero/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react'
import BackgroundImage from 'gatsby-background-image'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'

import styles from './hero.module.css'

const ExternalLink = ({ href, text }) => (
<a href={href} className="link" target="_blank" rel="noopener noreferrer">
{text}&nbsp;
<FontAwesomeIcon icon={faExternalLinkAlt} aria-hidden />
</a>
)

const Hero = ({ title, link, photo }) => (
<div className={styles.container}>
<BackgroundImage
Tag="section"
fluid={photo}
backgroundColor={`var(--mint)`}
alt={`${title} chapter photo`}
>
<div className={styles.overlay}>
<section className={styles.hero}>
<h1>{title}</h1>
<div className={styles.cta}>
<ExternalLink href={link} text="Join the meetup group" />
</div>
</section>
</div>
</BackgroundImage>
</div>
)

export default Hero
28 changes: 28 additions & 0 deletions src/components/organizers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react'

import styles from './organizers.module.css'

export const Organizer = ({ organizer }) => {
const person = organizer.node
return (
<figure className={styles.person}>
<img src={person.headshot} alt={`${person.name} headshot`} />
<figcaption>
<h3>{person.name}</h3>
<h4>{person.pronouns}</h4>
</figcaption>
</figure>
)
}

const Organizers = ({ organizers }) => (
<section className="container padding">
<h1 className="title">Meet the Organizers</h1>
<div className={styles.grid}>
{organizers.map(person => (
<Organizer organizer={person} />
))}
</div>
</section>
)
export default Organizers
30 changes: 30 additions & 0 deletions src/components/organizers/organizers.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.grid {
padding: 1em 0;
@media screen and (min-width: 20em) {
display: grid;
grid-column-gap: 2em;
grid-template-columns: 1fr 1fr 1fr;
}
@media screen and (min-width: 50em) {
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
}
}

.person {
margin: 0;
img {
width: 100%;
max-width: ;
}
figcaption {
font-weight: var(--bold);
}
h3 {
margin: 0;
}
h4 {
font-weight: var(--semi-bold);
margin-top: 0.25em;
font-size: 0.9em;
}
}
78 changes: 50 additions & 28 deletions src/components/sponsors/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,59 @@ import techbychoice from '../../../content/sponsors/techbychoice.json'
import brooklynjs from '../../../content/sponsors/brooklynjs.json'
import outintech from '../../../content/sponsors/out-in-tech.json'

const SponsorshipCTA = () => (
<div className={styles.background}>
<div className={styles.row}>
<div className={styles.info}>
<h1 className="title">Sponsorship</h1>
<h2 className="subtitle">Recruit talented, driven technologists.</h2>
<p>
Sponsorship is the most effective way to demonstrate your commitment
to the professional development of people with marginalized genders at
your organization.
</p>
</div>
<div className={styles.cta}>
<p>
Write/Speak/Code is a 501c3 nonprofit. Contact{' '}
<span className="italic">[email protected]</span> to learn
more.
</p>
<a
className="link"
target="_blank"
rel="noopener noreferrer"
href="https://drive.google.com/file/d/1X-nDSHYiPiPT79Rc1xUAZCNxvr67ei6J/view?usp=sharing"
>
2019 Sponsorship Prospectus
</a>
</div>
</div>
</div>
)

// Basic grid component for chapter pages
export const ChapterSponsors = ({ sponsors }) => (
<section>
<SponsorshipCTA />
<div className={styles.wrap}>
<section className={[styles['other'], styles.levelSection].join(' ')}>
<h3 className={styles.heading}>Chapter Sponsors</h3>
<div className={styles.grid}>
{sponsors.map(sponsor => (
<Sponsor company={sponsor.node} key={sponsor.id} />
))}
</div>
</section>
</div>
</section>
)

// Custom grid for homepage and conference page
const Sponsors = ({ sponsors, isConference }) => {
return (
<section id="sponsorship">
<div className={styles.background}>
<div className={styles.row}>
<div className={styles.info}>
<h1 className="title">Sponsorship</h1>
<h2 className="subtitle">
Recruit talented, driven technologists.
</h2>
<p>
Sponsorship is the most effective way to demonstrate your
commitment to the professional development of people with
marginalized genders at your organization.
</p>
</div>
<div className={styles.cta}>
<p>
Write/Speak/Code is a 501c3 nonprofit. Contact{' '}
<span className="italic">[email protected]</span> to
learn more.
</p>
<ExternalLink
href="https://drive.google.com/file/d/1X-nDSHYiPiPT79Rc1xUAZCNxvr67ei6J/view?usp=sharing"
text="2019 Sponsorship Prospectus"
icon="pdf"
/>
</div>
</div>
</div>

<SponsorshipCTA />
<div className={styles.wrap}>
<section
className={[styles['platinum'], styles.levelSection].join(' ')}
Expand Down
Binary file added src/images/chapters/seattle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/layouts/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ a {
color: inherit;
}

.container {
margin: 2em;
@media screen and (min-width: 90em) {
max-width: var(--container);
margin: 0 auto;
}
}

.padding {
padding: 1em 0;
@media screen and (min-width: 80em) {
padding: 3em 0;
}
}

.link {
display: inline;
border-bottom: 4px solid;
Expand Down
Loading