fixup root refs in templates/links