Resolve internal document references using url_for