Kirby ajaxed (quick and dirty)

This is great! thank you it works very well so far.

I’m having one issue however. Any idea how to get it to play nice with kirby’s routing options? It seems to ignore routing until the page is reloaded, that is, if the url was pushed via pjax in the first place.

I’m using the routing option from kirby’s documentation:

c::set('routes', array(
    array(
    'pattern' => '(:any)',
     'action'  => function($uid) {

       $page = page($uid);

       if(!$page) $page = page('blog/' . $uid);
       if(!$page) $page = site()->errorPage();

       return site()->visit($page);

     }
   ),
   array(
     'pattern' => 'blog/(:any)',
     'action'  => function($uid) {
       go($uid);
     }
   )
 ));

thanks!