generate pages using data from the db