Add deeply nested template links in environment