feat: add icons to posts and photos to featured posts
All checks were successful
Deploy to SFTP Server / build (push) Successful in 4m33s
All checks were successful
Deploy to SFTP Server / build (push) Successful in 4m33s
This commit is contained in:
@@ -33,9 +33,21 @@ const posts = filterCollection(
|
||||
await getCollection("blog"),
|
||||
getLocale(Astro.url),
|
||||
);
|
||||
const photos = filterCollection(
|
||||
await getCollection("photos"),
|
||||
getLocale(Astro.url),
|
||||
);
|
||||
const list = [...posts, ...photos];
|
||||
list.sort((a, b) => {
|
||||
return a.data.date > b.data.date ? -1 : 1;
|
||||
});
|
||||
// .sort((a, b) => {
|
||||
// return a.data.date.getDate() > b.data.date.getDate() ? 1 : -1;
|
||||
// });
|
||||
console.log(list.map((post) => [post.data.date, post.data.title]));
|
||||
|
||||
const featuredPost = posts.find((post) => post.data?.featured);
|
||||
const otherPosts = posts.filter((post) => featuredPost !== post).slice(0, 3);
|
||||
const featuredPost = list.find((post) => post.data?.featured);
|
||||
const otherPosts = list.filter((post) => featuredPost !== post).slice(0, 3);
|
||||
---
|
||||
|
||||
<Layout title="Max Richter">
|
||||
|
Reference in New Issue
Block a user