add a post and edit the index