change the pages object for array. Exposing pages data to the template engine