perun

Discuss perun static site generator
bhagany 2017-10-09T00:43:26.000110Z

@branch14 I would define your own task using assortment-task, like so:

(deftask global-assortment
  "Renders an assortment using global metadata"
  []
  (with-pre-wrap fileset
    (let [global-meta (io.perun.meta/get-global-meta fileset)]
      (io.perun/assortment-task {:task-name "global-assortment"
                                 :tracer :your.ns/global-assortment
                                 :grouper (fn [entries] (do-something-with global-meta))}))))

branch14 2017-10-09T12:49:59.000260Z

@bhagany Thx. This looks promising. I'll give it a try.

bhagany 2017-10-09T18:59:25.000111Z

Oh - it just occurred to me that you could call get-global-meta right in your custom grouper function, and that way you wouldn’t need a separate task.

bhagany 2017-10-09T18:59:48.000592Z

@branch14 ^ (sorry, I’m a little rusty)

bhagany 2017-10-09T19:34:42.000357Z

Ah... nope, that would require access to the fileset. Disregard that last thing.