Skip to content

Commit

Permalink
Use gatsby-starter-blog-no-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
pavsidhu committed Mar 29, 2018
1 parent 74103ac commit 06f9184
Show file tree
Hide file tree
Showing 21 changed files with 3,186 additions and 13,395 deletions.
4 changes: 4 additions & 0 deletions .babelrc
@@ -0,0 +1,4 @@
{
"presets": ['react', 'es2015', 'stage-1'],
"plugins": ['add-module-exports']
}
45 changes: 43 additions & 2 deletions gatsby-config.js
@@ -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`,
],
}
47 changes: 47 additions & 0 deletions gatsby-node.js
@@ -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,
},
})
})
})
)
})
}

0 comments on commit 06f9184

Please sign in to comment.