cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.09k stars 96 forks source link

Any docs on extending Cryogen? #194

Closed holyjak closed 4 years ago

holyjak commented 4 years ago

Hello, are there any instructions for extending Cryogen? I'd like to

(Have a look at https://clojurians.slack.com/archives/C0M8UK760/p1574411678003500 to see the preview in action)

lacarmen commented 4 years ago

No docs currently, but that would be nice to add. You'd basically want to update the relevant functions in the compiler to your liking.

You can see an example of this with the Cryogen documentation website. I updated the compiler to group pages into sections so that I could get the headings on the right ("Getting Started", "Your Content"...)

This is where I redefined the parse-page function to include the :section. You can see I had to include the functions that call parse-page as well but you could avoid this by using with-redefs. Then in the server.clj make sure you're calling your custom functions from cryogen.compiler (your customized namespace) rather than cryogen-core.compiler.

holyjak commented 4 years ago

Thanks a lot! BTW Are you in the Slack #cryogen channel?

lacarmen commented 4 years ago

I didn't even know there was a #cryogen channel! Just joined :) I don't check the clojurians slack often though so you'll have to @ me if you wanna reach out there.

lacarmen commented 4 years ago

cryogen-project/cryogen-docs#26

lacarmen commented 4 years ago

New page at http://cryogenweb.org/docs/customizing-cryogen.html