mxstbr / gatsby-theme-brain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gatsby Brain

Use this theme to integrate Roam Research inspired bidirectional linking of notes into a network on your site.

View a demo at https://twitter.com/aengusmcmillin/status/1249845320239984640

Installation

To use this theme in your Gatsby site:

  1. Install the theme
npm install --save @aengusm/gatsby-theme-brain
  1. Add the theme to your gatsby-config.js:
module.exports = {
  plugins: ['@aengusm/gatsby-theme-brain'],
};
  1. Add content to Your Brain by creating a content/brain/ folder in the root of your site and adding markdown files to it. Use [[This Format]] to generate pages and links between pages.

  2. Start your site:

gatsby develop

Styling

For now the way to style this theme is with component shadowing. There is a single component that renders the layout for each brain note in src/components/BrainNote.js. If you wish to shadow this and create your own version, create the file src/@aengusm/gatsby-theme-brain/components/BrainNote.js. That will shadow the existing component and you can do whatever you want with it.

If you want an example of how I shadow this, checkout my websites github

Usage

Option Default Value Description
notesDirectory "content/brain/" Directory containing your brain note files
noteTemplate "./templates/brain.js" Template to use for note rendering
rootPath "brain" Set the root url for the brain on your site (e.g. in this case https://example.com/brain)
rootNote "brain" Name of the 'index' note. So in this case brain.md would generate the root page of the brain
mdxOtherwiseConfigured false Used to workaround a bug in gatsby-plugin-mdx (see ChristopherBiscardi/gatsby-mdx#354). Set to true if you have already configured mdx

About


Languages

Language:JavaScript 100.0%