Skip to content

gatsby-theme-catalyst-bery

This theme is for a personal blog and demonstrates tight integration with SANITY.io as the CMS and Gatsby as the frontend. It comes with a preconfigured content schema for SANITY.io and demonstration data you can import for a quick start. It features Seo optimization, social image sharing, RSS feed integration, and a clean design language that focuses on your content.

This is also an example of “ejecting” from using a preset header themes and building your own custom header to interact with the other Catalyst themes. The header used here is completely custom for this theme, and not one of the prebuilt options available.

Demos

Catalyzing Start

Because this theme and starter relies on a SANITY.io backend there are a few additional steps to get up and running.

Install the theme and starter

## Install the theme and starter
gatsby new bery https://github.com/ehowey/gatsby-starter-catalyst-bery
cd bery

Install SANITY.io

## Initiate a new SANITY project using their CLI
cd sanity-studio
sanity install
## Setup a new SANITY.io dataset
## Choose Yes to reconfigure the SANITY project
## Chose Yes to use the default dataset configuration
sanity init
## Import the placeholder data
## Import to the "production" dataset
cd data
sanity dataset import production.tar.gz
# Deploy the graphql schema
cd ..
sanity graphql deploy
# Start your studio on a localhost
sanity start

Update your gatsby-config

You need to update the sanityProjectId from SANITY.io so that the theme can properly source its data. You can find this at the top of the file sanity-studio/sanity.json.

Update your gatsby-config.js:

{
resolve: `gatsby-theme-catalyst-bery`,
options: {
sanityProjectId: `c1x70rzt`, // Change this line
},
},

Run gatsby develop

Open a new terminal window and run gatsby develop in the root directory. Your site will build in watch mode with real time previews hot reloaded from SANITY.io! With both SANITY and Gatsby running at the same time you can make edits in your SANITY.io backend and immediately see those updates on your site.

Theme options

Bery accepts all options from the core theme and sanity theme directly, e.g. you can set useColorMode via gatsby-theme-catalyst-bery and it is passed down to the correct theme appropriately. Note that because of the custom header component and the theme design some theme options may not work as expected - e.g. the site title and avatar image are not optional as they hardcoded into the custom header. This theme was built with a more singluar design and is best modified via component shadowing if needed.

For example the following config is valid:

{
resolve: `gatsby-theme-catalyst-bery`,
options: {
sanityProjectId: `4w5ygwpy`, // Required
sanityPostListTitle: "Posts",
rssTitle: "My Great Blog",
rssDescription: "A little description of who I am and why I am great.",
// Defaults
// sanityPostPath: `/posts`,
// footerContentLocation: "center",
// sanityPostListTitle: "Blog",
// sanityPostListPath: `/`,
},
},

Bery Options

OptionValuesDescription
rssTitleStringSet the RSS title for your feed.
rssDescriptionStringSet the RSS description for your feed.
useHeaderSocialLinksBooleanDefaults to true, controls the visibility of social links in header.
useColorModeBooleanDefaults to true, controls the visibility of dark mode toggle.

Sanity Theme Options

OptionValuesDescription
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 SANITY.io.
sanityCreatePostsBooleanDefaults to true, toggle to turn on/off blog post page generation from SANITY.io.
sanityCreateCategoriesBooleanDefaults to true, toggle to turn on/off category page generation from SANITY.io.
sanityCreatePostsListBooleanDefaults to true, toggle to turn on/off blog post list generation from SANITY.io.
sanityCreateProjectsBooleanDefaults to true, toggle to turn on/off project page generation from SANITY.io.
sanityCreateProjectsListBooleanDefaults to true, toggle to turn on/off project list generation from SANITY.io.
sanityPostPathStringDefaults to “/posts”, is the path for before posts, e.g. site.com/posts/post-1.
sanityPostListPathStringDefaults to “/posts”, is the path for the posts list, e.g. site.com/posts/.
sanityProjectPathStringDefaults to “/projects”, is the path for before projects, e.g. site.com/projects/post-1.
sanityProjectListPathStringDefaults to “/projects”, is the path for the projects list page, e.g. site.com/projects/.
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 title.io.
sanityDisplayProjectListTitleBooleanDefaults to true, toggle to turn on/off the project list title.io.

Core Theme Options

OptionValuesDescription
contentPathStringDefaults to “content/pages”, determines where the pages are created from.
assetPathStringDefaults to “content/assets”, determines where the page assets like images are located.
remarkImagesWidthInteger valueDefaults to 1440, allows you to customize the image width option for gatsby-remarks-images.
imageQualityInteger valueDefaults to 50, allows you to customize the image quality on a scale of 0 - 100.
useAlertBannerBooleanDefaults to false, toggles the display of an alert banner across the top of the page.
OptionValuesDescription
useFooterSocialLinkstrue or falseDefaults to true, controls whether the social links are displayed or not
footerContentLocationString value, “left”, “right” or “center”Defaults to “left”, determines the location of the footer content.

Variants

To be implemented in a future release.

© 2021 Gatsby Theme Catalyst