lacarmen/cryogen — pull request #8 by viperscape (2014-11-15 15:06:53+00:00)
Title: git command processing from pages/posts

I probably should have just used selmer but figuring out how to parse and utilize a function with an overload was complicated/I didn't understand it. The layouts are post-process layouts, so it's what the git code gets turned in to and replaced into the page/post, after selmer processes it from compile.clj. I didn't upload compile.clj yet since I created a bug report for io.clj so I am hesitant. It's basically like this:

```clojure
(defn compile-posts [default-params posts]
(when-not (empty? posts)
(println (blue "compiling posts"))
(create-folder (str (blog-prefix) post-root))
(doseq [post posts]
(println "\t-->" (cyan (:uri post)))
(spit (str public (:uri post))
(-> (render-file (str "templates/html/layouts/" (:layout post))
(merge default-params
{:servlet-context "../"
:post post}))
post-process))))) ;;note: post-process here
```

In a post you'd write in:
{{git-src https://github.com/viperscape/kuroshio/blob/master/examples/pubsub.clj}}
or
{{git-gist https://gist.github.com/viperscape/cec68f0791687f5959f1}}

And that is replaced with the code, after it has been processed through the git template.

Also, I do not like the name commands.clj but there it is. You can add more post-processing commands pretty easily from here on out.