Brian Azizi
Ideal for Portfolios, Marketing Websites, Documentation and Blogs
e.g.
Speed Index (perceived speed): Avg time at which visible parts of the page are displayed
Time To Interactive (TTI): Time until page is considered minimally usable and will respond to user input
gatsby new hello-react-london
gatsby-source-filesystem
gatsby-transformer-remark
src/pages
createPages API in gatsby-node.js
Extend this subprocess
// gatsby-node.js
const path = require('path');
exports.createPages = ({ graphql, actions }) =>
new Promise((resolve, reject) => {
graphql(`
{
allMarkdownRemark {
edges {
node {
frontmatter {
path
}
}
}
}
}
`).then(result => {
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
actions.createPage({
path: node.frontmatter.path,
component: path.resolve('./src/templates/blog-post.js'),
});
});
resolve();
});
});Query all markdown files
Create a new page for each file
Specify path and React component
Brian Azizi