Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
3,186 additions
and
13,395 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ['react', 'es2015', 'stage-1'], | ||
"plugins": ['add-module-exports'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,47 @@ | ||
module.exports = { | ||
siteMetadata: { | ||
title: 'Pav Sidhu', | ||
title: "Gatsby Starter Blog", | ||
author: "Kyle Mathews", | ||
}, | ||
plugins: ['gatsby-plugin-react-helmet'], | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-source-filesystem`, | ||
options: { | ||
path: `${__dirname}/src/pages`, | ||
name: "pages", | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-transformer-remark`, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-remark-images`, | ||
options: { | ||
maxWidth: 590, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-remark-responsive-iframe`, | ||
options: { | ||
wrapperStyle: `margin-bottom: 1.0725rem`, | ||
}, | ||
}, | ||
"gatsby-remark-prismjs", | ||
"gatsby-remark-copy-linked-files", | ||
"gatsby-remark-smartypants", | ||
], | ||
}, | ||
}, | ||
`gatsby-transformer-sharp`, | ||
`gatsby-plugin-sharp`, | ||
{ | ||
resolve: `gatsby-plugin-google-analytics`, | ||
options: { | ||
//trackingId: `ADD YOUR TRACKING ID HERE`, | ||
}, | ||
}, | ||
`gatsby-plugin-offline`, | ||
`gatsby-plugin-react-helmet`, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const _ = require("lodash") | ||
const Promise = require("bluebird") | ||
const path = require("path") | ||
const select = require(`unist-util-select`) | ||
const fs = require(`fs-extra`) | ||
|
||
exports.createPages = ({ graphql, boundActionCreators }) => { | ||
const { createPage } = boundActionCreators | ||
|
||
return new Promise((resolve, reject) => { | ||
const pages = [] | ||
const blogPost = path.resolve("./src/templates/blog-post.js") | ||
resolve( | ||
graphql( | ||
` | ||
{ | ||
allMarkdownRemark(limit: 1000) { | ||
edges { | ||
node { | ||
frontmatter { | ||
path | ||
} | ||
} | ||
} | ||
} | ||
} | ||
` | ||
).then(result => { | ||
if (result.errors) { | ||
console.log(result.errors) | ||
reject(result.errors) | ||
} | ||
|
||
// Create blog posts pages. | ||
_.each(result.data.allMarkdownRemark.edges, edge => { | ||
createPage({ | ||
path: edge.node.frontmatter.path, | ||
component: blogPost, | ||
context: { | ||
path: edge.node.frontmatter.path, | ||
}, | ||
}) | ||
}) | ||
}) | ||
) | ||
}) | ||
} |
Oops, something went wrong.