Do not generate separate content trees with different sort orders for the same post set. Generate only once, respecting the post set ordering configuration
The code which embeds each post %Link{} into their individual %Post{} entities (Content.Cache.build_content_tree/1) currently breaks the logic of sorting by title or by date, since the links from "by_date" are inserted into the posts. So when getting posts "by_title", all post.link will have the incorrect next and previous references (which will be based "by_date".
Do not generate separate content trees with different sort orders for the same post set. Generate only once, respecting the post set ordering configuration
The code which embeds each post
%Link{}
into their individual%Post{}
entities (Content.Cache.build_content_tree/1
) currently breaks the logic of sorting by title or by date, since the links from "by_date" are inserted into the posts. So when getting posts "by_title", allpost.link
will have the incorrectnext
andprevious
references (which will be based "by_date".