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.
Give Cryogen a new try :)
Do we have crygon github actions example?
What is the easy way to set for posts toc
as default to true
?
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
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.
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)))
?
> 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.
Yes, see my previous message âď¸
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>"
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.
I am also not sure if it will be possible to detect toc
false
if I would want to use it for post