Content Configuration
Driver and parser settings.
config/content.php controls content storage and parsing.
Driver selection #
| Driver |
Description |
file |
Markdown files with frontmatter |
db |
All content in database |
hybrid |
Metadata in DB, content in files |
auto |
Switches based on page count threshold |
Set via content.driver or CONTENT_DRIVER env variable.
Driver options #
File driver #
| Key |
Description |
content.drivers.file.path |
Content root (default: content_path('pages')) |
content.drivers.file.cache_enabled |
Enable file listing cache |
content.drivers.file.cache_ttl |
Cache lifetime in seconds (default: 600) |
DB driver #
| Key |
Description |
content.drivers.db.table |
Database table name (default: pages) |
content.drivers.db.cache_ttl |
Cache lifetime in seconds |
Hybrid driver #
| Key |
Description |
content.drivers.hybrid.content |
Content storage (file) |
content.drivers.hybrid.metadata |
Metadata storage (db) |
content.drivers.hybrid.cache_ttl |
Cache lifetime in seconds |
Auto driver #
| Key |
Description |
content.drivers.auto.threshold |
Page count to trigger switch (default: 100) |
content.drivers.auto.small_site |
Driver for small sites (default: file) |
content.drivers.auto.large_site |
Driver for large sites (default: hybrid) |
Parser selection #
| Driver |
Requirement |
Description |
commonmark |
league/commonmark |
Full CommonMark spec with extensions |
parsedown |
erusev/parsedown |
Fast Parsedown parser |
html |
- |
Pass-through (no parsing) |
Set via content.parser.driver or CONTENT_PARSER_DRIVER env variable.
CommonMark extensions #
'commonmark' => [
'html_input' => 'allow', // allow, strip, escape
'extensions' => [
'table' => true,
'strikethrough' => true,
'autolink' => true,
'task_lists' => true,
],
],
Parser caching #
content.parser.cache_ttl controls markdown cache lifetime in seconds (default: 600). Set to 0 to disable cache.