Add basic post generation method

This commit is contained in:
Charlotte Allen 2020-01-27 17:13:09 -08:00
parent ac745e8f1e
commit 44d0da8f46
No known key found for this signature in database
GPG Key ID: 3A64C3A6C69860B0
2 changed files with 19 additions and 0 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ profiles.clj
/node_modules
/log
*.swp

View File

@ -0,0 +1,18 @@
(ns shapey-shifty.posts.core)
(defn create-empty-post [] {:type nil :properties {:name nil :author nil :published nil :content nil}})
(defn set-publish-date [post date]
(assoc-in post [:properties :published] date))
(defn set-type [post post-type]
(assoc post :type post-type))
(defn set-author [post author]
(assoc-in post [:properties :author] author))
(defn set-name [post post-name]
(assoc-in post [:properties :name] post-name))
(defn set-content [post post-content]
(assoc-in post [:properties :content] post-content))