Skip to content

Blog post sorting uses inverse title compare as fallback #576

@caugner

Description

@caugner

Context

When two blog posts share the same publication date, the sort uses reverse alphabetical title comparison as a tiebreaker. The code has an inline // TODO: use proper order comment.

Current behavior

In crates/rari-doc/src/cached_readers.rs (lines ~433-440):

sorted_meta.sort_by(|a, b| {
    if a.date != b.date {
        a.date.cmp(&b.date)
    } else {
        // TODO: use proper order
        b.title.cmp(&a.title)
    }
});

Question

What should the "proper order" be? Options include:

  • An explicit order or weight field in blog post frontmatter
  • Filesystem/creation order
  • Keep the current behavior but document it as intentional

This has been unchanged since 2024-06-20.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions