adding page generation with flat pages