Important note: Guitar book always must have at least one .md and mdx file to build successfully.
Important note: To build successfully project with gatsby-theme-guitar-book plugin you must init git in project and publish it with some provider (it can be private repo and no matter which provider).
- Clone guitar-book repository
- Copy whole
template
directory from apps/template into a new project - Setup
gatsby-config.js
based on Instruction - Test guitar book locally: (inside template directory)
yarn install
- Install dependenciesyarn dev
- Start app (It will open app in your default browser)
- Deploy guitar book on Netlify:
- In Netlify dashboard create a new site from Git.
- Connect to Git Provider. (Choose Github)
- Pick the project where your new guitar book is located.
- Set build settings:
- Branch to deploy:
master
- Build command:
yarn build
- Publish directory:
public/
- Branch to deploy:
- Press
Deploy site
- Set Site name : (Navigate to: Settings --> General --> Site details --> Press Change site name)
- Deploy site:
- Navigate to Deploys section and press
Trigger deploy --> Deploy site
. - After previous step, app should be deployed under link(green) placed in top of netlify dashboard.
- Navigate to Deploys section and press
- Add information about new guitar book into your project main README.
-
Copy the table below to the root project README.md (Copy form code view).
Module Status Public URL Guitar Book <BADGE_LINK_FROM_NETLIFY> <LINK_TO_APP> -
Add status badge (Navigate in Netlify to: Settings --> General --> Status badges).
- Copy link from netlify and paste into copied table (In Status column).
-
Add public link to deployed app.
-
Important note: Remember that app must always have at least one .md and mdx file to build successfully.
Important note: Changes to the markdown source does not result in an automatic "hot reload" in the browser; it is necessary to reload the page manually in the browser to see it re-rendered. Additionally, changes in
gatsby_config.js
require stopping the server and restarting withyarn start
again
Note: Due problems with running app locally sometimes removing
.cache
and.public
directories can solve the problem.
Add your mdx file example.mdx
into ./content
directory
then add the filename to the sidebarCategories
configuration field in gatsby-config.js
.
To add a section in the sidebar, create a folder in ./content
, add the mdx files there add configuration gatsby-config.js
.
---
title: Hallelujah
description: Jeff Buckley
ytLink: https://www.youtube.com/watch?v=y8AWFf7EAc4
---
import { Verse } from 'gatsby-theme-guitar-book';
<Verse text={`
[Intro]
C Am C Am
\n
[Verse 1]
C Am
I heard there was a secret chord
C Am
That David played and it pleased the lord
F G C G
But you don't really care for music, do you?
C F G
Well it goes like this the fourth, the fifth
Am F
The minor fall and the major lift
G E7 Am
The baffled king composing hallelujah
\n
[Chorus]
F Am F C G C
Hallelujah, hallelujah, hallelujah, hallelu-u-u-u-jah ....
`}/>
Page URLs will be derived from the file paths of your Markdown. You can nest Markdown files within directories to create pages with additional path segments. You can overwrite this default path by adding a slug
field to your Markdown frontmatter header.
root/
gatsby.config.js
content/
example1.mdx
section1/
example2.mdx
// ./gatsby-config.js
...
sidebarCategories: {
null: [
'example1',
],
'Section 1 Title': [
'section1/example2',
]
}
...
MDX is an authorable format that lets you seamlessly use JSX in your markdown documents. You can import components and export metadata.
Note: Every .md files can transform into .mdx but, not the other way around.
// ./content/exampleCustomButton.mdx
---
title: Example Custom Button
description: Building a simple application
---
import CustomButton from '../../src/components/CustomButton';
<CustomButton color='primary'>Custom Button with props</CustomButton>
To make any style changes navigate to gatsby-theme-guitar-book package. You can customize app using this theme further by taking advantage of component shadowing.
Every imported file/component in new app must be declared with the same name, directory structure and component export type as in theme package based on gatsby component shadowing approach.
For editing layout components navigate to components directory.
For editing global styles navigate to styles directory.
For changes with site colors navigate to colors.js