for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* Copyright (c) Arnaud Ligny <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cecil\Generator;
use Cecil\Collection\Page\Page;
use Cecil\Collection\Page\Type;
use Cecil\Exception\Exception;
/**
* Class DefaultPages.
class DefaultPages extends AbstractGenerator implements GeneratorInterface
{
* {@inheritdoc}
public function generate(): void
$defaultpages = $this->config->get('defaultpages');
// DEBUG
//var_dump($defaultpages);
//die();
foreach ($defaultpages as $path => $frontmatter) {
if (isset($frontmatter['published']) && $frontmatter['published'] === false) {
continue;
}
$page = (new Page(Page::slugify($path)))
->setPath(Page::slugify($path))
->setType(Type::PAGE);
$page->setVariables($frontmatter);
$this->generatedPages->add($page);