Gatsby Theme Golden Condor

docs / Configuration / Theme Options

Theme Options

Define options for layout and UI per-collection

1 minute read

Theme Options

Overview

The theme's options are defined in the plugin options just as with any other gatsby plugin.

In your gatsby-config.js file, add an options object to gatsby-theme-golden-condor.

gatsby-config.js
{
  resolve: `gatsby-theme-golden-condor`,
  options: {
   // ...
  }
}
 
gatsby-config.js
{
  resolve: `gatsby-theme-golden-condor`,
  options: {
   // ...
  }
}
 

Example

Here is the configuration for this site's doc collection type, resulting in the layout you see now.

gatsby-config.js
  {
    resolve: `gatsby-theme-golden-condor`,
    options: {
      collections: {
        doc: {
          showTOC: true,
          containerVariant: "container",
          sidebarNav: {
            heading: "Documentation"
          }
        }
      }
    }
  }
gatsby-config.js
  {
    resolve: `gatsby-theme-golden-condor`,
    options: {
      collections: {
        doc: {
          showTOC: true,
          containerVariant: "container",
          sidebarNav: {
            heading: "Documentation"
          }
        }
      }
    }
  }

Options table

OptionTypeDescriptionDefault
hideOnHomePageboolDon't query this collection in home page recent posts section.false (pages: true)
disableIndexPageboolRedirects the /[collectionName] index page to /.false (pages: true)
showRelatedPostsboolShows a grid of recent posts under posts in this collection.true (pages: false)
metaboolShow author, date, time to read, tags metadata on posts in this collection. Further configurable as an object.true (pages: false)
meta.authorboolSet to false to hide author on posts in this collection.true (pages: false)
meta.timeToReadboolSet to false to hide time to read on posts in this collection.true (pages: false)
meta.dateboolSet to false to hide date on posts in this collection.true (pages: false)
meta.tagsboolSet to false to hide tags on posts in this collection.true (pages: false)
showBreadcrumbsboolShow breadcrumbs on posts in this collection.true (pages: false)
showTOCboolShows Table Of Contents (h2 as parents + h3 as children).false
containerVariantstringWidth variant (theme.layout.[variant]) for container for posts in this collection.post (pages: container)
sidebarNavobjectShow left sidebar page navigation (via frontmatter.parent = id / frontmatter.id relationships you define.).undefined
sidebarNav.headingstringsidebarNav Heading text.undefined
sidebarNav.widthnumber or stringpixel width of sidebar.280

Options JSON

Hint: collectionName comes from the sourceInstanceName which is defined by gatsby-source-filesystem's options.name.

By default page and post collections are set up, but you can add your own.

{
  collections: {
    [collectionName]: {
      // hide this collection from 'recent posts' grid on home page
      hideOnHomePage: false
      // disable the /[collectionName]s index page
      disableIndexPage: false
      // shows a grid of recent posts under posts in this collection
      showRelatedPosts: true
      // show author/date metadata on posts in this collection
      meta: true
      // show breadcrumbs on posts in this collection
      showBreadcrumbs: true
      // shows Table Of Contents (h2 as parents + h3 as children)
      showTOC: true
      // width variant for container for posts in this collection.
      containerVariant: "post",
      // left sidebar page navigation (via frontmatter.parent = id / frontmatter.id relationships you define.)
      sidebarNav: {
        // sidebarNav Heading text
        heading: "Pages",
        // pixel width of sidebar (default: 280)
        width: 320
      },
    },
  },
}
{
  collections: {
    [collectionName]: {
      // hide this collection from 'recent posts' grid on home page
      hideOnHomePage: false
      // disable the /[collectionName]s index page
      disableIndexPage: false
      // shows a grid of recent posts under posts in this collection
      showRelatedPosts: true
      // show author/date metadata on posts in this collection
      meta: true
      // show breadcrumbs on posts in this collection
      showBreadcrumbs: true
      // shows Table Of Contents (h2 as parents + h3 as children)
      showTOC: true
      // width variant for container for posts in this collection.
      containerVariant: "post",
      // left sidebar page navigation (via frontmatter.parent = id / frontmatter.id relationships you define.)
      sidebarNav: {
        // sidebarNav Heading text
        heading: "Pages",
        // pixel width of sidebar (default: 280)
        width: 320
      },
    },
  },
}

Continue Reading

MDX Components

Syntax Highlighting

Sidebar

Navigation

Site Metadata

Gatsby Theme Golden Condor
  • About

© 2022 Ren Rizzolo

GithubTwitter