Skip to content

Commit

Permalink
[README] Add documentation on partials
Browse files Browse the repository at this point in the history
  • Loading branch information
charislam authored and Rajakavitha1 committed Jun 6, 2022
1 parent da4722b commit b76bf66
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,27 @@ rendered documentation site.
Programming language samples aside, most code blocks will usually be one of:
`bash`, `sql`, `json`.

### Partials

Partials allow you to reuse snippets of content in multiple places. All partials
live in the `_partials` top-level directory. To make a new partial, create a new
`.mdx` file. The filename must start with an underscore.

To insert the partial in another document, put an import statement in the
document. The import statement goes before the content and after any
frontmatter. For example:

`import Component from '../../../_partials/_partial-name.mdx';`

The path follows the site's directory structure, not the docs repo's
directory structure. You can determine the site's directory structure from the
page's URL. `Component` can be any CamelCased name. For consistency, make it
the CamelCased version of your partial's filename.

Where you need the partial to display, insert it as a self-closing tag:

`<Component />`

### General formatting conventions

To maintain consistency, please follow these general rules.
Expand Down

0 comments on commit b76bf66

Please sign in to comment.