Make sure the right dir is in versions links that appear on search results pages

Fixes #150