Write once, publish everywhere. Bengal provides multiple ways to avoid repeating yourself.
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
Reusable Markdown fragments stored in_snippets/:
_snippets/
├── install/
│ ├── pip.md
│ └── uv.md
└── warnings/
└── experimental.md
Include in any page:
1 2 | |
Structured YAML/JSON indata/:
1 2 3 4 | |
Access in templates:
1 2 3 | |
Query content dynamically:
1 2 3 4 5 6 7 8 | |
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
Content Snippets
Reusable content fragments with include directives
Advanced Filtering
Build dynamic pages that filter content by multiple tags or criteria