public function page()
    {
        $page = Page::html();
        $listings = $this->config('blog', 'listings');
        if ($page->url['format'] != 'html') {
            $file = (preg_match('/\.(txt|json|xml|rdf|rss|atom)$/', $page->url['path'])) ? $this->folder.'content/'.$page->url['path'].'.twig' : null;

            return (is_file($file)) ? trim($this->theme->renderTwig($file)) : false;
        } elseif ($id = $this->file($page->url['path'])) {
            $params = array('id' => $id, 'path' => $page->url['path']);
            $method = 'blog';
        } elseif ($route = $page->routes(array(
            $listings,
            $listings.'/[archives:path]/[i:year]?/[i:month]?/[i:day]?',
            $listings.'/[authors|tags:path]/[:name]?',
            '[**:category]',
        ))) {
            $params = $route['params'];
            $method = (isset($params['path'])) ? $params['path'] : 'listings';
            if ($method == 'listings' && $search = $page->request->query->get('search')) {
                $params['search'] = $search;
            }
        }
        if (!isset($method) || (isset($params['category']) && !is_dir($this->folder.'content/'.$params['category']))) {
            $template = false;
        } elseif ($template = $this->$method($params)) {
            $template = array_combine(array('file', 'type', 'vars'), $template);
            $template['default'] = __DIR__.'/templates/';
            $this->theme->vars['blog']->properties['page'] = $template['type'];
        }

        return $template;
    }