mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Sort blog articles by date and increase image preview size
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user