The Filesystem
We'll look at how our project folder can serve as a data source for Gatsby.
We'll cover the following...
One of the best features of Gatsby is its “data-from-anywhere” capability. With Gatsby, we can have and fetch data hosted anywhere—CMS, private and public APIs, and even our local project files.
Working with data
Let’s look at how we can store and fetch data in folders and files in our project using two examples: — Images and Markdown.
Images
Already, we have images that are “hosted” in our project’s src/images
folder. We have often built queries to fetch and display them in the application. We can choose to have other kinds of assets and contents in our project like this. This is made possible by one plugin: gatsby-source-filesystem
. This plugin goes into the directories we specify as data sources and fetches the data for us. This plugin always goes with other plugins that help convert the sourced data to a format that Gatsby can process and ...