Sort
All checks were successful
/ test (push) Successful in 14s

This commit is contained in:
Soph :3 2024-08-02 20:10:21 +03:00
parent 1ecb6e544b
commit 3c084fbd79
Signed by: sophie
GPG key ID: EDA5D222A0C270F2

View file

@ -2,6 +2,7 @@ import { h, Component, Fragment, render } from 'preact';
import { useEffect, useState } from 'preact/hooks';
import { Giscus } from './giscus';
import { BlogPost } from './blog_post';
import { sort } from 'mathjs';
export interface Metadata {
title: string;
@ -47,8 +48,10 @@ const Blog = () => {
<h1>blog & comments</h1>
{(() => {
if (blogPosts[0]) {
const sortedBlogPosts = blogPosts[0];
sortedBlogPosts.sort((a, b) => b.time - a.time);
return <ul>
{blogPosts[0].map((n) => {
{sortedBlogPosts.map((n) => {
return <li>
<a href={"https://sad.ovh/?md=" + n.filename} onClick={
(e) => {