1.9.0 • Published 3 months ago

gatsby-theme-fast-ai-sidebar v1.9.0

Weekly downloads
12
License
MIT
Repository
github
Last release
3 months ago

Quick Start

mkdir my-site
cd my-site
yarn init
# install gatsby-theme and it's dependencies
yarn add gatsby react react-dom gatsby-theme-fast-ai-sidebar

Then add the theme to your gatsby-config.js. We'll use the long form here for education purposes.

module.exports = {
	siteMetadata,
	plugins: [
		{
			resolve: 'gatsby-theme-fast-ai-sidebar',
			options: {
				docsPath: `${__dirname}/content/docs`,
				intlOptions: {
					languages: ['en', 'cs'],
					path: `${__dirname}/src/intl`,
					defaultLanguage: 'cs',
				},
				siteMetadata: {
					author: 'Jerry Lundegaard',
					description: 'Beautiful site',
					title: 'FastAI Docs examples',
				}
			},
		},
	],
};

That's it, you can now run your gatsby site using

yarn gatsby develop

Note that this site doesn't do anything, so you're see a missing resources error. Create a simple page in src/pages/index.js to see a page on the root url.

import React from 'react';
import { Page, Seo } from 'gatsby-theme-fast-ai-sidebar';
import { Heading } from '@fast-ai/ui-components';

const Index = (props) => (
	<Page {...props}>
		<Seo title="Home" />

		<Heading>Welcome</Heading>
	</Page>
);

export default Index;

Options

docsPath

  • Path to your MDX files

intlOptions

siteMetadata

  • title - Page title
  • author - SEO metadata
  • description - SEO metadata

MDX pages

  • Your mdx file should be located in docsPath.
  • The URL path of the page is created via createFilePath

Frontmatter

You can add metadata to your page via frontmatter properties, e.g.:

---
title: 'Introduction'
description: 'SEO description'
---
  • title: string - heading of the page - H1
  • description: string - meta description
  • disableTableOfContents: boolean - completely disable Table of Contents
  • fullWidth: boolean - content has 100% width - sidebar navigation is hidden - header is not floating (unless mobile resolution)
  • tableOfContentsDepth: boolean - how many heading levels deep should Table of Contents go
  • disableBreadcrumbs: boolean - hide breadcrumbs

Links

Rewrite the ./link.js file to determine page hierarchy.

module.exports = [{
		root: true ,
		label: "Label shown in Navigation",
		to: "/path/to/page",
		children: [
			// list of descendants
		]
	}, 
	{
	// ...
	}
]
  • root: boolean - If true the navigation of the site will treat this page as the navigation root for the child pages. - You can have more root pages nested inside each other.
  • label: node - Label of the page
  • to: string - route must start with "/" and can't end with "/"
  • children: arrayPage - nested pages

See our related projects

License

All packages are distributed under the MIT license. See the license here.

© 2021 Lundegaard a.s.

1.9.0

3 months ago

1.8.0

2 years ago

1.6.2

2 years ago

1.6.1

2 years ago

1.6.0

2 years ago

1.7.0

2 years ago

1.5.1

2 years ago

1.7.1-alpha.7

2 years ago

1.5.0

2 years ago

1.7.1-alpha.5

2 years ago

1.8.0-alpha.2

2 years ago

1.8.0-alpha.0

2 years ago

1.8.0-alpha.1

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.29.1

3 years ago

0.29.0

3 years ago

0.28.1

3 years ago

0.28.0

3 years ago

0.27.6

3 years ago

0.27.5

4 years ago

0.27.4

4 years ago

0.27.2

4 years ago

0.27.3

4 years ago

0.27.1

4 years ago

0.27.0

4 years ago

0.26.0

4 years ago

0.25.0

4 years ago

0.24.0

4 years ago

0.23.1

4 years ago

0.23.0

4 years ago

0.22.7

4 years ago

0.22.6

4 years ago

0.22.5

4 years ago

0.22.4

4 years ago

0.22.3

4 years ago

0.22.2

4 years ago

0.22.1

4 years ago

0.22.0

4 years ago

0.21.1

4 years ago

0.21.0

4 years ago

0.20.0

4 years ago

0.19.0

4 years ago

0.17.2

4 years ago

0.18.0

4 years ago

0.17.1

4 years ago

0.17.0

4 years ago

0.16.0

4 years ago

0.15.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.1

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago