Reproducible on a fresh cryogen install (screenshot attached.)
Cause:
in params, :home-page may contain either a page or a post map.
compile-index extracts :home-page and re-attaches it to params as both :post and :page, then passes the resulting map to render-file - see code.
render-file calls htmlize-content
in htmlize-content, cond short-circuits after finding :post and never htmlizes :page - see code
back to compile-index - it selects the correct layout via (:layout home-page), and the layout attempts to print page.content, which has not been created in the previous step
Some options for a fix:
update htmlize-content to use cond-> instead of cond, and fix all available keys
fix compile-index so that it includes either a :post or a :page but not both (pages contain :page-index while posts don't)
have page and post maps contain :type :page or :type :post and have compile-index merge (:type home-page) home-page into params
Attempted: adding a
:home? true
flag to a page.Problem observed: page contents don't render.
Reproducible on a fresh cryogen install (screenshot attached.)
Cause:
params
,:home-page
may contain either a page or a post map.compile-index
extracts:home-page
and re-attaches it toparams
as both:post
and:page
, then passes the resulting map torender-file
- see code.render-file
callshtmlize-content
htmlize-content
,cond
short-circuits after finding:post
and never htmlizes:page
- see codecompile-index
- it selects the correct layout via(:layout home-page)
, and the layout attempts to printpage.content
, which has not been created in the previous stepSome options for a fix:
htmlize-content
to usecond->
instead ofcond
, and fix all available keyscompile-index
so that it includes either a:post
or a:page
but not both (pages contain :page-index while posts don't):type :page
or:type :post
and havecompile-index
merge(:type home-page) home-page
into params