| Conditions | 4 |
| Paths | 3 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function generate(): void |
||
| 24 | { |
||
| 25 | $defaultpages = $this->config->get('defaultpages'); |
||
| 26 | |||
| 27 | // DEBUG |
||
| 28 | //var_dump($defaultpages); |
||
| 29 | //die(); |
||
| 30 | |||
| 31 | foreach ($defaultpages as $path => $frontmatter) { |
||
| 32 | if (isset($frontmatter['published']) && $frontmatter['published'] === false) { |
||
| 33 | continue; |
||
| 34 | } |
||
| 35 | $page = (new Page(Page::slugify($path))) |
||
| 36 | ->setPath(Page::slugify($path)) |
||
| 37 | ->setType(Type::PAGE); |
||
| 38 | $page->setVariables($frontmatter); |
||
| 39 | $this->generatedPages->add($page); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |