Sort posts in right order.
Fix reference links not working in index post preview.