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