Add some logic to the index template to determine which links are shown when