alfredbaudisch / pardall_markdown

Reactive publishing framework, filesystem-based with support for Markdown, nested hierarchies, and instant content rebuilding. Written in Elixir.
Apache License 2.0
115 stars 7 forks source link

Wrong next and previous links being inserted into %Post{} if the sorting is another other than by_title #1

Closed alfredbaudisch closed 3 years ago

alfredbaudisch commented 3 years ago

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

alfredbaudisch commented 3 years ago

Not a problem anymore with the custom sorting methods by taxonomy, see LiveMarkdown.Content.Tree.build_taxonomy_tree