Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Data sources #46
Data sources can load data from certain locations like filesystem or database. Every data source must extends
Type of items:
data_sources: filesystem: class: 'Yosymfony\Spress\Core\DataSource\Filesystem\FilesystemDataSource' arguments: source_root: '%site_dir%/src' include: '%include%' exclude: '%exclude%' text_extensions: '%text_extensions%' attribute_syntax: '%attribute_syntax%'
This is the default configuration and is not necessary to modify your
Adds a custom data source from a plugin
Extends Spress with a new data source is straightforward:
$dsm = $environmentEvent->getDataSourceManager(); $dsm->addDataSource('dataSource-name', $yourDataSource);
Adds a custom data source from the config.yml file
You can also adds your own data source using
data_sources: myCustomDataSource: class: 'Class\of\myCustomDataSource' arguments: argument1: "your value"
Note: if you want hold the filesystem data source don't forget appear that.