def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
Retrieves all the posts(posts/drafts) from the given directory
 and add them to the site and sort them.

 dir - The String representing the directory to retrieve the posts from.

 Returns nothing.