adds publish function, moving drafts to posts directory