Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub


Based on the example documentation. Adds a new node field called ‘slug’ to gatsby-source-filesystem sourced data based on the filename.

This plug-in can be partnered up with gatsby-source-filesystem-markdown-name, a related plug-in which adds a new node field called “name” designed to filter on a directory referenced by gatsby-source-filesystem.


npm i gatsby-source-filesystem-markdown-slug


yarn add gatsby-source-filesystem-markdown-slug

Example gatsby-config.js

  plugins: [
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/src/content/posts/`,
        name: 'posts',

Example GraphQL Query

query MyQuery {
  allMarkdownRemark {
    edges {
      node {
        fields {
© 2023 Gatsby, Inc.