~/website

3e2240e90efca0ec5e8d5137db2a460db1102df0 — Arthur Melton 0bb9aaca 2 years ago
change sorting of blogs
1 files changed, 6 insertions(+), 6 deletions(-)

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

        }
        all_blogs.sort_by(|a, b| {
            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()))
            .cmp(
                &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())),
            )
        });
        let mut i = 0;