~/website

073f1644b2a327fe57cc637067cdcf3a7682d6d4 — Arthur Melton f31ca04b 2 years ago
actually had the right sort I just set the date wrong
1 files changed, 6 insertions(+), 6 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +6 -6
@@ 164,20 164,20 @@ fn main() {

        }
        all_blogs.sort_by(|a, b| {
            NaiveDate::parse_from_str(
                a.config["date"]
                b.config["date"]
                    .as_str()
                    .unwrap_or_else(|| panic!("{} does not have a date", a.path.display())),
                    .unwrap_or_else(|| panic!("{} does not have a date", b.path.display())),
                "%Y-%m-%d",
            )
            .unwrap_or_else(|_| panic!("Cant convert {} date", a.path.display()))
            .unwrap_or_else(|_| panic!("Cant convert {} date", b.path.display()))
            .cmp(
                &NaiveDate::parse_from_str(
                    b.config["date"]
                    a.config["date"]
                        .as_str()
                        .unwrap_or_else(|| panic!("{} does not have a date", b.path.display())),
                        .unwrap_or_else(|| panic!("{} does not have a date", a.path.display())),
                    "%Y-%m-%d",
                )
                .unwrap_or_else(|_| panic!("Cant convert {} date", b.path.display())),
                .unwrap_or_else(|_| panic!("Cant convert {} date", a.path.display())),
            )
        });
        let mut i = 0;