cryogen

http://cryogenweb.org/ - static sites by @U0DJK1VH6 & Co.
kwladyka 2021-06-03T18:42:07.001600Z

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.

👎 1
Jakub HolĂ˝ 2021-06-03T20:14:01.002400Z

Give Cryogen a new try :)

kwladyka 2021-06-03T20:18:50.002700Z

Do we have crygon github actions example?

kwladyka 2021-06-03T21:54:57.003100Z

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

Jakub HolĂ˝ 2021-06-04T09:01:02.003400Z

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

👍 1
Jakub HolĂ˝ 2021-06-04T09:04:53.004200Z

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Ă˝ 2021-06-04T09:15:25.004500Z

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))) ?

kwladyka 2021-06-04T09:47:17.004800Z

> 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Ă˝ 2021-06-04T12:44:18.005100Z

Yes, see my previous message ☝️

kwladyka 2021-06-04T13:00:59.005300Z

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>"

kwladyka 2021-06-04T13:01:40.005500Z

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.

kwladyka 2021-06-04T13:04:31.005800Z

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