- If this is your first time installing the plugin as a submodule, please run
git submodule add https://github.com/paritytech/gatsby-plugin-substrate.git plugins/gatsby-plugin-substrate
Otherwise you can run the following command to update the local plugin
git submodule update --remote
or git submodule update --init
-
Add
"gatsby-plugin-substrate": "./plugins/gatsby-plugin-substrate"
as a dependency in yourpackage.json
-
Add the plugin in your
gatsby.config.js
module.exports = {
siteMetadata,
plugins: [
'gatsby-plugin-substrate',
...
]
}
- run
yarn
to install the local plugin
import { Icon, Link } from "gatsby-plugin-substrate";
If you encounter any problems when using the plugin, please try the following
- run
yarn clean
to delete gatsby cache - run
rm -rf node_modules
to remove your node modules - run
git submodule update --init --recursive
- run
git submodule update --remote
to pull the latest version of the plugin - run
yarn
to install the plugin
- Add the svg file to the
svg/raw
directory - run
yarn
- run
yarn svg
- You should now be able to import your svg from
svg/out
Notes:
- Running the svg script will remove any classes applied directly to the svg
- To add classes to the svg, you can pass the className's as a prop to the SVG React component produced when we run the svg script
e.g
<CloseIcon classNames="fill-current">
- Make changes to the plugin within this repo (open PR / merge etc.)
- Navigate to the substrate website or substrate docs repo
- Open a new branch
- Run the following command:
git submodule update --remote
to update to the most recent commit on the plugin.