# Content Reuse

URL: /bengal/docs/build-sites/write/reuse/
Section: reuse
Description: Snippets, data files, and DRY patterns

---

> For a complete page index, fetch /bengal/llms.txt.

Write once, publish everywhere. Bengal provides multiple ways to avoid repeating yourself.

Note

Do I need this? Yes when the same block appears on multiple pages or you
pull shared data from YAML/JSON. Skip until you notice copy-paste across pages.

Content Snippets

Reusable content fragments with include directives

(/bengal/docs/build-sites/write/reuse/snippets/)

Advanced Filtering

Build dynamic pages that filter content by multiple tags or criteria

(/bengal/docs/build-sites/write/reuse/filtering/)

## Reuse Strategies

flowchart LR
subgraph "Single Source"
A[Snippet]
B[Data File]
C[Shortcode]
end

subgraph "Multiple Outputs"
D[Page 1]
E[Page 2]
F[Page 3]
end

A --> D
A --> E
B --> D
B --> F
C --> E
C --> F

## Quick Reference

- Snippets (#)

- Data Files (#)

- Filtering (#)

Reusable Markdown fragments stored in`_snippets/`:

```
_snippets/
├── install/
│   ├── pip.md
│   └── uv.md
└── warnings/
    └── experimental.md
```

Include in any page:

markdown
MARKDOWN

```
:::{include} _snippets/install/pip.md
:::
```

Structured YAML/JSON in`data/`:

yaml
YAML

```
# data/team.yaml
- name: Jane Doe
  role: Lead Developer
  github: janedoe
```
Access in templates:

kida
KIDA

```
{% for member in site.data.team %}
  {{ member.name }} - {{ member.role }}
{% end %}
```

Query content dynamically:

kida
KIDA

```
{# All tutorials #}
{% let tutorials = site.pages
   |> where('type', 'tutorial') %}

{# Recent posts #}
{% let recent = site.pages
   |> sort_by('date', reverse=true)
   |> take(5) %}
```

## When to Use What

Method
Best For
Example

Snippets
Repeated prose blocks
Installation instructions, warnings

Data Files
Structured data
Team members, product features

Filtering
Dynamic lists
Recent posts, related pages

Shortcodes
Parameterized components
Video embeds, API badges

Tip

Start with snippets for common content blocks. Graduate to data files when you need structured data, and filtering when you need dynamic queries.

## In This Section

Advanced Filtering (/bengal/docs/build-sites/write/reuse/filtering/)

Build dynamic pages that filter content by multiple tags or criteria

Content Snippets (/bengal/docs/build-sites/write/reuse/snippets/)

Reusable content fragments with include directives

Related Pages

Content Organization (/bengal/docs/build-sites/structure/organization/)

Pages, sections, and bundles explained

Related

Structure (/bengal/docs/build-sites/structure/)

Organize pages, collections, i18n, versioning, and site analysis

Related

Build Sites (/bengal/docs/build-sites/)

Write, structure, customize, and extend your Bengal site

Related

The Component Model (/bengal/docs/build-sites/structure/organization/component-model/)

Understanding Bengal's Component Model: Identity, Mode, and Data.

Related

Component Model Reference (/bengal/docs/build-sites/structure/organization/component-model-reference/)

Exhaustive type, variant, props, cascade, and skeleton examples for Bengal's component model

Related

persona-writer (/bengal/tags/persona-writer/)
