• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    JavaScript
  • Created over 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Gatsby theme for creating documents with MDX and Theme UI.

Gatsby Theme Document

Welcome to Document, a Gatsby.js theme by Code Bushi. Quickly and easily create documentation for anything using MDX or Markdown.

👀 View the Live Demo

Getting Started

Using the Gatsby CLI

gatsby new document-site https://github.com/codebushi/gatsby-theme-document-example
cd document-site
gatsby develop

Your new site will be up at http://localhost:8000

Try changing the logo by editing the file at src/gatsby-theme-document/logo.mdx.

Adding Content

Document is built with MDX. Content can be added by creating or editing the MDX files in the content folder content/index.mdx.

With MDX, you can add JSX or even React components to your markdown files. Images can also be added to any .mdx file, and will be automatically optimized using gatsby-remark-images.

Left Sidebar

The left sidebar navigation is automatically populated by the pages in the content folder. To sort the top level navigation, edit the forcedNavOrder option in the gatsby-config.js file.

The logo will link to the index.mdx page. To make the index.mdx page visible in the left navigation, set ignoreIndex to false.

Sub navigation items are created by making a folder with the same name as the top level .mdx file. The sub navigation is ordered alphabetically.

Right Sidebar

The contents of the right sidebar will be automatically populated by any heading tags h1, h2, h3, etc. that are added to the page. They will anchor link to the corresponding heading.

Theme Colors

Document is also built with Theme UI. The icon in the top right of the site will cycle through the various color modes that are available.

To edit or add colors modes, edit the file at src/gatsby-plugin-theme-ui/colors.js. To learn more about color modes, check out the Theme UI docs.

The contents of the MDX files are also styled with Theme UI and can be edited at src/gatsby-plugin-theme-ui/index.js. The styles for the heading tags are found at src/gatsby-plugin-theme-ui/headingsjs. Learn more about styling MDX from the Theme UI docs.

Syntax Colors

Document uses @theme-ui/prism for syntax highlighting. Different presets can be used by editing the file at src/gatsby-plugin-theme-ui/index.js. The desired preset must be included at the top of the file and spread into the pre styles

import dracula from '@theme-ui/prism/presets/dracula.json';

styles: {
  pre: {
    ...dracula,
  }
}

The code blocks will not change color based on the color modes. For a complete list of all available prism presets, check out the Theme UI syntax themes.

Social Media Icons

The social media icons in the header can be edited in the gatsby-config.js file, under social. Currently, you can only add Twitter and Github links.

SEO, Site Image, and Manifest Icons

Document uses React Helmet to add meta tags to the website's <head> tag. When adding/editing a file in the content folder, be sure to include the Title and Description in the frontmatter. These are automatically used to generate the title and description meta tags for the page.

---
title: 'Document by Code Bushi'
description: 'This is the meta description'
---

There is also an image at src/site-image.jpg which is used for the Open Graph image tag, as well as the Twitter card. Another image at src/site-icon.png is used by the gatsby-plugin-manifest to generate a Favicon and other device icons.

Slugs

Because at them moment the theme queries all markdown nodes, and markdown nodes can come from various places, your slugs cannot be computed automatically if the source is not the file system. Therefore you'll need to define a slug key in the frontmatter of the article.

Other options or source restriction may be available in the future.

More Repositories

1

gatsby-starter-dimension

Gatsby.js V2 starter template based on Dimension, designed by HTML5 UP. Check out https://codebushi.com/gatsby-starters-and-themes/ for more Gatsby starters.
CSS
319
star
2

gatsby-starter-forty

Gatsby.js V2 starter template based on Forty, designed by HTML5 UP. Check out https://codebushi.com/gatsby-starters-and-themes/ for more Gatsby starters.
CSS
199
star
3

gatsby-starter-strata

Gatsby.js V2 starter template based on Strata, designed by HTML5 UP. Check out https://codebushi.com/gatsby-starters-and-themes/ for more Gatsby starters.
CSS
137
star
4

gatsby-starter-stellar

Gatsby.js V2 starter template based on Stellar. Check out https://codebushi.com/gatsby-starters-and-themes/ for more Gatsby starters.
CSS
136
star
5

gatsby-starter-lander

An experimental Gatsby Starter build using Tailwind CSS with a single page design.
JavaScript
133
star
6

nextjs-starter-dimension

Next.js static site starter based on the Dimension template.
CSS
108
star
7

nextjs-starter-forty

Next.js static site starter based on the Forty template.
CSS
60
star
8

gatsby-starter-photon

Gatsby.js V2 starter template based on Photon. Check out https://codebushi.com/gatsby-starters-and-themes/ for more Gatsby starters.
CSS
57
star
9

gatsby-starter-paradigm-shift

CSS
29
star
10

gatsby-global-state

Demo on adding Global State to Gatsby.js with React Context and useReducer
CSS
27
star
11

gatsby-theme-forty

CSS
17
star
12

gatsby-image-v2

Gatsby Image demo updated for Gatsby.js V2
CSS
13
star
13

gatsby-starter-dimension-codebushi

Gatsby.js V2 starter template based on Dimension by HTML5 UP. Check out https://codebushi.com/gatsby-starters/ for more Gatsby starters and templates.
CSS
10
star
14

gatsby-forms

CSS
9
star
15

gatsby-starter-forty-codebushi

Gatsby.js V2 starter template based on Forty by HTML5 UP. Check out https://codebushi.com/gatsby-starters/ for more Gatsby starters and templates.
CSS
7
star
16

custom-headroom

HTML
6
star
17

react-memo

Quick Demo for React.memo, useMemo, and useCallback
JavaScript
6
star
18

vuejs-chartjs-example

Vue.js and Chart.js example using Weather API
JavaScript
5
star
19

gatsby-starter-strata-codebushi

Gatsby.js V2 starter template based on Strata. Check out https://codebushi.com/gatsby-starters/ for more Gatsby starters and templates.
CSS
4
star
20

gatsby-theme-document-example

JavaScript
3
star
21

amp-site

HTML
2
star
22

gatsby-custom-source-plugin

We make a custom source plugin for Gatsby.js using the RAWG API
CSS
1
star
23

gatsby-theme-codebushi

JavaScript
1
star
24

graphql-anime

GraphQL + React tutorial
JavaScript
1
star
25

codebushi-v2

HTML
1
star
26

nextjs-starter

JavaScript
1
star