Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

Gatsby

The Gatsby blog theme

A Gatsby theme for creating a blog.

Installation

Use the blog theme starter

This will generate a new site that pre-configures use of the blog theme.

gatsby new my-themed-blog https://github.com/gatsbyjs/gatsby-starter-blog-theme

Manually add to your site

npm install --save gatsby-theme-blog

Usage

Theme options

Key Default value Description
basePath / Root url for all blog posts
contentPath /content/posts Location of blog posts
assetPath /content/assets Location of assets
mdx true Configure gatsby-plugin-mdx (if your website already is using the plugin pass false to turn this off)

Example usage

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-theme-blog`,
      options: {
        // basePath defaults to `/`
        basePath: `/blog`,
      },
    },
  ],
}

Additional configuration

In addition to the theme options, there are a handful of items you can customize via the siteMetadata object in your site’s gatsby-config.js

// gatsby-config.js
module.exports = {
  siteMetadata: {
    // Used for the site title and SEO
    title: `My Blog Title`,
    // Used to provide alt text for your avatar
    author: `My Name`,
    // Used for SEO
    description: `My site description...`,
    // Used for social links in the root footer
    social: [
      {
        name: `twitter`,
        url: `https://twitter.com/gatsbyjs`,
      },
      {
        name: `github`,
        url: `https://github.com/gatsbyjs`,
      },
    ],
  },
}
© 2023 Gatsby, Inc.