The steps to add new content types to this site.
When adding a new type of local content (e.g., blogs, lists, books, etc.), the pattern to do so is the following:
- Add the content as a directory in
./content
, e.g.,./content/blog
) - Add this to Gatsby in
./gatsby-config
using thegatsby-source-filesystem
plugin, e.g.:
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/content/blog`,
name: `blog`,
},
},
- Create a new section in the
.gatsby-node.js
query:
blog: allMarkdownRemark(
filter: {
fields: {
sourceInstance: { eq: "blog" }
}
}
) {
# data you want to query
}
- Exclude this new
sourceInstance
from the finalother
section:
other: allMarkdownRemark(
filter: {
fields: {
sourceInstance: {
nin: [..., "notes"]
}
}
}
) {
#...
}
- Optional: Add a new top-level page
If this type of data has it's own page, add it in
src/pages
- Optional: Add a new layout in
src/templates