Can we change the order of the arguments, rename `data` to `permalink`.

I think we should also build the `resolveUrl` inside this function, instead of on line 59.