Skip to content


This theme adds a data layer for on top of gatsby-theme-catalyst-core via component shadowing. This is used as a “core” theme for and is designed to be modified and shadowed itself in the final site. You can see an example of this theme stacked and further customized with gatsby-theme-catalyst-hydrogen.


Catalyzing Start

gatsby new catalyst-sanity

Theme Options

sanityProjectIdStringRequired, Sanity project ID
sanityDatasetStringDefaults to “production”, change to reflect the dataset name you are using in Sanity
sanityTokenStringDefaults to null, should only be used with env variables for security purposes.
sanityWatchModeBooleanDefaults to true, toggle for watch mode
sanityOverlayDraftsBooleanDefaults to false, toggle for live previews, a token and private dataset is required.
sanityCreatePagesBooleanDefaults to true, toggle to turn on/off page generation from
sanityCreatePostsBooleanDefaults to true, toggle to turn on/off blog post page generation from
sanityCreateCategoriesBooleanDefaults to true, toggle to turn on/off category page generation from
sanityCreatePostsListBooleanDefaults to true, toggle to turn on/off blog post list generation from
sanityCreateProjectsBooleanDefaults to true, toggle to turn on/off project page generation from
sanityCreateProjectsListBooleanDefaults to true, toggle to turn on/off project list generation from
sanityPostPathStringDefaults to “/posts”, is the path for before posts, e.g.
sanityPostListPathStringDefaults to “/posts”, is the path for the posts list, e.g.
sanityProjectPathStringDefaults to “/projects”, is the path for before projects, e.g.
sanityProjectListPathStringDefaults to “/projects”, is the path for the projects list page, e.g.
sanityPostListTitleStringDefaults to “Posts”, is title for the posts list page.
sanityProjectListTitleStringDefaults to “Projects”, is title for the projects list page.
sanityDisplayPostListTitleBooleanDefaults to true, toggle to turn on/off the post list
sanityDisplayProjectListTitleBooleanDefaults to true, toggle to turn on/off the project list

Sanity Studio

There is a custom sanity studio and data structure located in the starter. This studio should be used as a “base” studio and built on top of for custom content. You can use the desk structure to control whether certain actions are visible to the user or not - e.g. don’t want them to see the “Projects” folder, just hide it via the desk structure.

This is a compromised solution, it makes iterating and building a site with as the backend faster and easier - but it locks you in to a base set of data the themes require to successfully build. It is a tradeoff but one that is worth it for a lot of use cases.

Shadowed components

useSiteMetadata.js: This is heart of what allows this theme to function as this hook is used throughout all of the themes to source data like site title, logo, etc. Changing the source form gatsby-config to allows all of these components to be updated without having to actual change their code.

seo.js: This is shadowed to ensure that social images are sourced correctly.


There is quite a bit going on in gatsby-node.js to manage the createPages api from Gatsby. Theme options are used to conditionally build pages in the build process - this means that if you want a blog on your site the “infrastructure” is there in gatsby-node to create the pages but can be turned on/off based on whether you need this feature. This results in some warnings in the build process.

gatsby-node.js is also used to automatically create excerpts and reading time for both projects and posts, this relies on an extended base studio configuration as it looks for the “body” field to create the excerpts. This implementation is based on gatsby-transformer-portable-text.

Query components and template components

Queries and templates are separated to isolate visual components from data components. This is best practice in a Gatsby theme and means that in most cases you can just modify the visual layer through component shadowing and leave the data alone letting you concentrate on design.

These are located at src/components/queries/ and src/components/templates/.

You can see an example of this in use with gatsby-theme-catalyst-hydrogen.

© 2021 Gatsby Theme Catalyst