src/Generator/Redirect.php
public function generate(PageCollection $pageCollection, \Closure $messageCallback)
    {
        $generatedPages = new PageCollection();

        $filteredPages = $pageCollection->filter(function (Page $page) {
            return null !== $page->getVariable('redirect');
        });

        /* @var $page Page */
        foreach ($filteredPages as $page) {
            $alteredPage = clone $page;
            $alteredPage->setLayout('redirect.html');
            $alteredPage->setVariable('destination', $page->getVariable('redirect'));
            $generatedPages->add($alteredPage);
        }

        return $generatedPages;
    }
public function generate(PageCollection $pageCollection, \Closure $messageCallback)
    {
        $generatedPages = new PageCollection();

        $filteredPages = $pageCollection->filter(function (Page $page) {
            return null !== $page->getVariable('redirect');
        });

        /* @var $page Page */
        foreach ($filteredPages as $page) {
            $alteredPage = clone $page;
            $alteredPage->setLayout('redirect.html');
            $alteredPage->setVariable('destination', $page->getVariable('redirect'));
            $generatedPages->add($alteredPage);
        }

        return $generatedPages;
    }
{@inheritdoc}