cryogen-project/cryogen

Any docs on extending Cryogen?

holyjak opened this issue · 5 comments

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

  • Make it possible to get the "preview" text stripped of all markup (or at least raw markup, not html) to include in description and og:description meta tags for previews at Twitter/Fb/Slack...
  • Make it possible to make a tag cloud with tag occurrence counts like here https://blog.jakubholy.net/category/
    Thanks!

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

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.

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

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.