updated chapters haml to dynamically generate links and references