Revert "Use public URL for documents instead of path"

This is broken, fixing in a branch.

This reverts commit 920d89c7b4389cd9b9fceb31ba435dea421d4346.