Write all links as absolute refs from the virtual root of the website's path namespace and then transform these into relative links with the resolveRefs utility function.