func savePostHandler2(ren render.Render, r *http.Request) {
	id := r.FormValue("id")
	title := r.FormValue("title")
	contentMarkdown := r.FormValue("content")
	contentHtml := utils.ConvertMarkdownToHtml(contentMarkdown)

	postDocument := models.PostDocument{id, title, contentHtml, contentMarkdown}

	if id != "" {
		postsCollection.UpdateId(id, postDocument)
	} else {
		id := utils.GeneratId()
		postDocument.Id = id
		postsCollection.Insert(postDocument)
	}

	ren.Redirect("/")
}
func savePostHandler(w http.ResponseWriter, r *http.Request) {
	id := r.FormValue("id")
	title := r.FormValue("title")
	content := r.FormValue("content")

	var post *models.Post

	if id != "" {
		post = posts[id]
		post.Title = title
		post.Content = content
	} else {
		id := utils.GeneratId()
		post := models.NewPost(id, title, content)
		posts[post.Id] = post
	}

	http.Redirect(w, r, "/", 302)
}
func savePostHandler1(ren render.Render, r *http.Request) {
	id := r.FormValue("id")
	title := r.FormValue("title")
	contentMarkdown := r.FormValue("content")
	contentHtml := utils.ConvertMarkdownToHtml(contentMarkdown)

	var post *models.PostMD

	if id != "" {
		post = postsMD[id]
		post.Title = title
		post.ContentHtml = contentHtml
		post.ContentMarkdown = contentMarkdown
	} else {
		id := utils.GeneratId()
		post := models.NewPostMD(id, title, contentHtml, contentMarkdown)
		postsMD[post.Id] = post
	}

	ren.Redirect("/")
}