perun

Discuss perun static site generator
mariuene 2019-02-15T14:14:20.006900Z

Hey, I have a small question. How do I access the global-metadata from a content-task ?

mariuene 2019-02-15T14:23:15.009400Z

Also if you're missing a few hands I would love to help, been using perun for almost two years now.

2019-02-15T15:10:38.012200Z

Hello https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L859 loads the meta as part of the paths-fn then the renderer function applies it to the :rendered meta of each entry.

mariuene 2019-02-15T15:18:01.014200Z

Okay, so for instance, I have a markdown task which uses the content-task and sends in a :passthru-fn which needs access to the global-meta, is there any built in way to access it?

2019-02-15T16:36:07.015900Z

https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L187 according to this the passthru-fn should be receiving global meta as the third argument.

mariuene 2019-02-15T16:38:43.017100Z

Sorry i misspoke. I meant the :render-form-fn

2019-02-15T17:26:26.018300Z

https://github.com/hashobject/perun/blob/master/src/io/perun.clj#L820 meta is passed to the render-form-fn which is a map with {:entry {} :entries [] :global-meta}

mariuene 2019-02-15T17:30:25.019100Z

Thank you so much. This made my day.

2019-02-15T17:56:17.020800Z

You’re welcome! The project could use some help. If you have implementation suggestions or bug fixes in mind please create issues and pull requests. Otherwise, more documentation, especially on writing custom tasks, would be very appreciated 🙂

mariuene 2019-02-15T18:15:05.021700Z

Yes. I would be very happy to, I'll try to add something this weekend. :)