Gatsby makes use of various plugins for building static sites. Here we will install gatsby-source-filesystem
and gatsby-transformer-remark
to work with locally stored Markdown files.
Instructor: In order to have Gatsby convert our markdown into our site, we're going to need to install a couple of plugins. Let's do NPMinstall--save gatsby-source-filesystem@next and gatsby-transformer-remark@next.
Once that's installed, we're going to create a new file called gatsby-config.JS, which contains some configuration for Gatsby in a J.S. file. We'll do module.exports. We'll provide a site metadata key, give it a title of my blog, and description of, this is my cool blog.
Now that we have the site metadata object created, we'll add an array of plugins. First, we'll do gatsby-transformer-remark. Now we'll use an object because we're going to need to pass some options.
We'll resolve our plugin gatsby-source-filesystem. Then it can take an options object with a name. We'll call it pages. Its path will be in our current directory, so we'll do a string template with double underscore dirname/SRC/pages.
I found that the gatsby commands needed to be ran separately: npm install --save gatsby-source-filesystem@next npm install --save gatsby-transformer-remark@next
When I tried to run as npm install --save gatsby-source-filesystem@next gatsby-transformer-remark@next it threw a 404 on the last source
I found it hard to focus on the code text with those editor crosshairs
Hi Rion, I've removed this from my vimrc so they won't show up in future videos.
I think @next isn't needed anymore.
With @next: "gatsby-source-filesystem": "^2.0.1-rc.6", "gatsby-transformer-remark": "^2.1.1-rc.5",
Without @next: "gatsby-source-filesystem": "^2.0.12", "gatsby-transformer-remark": "^2.1.15",
gatsby-config.js
is now created automatically when the project folder is initialized.