                         ["eve@polyc0l0r.net"
                          #uuid "b09d8708-352b-4a71-a845-5f838af04116"
                          "master"]
-                        [{:db/id post-id
-                          :title (apply str (take 10 text))
-                          :detail-url (first urls)
-                          :detail-text text
-                          :user user
-                          :ts ts}]
+                        (concat [{:db/id post-id
+                                  :title (str (apply str (take 40 text)) "...")
+                                  :detail-url (first urls)
+                                  :detail-text  text
+                                  :user user
+                                  :ts ts}]
+                                (map (fn [t] {:db/id (uuid)
+                                             :post post-id
+                                             :tag (keyword t)
+                                             :ts ts}) hash-tags))
                         '(fn [old params]
                            (:db-after (d/transact old params)))))
         (<! (s/commit! stage


(def url-regexp #"(https?|ftp)://[a-z0-9-]+(\.[a-z0-9-]+)+(/[\w-]+)*(/[\w-\.]+)*")

(defn add-post [stage e]
  (let [post-id (uuid)
        ts (js/Date.)
        text (dom/value (dom/by-id "general-input-form"))
        urls (->> text
                  (re-seq url-regexp)
                  (map first))

                            #uuid "b09d8708-352b-4a71-a845-5f838af04116"
                            "master"])))

  (d/q '[:find ?h ?tag
         :in $
         :where
         [?h :tag ?tag]]
       (get-in @stage [:volatile :val
                       "eve@polyc0l0r.net"
                       #uuid "b09d8708-352b-4a71-a845-5f838af04116"
                       "master"]))

  (d/q '[:find ?p (max 10 ?t)
         :in $ ?amount
         :where [?h :post ?p]
