Overview
This section describes the options that help customize your site.
The default options will create a site with all the features shown in this demo. You can turn off features such as the searchbar if you prefer. You can also turn off the table of contents and other features for individual posts.
Folder Structure
The src folder for your site contains your docs, pages, and assets (such as images).
All documentation files should be placed in the docsPath directory (default src/docs) defined in the theme options. These files will be displayed using the Doc template in @kabartolo/gatsby-theme-chicago-docs, with sidebar navigation, breadcrumb links, and previous/next navigation, as well as a table of contents. These features can be turned off for individual posts.
You can further organize your docs within the src/docs folder, such as src/docs/api and src/docs/tutorials. These nested folders can form groups of docs in the sidebar menu, or you can create separate sidebar menus for each nested folder.
Place assets such as images and your site logo in src/assets, or the assetsPath defined in the theme options.
The src/mdxPages directory, or the pagesPath defined in the theme options, contains the non-docs MDX pages on your site. Any MDX files in this folder will use the Page template, which has access to most Chicago Docs components (PostList and TOC will work only with Doc posts).
site└── src├── assets│ ├── chicago-docs-logo.png├── docs│ ├── api│ │ ├── index.mdx│ │ └── methods.mdx│ └── tutorials│ ├── index.mdx│ └── tutorial1.mdx├── mdxPages└── index.mdx└── pages└── 404.js
Site Metadata
Set your site's metadata in the gatsby-config.js file for your site. Some of these fields are used in the SEO component, which uses React Helmet to create your site's meta tags.
Metadata fields
optionalstringtitledefault:''(empty string)Used to set the meta title tag for your site. Also appears in the browser tab and next to the logo in the header.
optionalstringdescriptiondefault:''(empty string)Used to set the meta description tag for your site.
optionalstringsiteLanguagedefault:''(empty string)Used to set the meta language tag for your site.
optionalstringsiteLogodefault:''(empty string)Filename for your logo, which should live in
src/assets(or theassetsPaththeme option). This creates a logo that appears to the left of the site title with a fixed height of 30px. To customize the logo further, shadow the Logo component in@kabartolo/gatsby-theme-chicago-docs/src/components/Layout/Header/logo.js.
optionalstringsiteUrldefault:''(empty string)Used to set the canonical URL for your site.
optionalstringgithubUrldefault:''(empty string)Used to create a GitHub icon in the header that opens your GitHub project in a new tab.
module.exports = {siteMetadata: {title: 'Your Site Title',description: 'Brief description of your site and project',siteLanguage: 'en',siteLogo: 'logo.png',siteUrl: 'localhost:8000',githubUrl: `https://www.github.com/repository/your-project`,},};
The Chicago Docs Gatsby Starter also comes with gatsby-plugin-manifest. This plugin is also used to create your site's favicon. This plugin must also be configured in your gatsby-config.js file:
module.exports = {//...{resolve: 'gatsby-plugin-manifest',options: {name: 'Your Site Title',short_name: 'Shorter Title',start_url: '/',background_color: '#fff',theme_color: '#eee',display: 'standalone',icon: 'src/assets/favicon.ico', // creates a favicon},},};
Theme Options
Several theme options help you customize how your site behaves.
Theme options
optionalstringassetsPathdefault:'src/assets'Directory for all assets used in your site.
optionalstringbasePathdefault:''(empty string)Base path of your docs site, such as
/docs.
optionalstringbasePathLabeldefault:'Home'Label for base path in breadcrumb links.
optionalstringdocsPathdefault:'src/docs'Directory for all MDX docs for your site (i.e., MDX files that should use the Doc page component).
optionalstringpagesPathdefault:'src/mdxPages'Directory for your site's pages (i.e., MDX files that should use the Page page component).
optionalobject[]mainMenudefault:[]List of menu items that will appear in the header (see Configuration: Main Menu).
optionalobject[]sidebarMenusdefault:[]List of menus that will appear in the sidebar of your site (see Configuration: Sidebar Menu).
optionalbooleanallowDocsSearchdefault:trueWhether a search index is fully populated with MDX files from the
docsPathfolder. Set tofalseto use a different search strategy.
optionalbooleanalwaysShowBreadcrumbdefault:trueWhether breadcrumb links are always displayed at the top of each doc. Can be overridden by the
showBreadcrumbfrontmatter field for an individual doc.
optionalbooleanalwaysShowPostNavdefault:trueWhether to always show links to the previous and next docs at the bottom of a doc page. Can be overridden by the
showPostNavfrontmatter field for an individual doc.
optionalbooleanalwaysShowSidebardefault:trueWhether to always show the sidebar for docs. Can be overridden by the
showSidebarfrontmatter field for an individual doc.
optionalbooleanalwaysShowTOCdefault:trueWhether to always show the table of contents (TOC component) for each doc. Can be overridden by the
showTOCfrontmatter field for an individual doc.
optionalbooleanprimaryResultsOnlydefault:falseWhen searching, whether to show only only matches in the title, description, and/or header. If set to
false, will also show paragraph matches.
optionalbooleansidebarAllowMultipleOpendefault:trueWhether multiple accordion menus in the sidebar can be open at the same time.
optionalbooleansidebarAllowTOCdefault:trueWhether to show a dropdown table of contents for each doc in the sidebar.
optionalnumbersidebarDepthdefault:3Total depth of nested accordions to display in the sidebar (including table of contents).
optionalbooleanskipMDXConfigdefault:falseWhether to skip
gatsby-plugin-mdxconfiguration for the theme.
optionalbooleantoggleThemedefault:trueWhether a theme toggle button should be shown in the header.
module.exports = {plugins: [{resolve: '@kabartolo/gatsby-theme-chicago-docs',options: {docsPath: `{__dirname}/content/docs`,allowDocsSearch: false,alwaysShowTOC: false,sidebarAllowMultipleOpen: false,toggleTheme: false,}}]}
Frontmatter
The frontmatter fields for a Chicago Docs doc post include title and description values and boolean values that determine whether to display the table of contents or another feature for an individual post.
Frontmatter fields
optionalstringtitledefault: value ofshortTitleor 'Untitled'Title of the doc. Used in the meta title tag and appears at the top of the doc and in the browser tab.
optionalstringshortTitledefault:''(empty string)Shorter title used in place of the
titlefield in doc navigation (e.g., in the sidebar).
optionalstringdescriptiondefault:''(empty string)Description of the doc. Used in the search index and in the meta description tag for the page.
optionalbooleanshowBreadcrumbdefault: value ofalwaysShowBreadcrumbWhether the breadcrumb links appear at the top of this doc.
optionalbooleanshowPostNavdefault: value ofalwaysShowPostNavWhether links to the previous and next docs appear at the bottom of this doc.
optionalbooleanshowSidebardefault: value ofalwaysShowSidebarWhether the sidebar should appear for this doc.
optionalbooleanshowTOCdefault: value ofalwaysShowTOCWhether the standalone table of contents (the TOC component) should appear for this doc.
---title: Title for your docshortTitle: Alternate (shorter) title used in navigationdescription: Brief description of the doc (used in metadata and search index)showTOC: falseshowPostNav: false---## The first header should be an h2This doc will not show previous/next navigation or a table of contents since `showPostNav`and `showTOC` are set to `false`.