Home

Awesome

gatsby-theme-andy

<p style="text-align:center;" align="center"> <img src="https://github.com/aravindballa/gatsby-theme-andy/raw/master/andy-logo.png" alt="theme andy logo" width="200" height="auto"/> <br/> <img alt="npm" src="https://img.shields.io/npm/v/gatsby-theme-andy"> </p>

This is inspired by the work of Andy and is based on gatsby-theme-brain. Also uses react-stacked-pages-hook for staking up the notes side by side. And unleashes the power of theme-ui for easy themeable components.

https://notes.aravindballa.com uses this with a few custom components and custom styles.

Getting started

⚠️ This theme requires alteast NodeJS v12. You can check your version by running node -v in your terminal. Know more

From scratch

Video tutorial 👇

click to watch

Link to the video

Adding to an exsisting Gatsby project

Detailed steps coming soon

Configuration

All the plugin options valid for gatsby-theme-brain can be given to this theme as well. Other than those, we have

OptionDefault ValueDescription
themeUIOtherwiseConfiguredfalseEnable this if you have already setup theme-ui in your project

Configuring the theme

This project uses theme-ui which allows us to easily theme the site. You can customize the theme by adding a file at .src/gatsby-theme-andy/theme.js. The default values for the theme are at src/theme.js. You can copy these to the new file you created and edit the values as you wish. 😎

<!-- TODO add example from notes.aravindballa.com after updating it -->

Shadowing components

You can shadow/override a few components for increased customizability. In your project, you would need to place them at ./src/gatsby-theme-andy/components/. ⚡️Have a look at the default components to see what props they get. Components you can override -

ComponentDescription
BrainNote.jsThis is the note page and it is responsible for collecting all the popups and passing them to the MdxComponents.js. It's really a cool way of doing it.
BrainNoteContainer.jsThis is the layout page that stacks up the notes side by side.
Popover.jsThe component that pops up when you hover over an internal link.
Header.jsThe top bar of the website. If you just want to change the text, you can do it in gatsby-config.js -> siteMetadata -> title.
Footer.jsFooter that contains the ReferredBlock as well as the message at the bottom of the note.
RefererdBlock.jsThe block which contains all the references (Referred in section) to the note.
Tippy.jsThis has the TippyJS configs. You can configure things like the hover animations here. Remember to change the css import as well.
MdxComponents.jsThis has a custom component AnchorTag which gets the popover as a prop and displays it when we hover over an internal link. If you wish to add extra MDX components, this is the place!

Contribution

This project is relatively new. Please report issues you face and yes, I'd be happy to accept PRs. 😉