diff --git a/cmd/frontend/articles.go b/cmd/frontend/articles.go index 42b842f..130016d 100644 --- a/cmd/frontend/articles.go +++ b/cmd/frontend/articles.go @@ -16,6 +16,12 @@ import ( b "streifling.com/jason/cpolis/cmd/backend" ) +type ArticlePreviewHtmlData struct { + Title string + Description string + Content template.HTML +} + func ShowHub(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { session, err := s.Get(r, "cookie") @@ -442,14 +448,8 @@ func UploadImage(c *b.Config) http.HandlerFunc { func PreviewArticle(c *b.Config, s *b.CookieStore) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - type htmlData struct { - Title string - Description string - Content template.HTML - } - var err error - data := new(htmlData) + data := new(ArticlePreviewHtmlData) data.Title, err = b.ConvertToPlain(r.PostFormValue("article-title")) if err != nil { diff --git a/cmd/main.go b/cmd/main.go index be4a78b..8e8c667 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -12,6 +12,7 @@ import ( func init() { gob.Register(b.User{}) + gob.Register(f.ArticlePreviewHtmlData{}) } func main() {