- Layout imported in every page instead of gatsby-browser.js
- No Instagram Component
- Base - Gatsby Hello World
- Components + Imports - ready
- main.css + styled components
- constants (different setup)
- Complete React Components for MDX
- Home Page
- Navbar
- Sidebar
- Hero
- Footer
- Error Page
- Newsletter
<form
className="contact-form"
name="contact"
method="post"
netlify-honeypot="bot-field"
data-netlify="true"
action="/success"
>
<input type="hidden" name="bot-field" />
<input type="hidden" name="form-name" value="contact" />
</form>
- Success Page (optional);
- Install mdx plugin
- Add
gatsby-plugin-mdx
to gatsby-config - Setup Page - pageName.mdx /pages
- Basic Markdown Syntax Highlighting - MDX EXTENSION
- Basic Styling
- Add React Components including Gatsby Link
- New Line Gotcha
- Setup Posts Folder
- Add New filesystem Instance to gatsby-config
{
resolve: `gatsby-source-filesystem`,
options: {
name: `posts`,
path: `${__dirname}/src/posts`,
},
},
- Create a Brand New Folder For Post Won't Query Name - setup is up to you
- Add mdx file
- DOUBLE CHECK PATHS (../../ - gotcha)
- Run 'gatsby clean' - just to be on the safe side
- Seperate Images Folder
- FrontMatter (space gotcha - title: first post)
- Imports after FrontMatter
- Setup Query with unique value (most likely slug)
- Setup Template
- Run Query in gatsby-node.js - just like normal setup
- Pass Variable (slug)
- Run Query in Template using variable (slug)
- Repeat the same steps as posts just for categories.
-
Syntax - ![](./pathToImages/imageName - if in the same folder)
-
Install - gatsby-transformer-remark
-
Changes in gatsby config
remove - 'gatsby-plugin-mdx' add
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [{ resolve: "gatsby-remark-images" }],
},
},
- Restart the server
- Whitespace gotchas and "gatsby clean"
- Styling - Good Luck!
[Gatsby Video Reference] : https://www.gatsbyjs.org/docs/working-with-video/
- The same as regular video
- autoPlay - gotcha
- use like regular component
- Gatsby Docs
- Gotchas - url, styling
- Use in template - johnsmilga.com
- Gatsby wrapRootElement [Wrap Root Element ] : https://www.gatsbyjs.org/docs/browser-apis/#wrapRootElement
- MDX [MDX Reference] : https://mdxjs.com/getting-started
- Gatsby/MDX Reference [ Elements Reference] : https://www.gatsbyjs.org/docs/mdx/customizing-components/
npm install --save prism-react-renderer
- our code - props.children.props.children.trim()
- language - props.children.props.className className.replace(/language-/,'')
- theme