public function render($vars = array())
{
// inject front matter options into template
$vars = array_merge_recursive($vars, $this->getParams());
// inject providers content
if ($providers = $this->getParam('page.providers', false)) {
$factory = new ProviderFactory();
foreach ($providers as $varname => $data) {
if (!isset($data['provider'])) {
continue;
}
$provider = $factory->create($data['provider'], $data);
$provider->setProjectPath($this->getInputRootDir());
$providedContent = $provider->get();
$vars['page']['providers'][$varname] = $providedContent;
$vars['this']['providers'][$varname] = $providedContent;
}
}
// convert view into static representation
$view = $this->getTemplate();
foreach ($this->getProcessors() as $processor) {
$view = $processor->render($view, $vars);
}
return $view;
}