Example #1
0
 public function generate(Page $page)
 {
     $parsedown = new Parsedown();
     $html = $parsedown->text($this->content);
     $layout = $page->getLayout();
     if (!$layout) {
         $layout = 'default';
     }
     $template = $this->blazon->getTwig()->loadTemplate('templates/' . $layout . '.html.twig');
     $site = $this->blazon->getSite();
     $data = ['content' => $html, 'site' => $site, 'page' => $page];
     $output = $template->render($data);
     file_put_contents($page->getBaseDir() . '/' . $page->getName() . '.html', $output);
 }