Closed ieugen closed 3 years ago
(deleted my previous comment since it was wrong)
Adding posts/pages via :extend-params-fn
is possible and simple, see https://github.com/holyjak/tmp-demo-cryogen-posts-everywhere/commit/0d7654f816f669b88b313c37aaeecb90d9798437
BUT as you said, the body of the blog posts dissappears when I do this.
Ok, it is some interesting timing issues. Sometimes the :post
only has :content-dom
instead of the stringified :content
- when I compile the same thing repeatedly, it is random which one I get (content-dom->html
converts the former into the latter, called from render-file
via htmlize-content
)
This is the cause https://github.com/cryogen-project/cryogen-core/blob/0.4.0/src/cryogen_core/compiler.clj#L328 - if there is posts than we htmlize that and not post. (This is for the tags and previews pages)
I need to explore whether we can safely change the ordering.
I was trying to make a page that displays articles and used
compile-assets-timed {:extend-params-fn extend-params}
. I found out that did not work as expected and I spent a few hours trying to figure it out.Most changes are in this changeset https://github.com/ieugen/ieugen.ro/commit/2ced76497244a7ddac17ec10ddf8db6b87a314ce .
You can check out that commit and when doing
lein ring server
you should see that articles are not visible.Sometimes, when the articles list is visible, no content is in the pages and posts.
I found out that the code does not work if I pass
:posts
and or:pages
keys. The content disappears.I fixed it by passing other names, like
:all-my-posts
. It was not obvious and it behaved very strange.