Made pages list links (broken for now
Moved sidebar generation into its own function