johno
Projects

Gatsby Themes

Installable Gatsby features with components you can customize.

Three layered sheets with a different page layout on each.

One of my favorite parts of working on Gatsby Themes was a little Markdown list. In my documentation theme, that list was the sidebar. If you wanted your own navigation, you could put a sidebar.mdx file in your site at the path the theme looked for. You could read the whole navigation in one place and still get updates to the rest of the theme.

We called that file replacement shadowing. The tricky case was using the same documentation theme twice. Picture a monorepo with docs for two packages. Each needs its own sidebar, but both installations look for the same shadow file. Changing the navigation for one changes it for the other.

That example stuck with me because each copy of the theme worked perfectly well on its own. These days, when I’m thinking through how something can be customized, I like to put two copies on the page. It’s a cheap way to find the setting I accidentally made global.