diff --git a/content/chapters/seattle.json b/content/chapters/seattle.json
index 53039508..73fdd5a6 100644
--- a/content/chapters/seattle.json
+++ b/content/chapters/seattle.json
@@ -1,3 +1,5 @@
{
- "city": "Seattle"
+ "city": "Seattle",
+ "photo": "chapters/seattle.jpg",
+ "meetup": "https://www.meetup.com/WSC-Seattle"
}
diff --git a/content/sponsors/climate-corporation.json b/content/sponsors/climate-corporation.json
index 1d9cf97e..9d96af14 100644
--- a/content/sponsors/climate-corporation.json
+++ b/content/sponsors/climate-corporation.json
@@ -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"
+ }
]
}
diff --git a/content/sponsors/glympse.json b/content/sponsors/glympse.json
index 87af9c64..53a120d4 100644
--- a/content/sponsors/glympse.json
+++ b/content/sponsors/glympse.json
@@ -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"
+ }
]
}
diff --git a/gatsby-node.js b/gatsby-node.js
index 0b9d094a..74a65e88 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -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
@@ -24,6 +43,18 @@ exports.createPages = ({ actions, graphql }) => {
}
}
}
+ allChaptersJson {
+ edges {
+ node {
+ id
+ city
+ photo
+ fields {
+ slug
+ }
+ }
+ }
+ }
}
`).then(result => {
if (result.errors) {
@@ -31,9 +62,10 @@ exports.createPages = ({ actions, graphql }) => {
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,
@@ -41,24 +73,25 @@ exports.createPages = ({ actions, graphql }) => {
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,
+ },
+ })
})
- }
+ })
}
diff --git a/src/components/header/index.js b/src/components/header/index.js
index 70b777ce..2c34fd2c 100644
--- a/src/components/header/index.js
+++ b/src/components/header/index.js
@@ -30,7 +30,6 @@ const Header = () => {
+ Sponsorship is the most effective way to demonstrate your commitment + to the professional development of people with marginalized genders at + your organization. +
++ Write/Speak/Code is a 501c3 nonprofit. Contact{' '} + sponsor@writespeakcode.com to learn + more. +
+ + 2019 Sponsorship Prospectus + +- Sponsorship is the most effective way to demonstrate your - commitment to the professional development of people with - marginalized genders at your organization. -
-- Write/Speak/Code is a 501c3 nonprofit. Contact{' '} - sponsor@writespeakcode.com to - learn more. -
-