compute this link here--it's too messy to do it in mako