src/Step/RenderPages.php
public function process()
    {
        // prepares renderer
        $this->phpoole->setRenderer(new Twig($this->getAllLayoutsPaths(), $this->config));

        // add globals variables
        $this->addGlobals();

        call_user_func_array($this->phpoole->getMessageCb(), ['RENDER', 'Rendering pages']);

        // collect published pages
        /* @var $page Page */
        $filteredPages = $this->phpoole->getPages()->filter(function (Page $page) {
            return !empty($page->getVariable('published'));
        });
        $max = count($filteredPages);

        // render each page
        $count = 0;
        foreach ($filteredPages as $page) {
            $count++;

            $rendered = $this->phpoole->getRenderer()->render(
                $layout = (new Layout())->finder($page, $this->config),
                ['page' => $page]
            );
            $page->setVariable('rendered', $rendered);
            $this->phpoole->getPages()->replace($page->getId(), $page);

            $message = sprintf('%s (%s)', ($page->getPathname() ?: 'index'), $layout);
            call_user_func_array($this->phpoole->getMessageCb(), ['RENDER_PROGRESS', $message, $count, $max]);
        }
    }
public function process()
    {
        // prepares renderer
        $this->phpoole->setRenderer(new Twig($this->getAllLayoutsPaths(), $this->config));

        // add globals variables
        $this->addGlobals();

        call_user_func_array($this->phpoole->getMessageCb(), ['RENDER', 'Rendering pages']);

        // collect published pages
        /* @var $page Page */
        $filteredPages = $this->phpoole->getPages()->filter(function (Page $page) {
            return !empty($page->getVariable('published'));
        });
        $max = count($filteredPages);

        // render each page
        $count = 0;
        foreach ($filteredPages as $page) {
            $count++;

            $rendered = $this->phpoole->getRenderer()->render(
                $layout = (new Layout())->finder($page, $this->config),
                ['page' => $page]
            );
            $page->setVariable('rendered', $rendered);
            $this->phpoole->getPages()->replace($page->getId(), $page);

            $message = sprintf('%s (%s)', ($page->getPathname() ?: 'index'), $layout);
            call_user_func_array($this->phpoole->getMessageCb(), ['RENDER_PROGRESS', $message, $count, $max]);
        }
    }
{@inheritdoc}

@throws Exception