---
title: Reusable content
description: Create shared Markdown snippets and include them across multiple pages to keep content consistent and maintainable.
tag: Writing
readtime: 5 min read
---
> For AI agents: the complete documentation index is at [llms.txt](https://docs.docslit.com/0.3/llms.txt). This page as Markdown: [writing-content/reusable-content.md](https://docs.docslit.com/0.3/writing-content/reusable-content.md).



<!-- BEGIN: Content from file docs/_reusables/page/reusable-content.md -->
# Reusable content

DocsLit supports reusable markdown fragments through compile-time includes. This keeps repeated setup steps and shared notices in one source of truth.

## Opinionated structure

Reusable files must live under `docs/_reusables/`.

```markdown
docs/
  getting-started/
    quickstart.md
  _reusables/
    shared/
      install-cli.md
    notices/
      support-policy.md
```

<wc-callout type="info" title="Strict by design">
Includes are intentionally limited to `docs/_reusables/**` to keep content architecture predictable for teams.
</wc-callout>

## Include syntax

Use the self-closing `wc-include` tag:

```markdown
<wc-include src="shared/install-cli.md" />
```

You can also use an absolute docs path:

```markdown
<wc-include src="/docs/_reusables/shared/install-cli.md" />
```

## Pass props to a snippet

Any attribute on `wc-include` other than `src` is a **prop**. It fills the matching `{{name}}` placeholder inside the snippet, so one snippet can serve several pages:

```markdown title="docs/_reusables/water.md"
Water your {{plant}} every {{interval}}.
```

```markdown
<wc-include src="water.md" plant="fern" interval="week" />
```

This renders as "Water your fern every week." Props are lowercase-friendly, so you do not need `UPPER_SNAKE_CASE` names inside reusable files. Page and global [variables](../writing-content/variables-and-precedence) still work inside snippets.

## Include rules

- only `.md` files can be included
- include targets must be under `docs/_reusables/**`
- include tags must be self-closing
- reusable files cannot include other files (no nested includes)

## Validation

Run validation before building:

```bash
docslit validate
```

Validation reports invalid include paths, nested include usage in reusable files, and undefined variables.

See [Variables and precedence](variables-and-precedence) for variable behavior and built-in version variables.
<!-- END: Content from file docs/_reusables/page/reusable-content.md -->

