JSON of all pages

Actually, it wasn’t enough. The index page is missing. I have solved it like this, unless there is a better way?

c::set('routes', array(
  array(
    'pattern' => 'uncss.json',
    'action'  => function() {
      header('Content-type: application/json; charset=utf-8');
      $pages = site()->index()->visible();
      $root = site()->find('home');
      $json = array();
      $json[] =  (string)$root->url();

      foreach ($pages as $page) {
          $json[] = (string)$page->url();
      }
      echo json_encode($json);
    }
  )
));

Well, thats lovely :slight_smile: Congratulations. :tropical_drink: