Sort blog articles by date and increase image preview size

This commit is contained in:
thiloho
2024-10-06 02:42:40 +02:00
parent 1b8f093f5b
commit c4f1bff2a9
3 changed files with 14 additions and 4 deletions

View File

@@ -15,6 +15,12 @@
isLegalPage: boolean;
websiteUrl: string;
} = $props();
const sortedArticles = websiteOverview.article.sort((a, b) => {
if (!a.publication_date) return 1;
if (!b.publication_date) return -1;
return new Date(b.publication_date).getTime() - new Date(a.publication_date).getTime();
});
</script>
<Head
@@ -49,7 +55,7 @@
</h2>
<ul class="unpadded">
{#each websiteOverview.article as article}
{#each sortedArticles as article}
<li>
{#if article.publication_date}
<p>{article.publication_date}</p>