Fork me on GitHub
#cryogen
<
2021-06-03
>
kwladyka18:06:07

Does anyone have experience with Cryogen and Zola (Rust) and can compare? I was trying Cryogen a few years ago, but I see today it has sitemap etc. so things changed. PS I am using Hugo now and I hate it (mainly because of how making my own templating su*), but it was the best for me a few years ago.

👎 3
Jakub Holý (HolyJak)20:06:01

Give Cryogen a new try :)

kwladyka20:06:50

Do we have crygon github actions example?

kwladyka21:06:57

What is the easy way to set for posts toc as default to true ?

Jakub Holý (HolyJak)09:06:02

Not sure. But the code is not that long and quite OK to understand. If there is no built in way to do this (isn't there? I'd expect it...) then you can use :update-article-fn as described at http://cryogenweb.org/docs/customizing-cryogen.html

👍 2
Jakub Holý (HolyJak)09:06:53

It seems it could be possible to simply set :toc true in the config file, Have you tried that? Look into https://github.com/cryogen-project/cryogen-core/blob/master/src/cryogen_core/compiler.clj#L142 what add-toc does & how is it called.

Jakub Holý (HolyJak)09:06:25

No, sorry, I see it is (add-toc article config) and only looks into the article , not the config part. Perhaps send a PR to change https://github.com/cryogen-project/cryogen-core/blob/master/src/cryogen_core/compiler.clj#L148 to (if (or % (and (nil? %) (:toc config))) ?

kwladyka09:06:17

> It seems it could be possible to simply set :toc true in the config file, Have you tried that? It didn’t work for me.

Jakub Holý (HolyJak)12:06:18

Yes, see my previous message ☝️

kwladyka13:06:59

Unfortunately

(compile-assets-timed
    {:extend-params-fn
     (fn extend-params [params site-data]
       (println :extend-params-fn)
       (clojure.pprint/pprint params)
       (clojure.pprint/pprint site-data))
     :update-article-fn
     (fn update-article [article config]
       (println :update-article-fn)
       (clojure.pprint/pprint article)
       (clojure.pprint/pprint config))})
doesn’t work like toc is true / false. It is nil or "<ol class=\"toc\"><li><a href=\"#hi\">hi</a></li><ol><li><a href=\"#hii\">hii</a></li><ol><li><a href=\"#hiii\">hiii</a></li></ol></ol></ol>"

kwladyka13:06:40

I know I can use cryogen function to make this string by default probably, but then probably set toc to true in each post is better. or not.

kwladyka13:06:31

I am also not sure if it will be possible to detect toc false if I would want to use it for post