Add page_num to the environment so that templates can see and use it