public function compile($output)
    {
        file_exists($output) || mkdir($output);

        $this->clear((string) $output);

        $this->output = (string) $output;

        foreach ((array) $this->pages as $page) {
            $folder = $this->folder($output, $page->uris());

            $html = (string) $this->html($page);

            $path = $this->realpath($output . '/' . $folder);

            file_put_contents($path . 'index.html', $html);
        }

        return $this;
    }