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:
parent
6aa6ddabb0
commit
59eeadd4b3
@ -21,7 +21,13 @@ const { post } = Astro.props;
|
|||||||
<a href={tp(`/${post.collection}/${post.id.split("/")[0]}`)}>
|
<a href={tp(`/${post.collection}/${post.id.split("/")[0]}`)}>
|
||||||
<h2
|
<h2
|
||||||
class="text-2xl flex gap-2 items-center line-clamp text-ellipsis overflow-hidden">
|
class="text-2xl flex gap-2 items-center line-clamp text-ellipsis overflow-hidden">
|
||||||
{post.data.icon && <img src={post.data.icon} class="h-6" />}
|
{
|
||||||
|
post.data.icon?.length > 3 ? (
|
||||||
|
<img src={post.data.icon} class="h-6" />
|
||||||
|
) : post.data.icon?.length ? (
|
||||||
|
<span>{post.data.icon}</span>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
{post.data.title}
|
{post.data.title}
|
||||||
</h2>
|
</h2>
|
||||||
<p class="text-ellipsis overflow-hidden line-clamp-2">
|
<p class="text-ellipsis overflow-hidden line-clamp-2">
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
title: "Erasmus Valencia"
|
title: "Erasmus Valencia"
|
||||||
date: 2022-09-02
|
date: 2022-09-02
|
||||||
cover: ./images/MAX_8218 - MAX_8230.jpg
|
cover: ./images/MAX_8218 - MAX_8230.jpg
|
||||||
|
toc: true
|
||||||
|
icon: 🍊
|
||||||
|
tags: ["valencia", "erasmus"]
|
||||||
---
|
---
|
||||||
|
|
||||||
import Image from "@components/Image.astro"
|
import Image from "@components/Image.astro"
|
||||||
|
@ -3,6 +3,8 @@ title: "Erasmus Valencia"
|
|||||||
date: 2022-09-02
|
date: 2022-09-02
|
||||||
cover: ./images/MAX_8218 - MAX_8230.jpg
|
cover: ./images/MAX_8218 - MAX_8230.jpg
|
||||||
toc: true
|
toc: true
|
||||||
|
icon: 🍊
|
||||||
|
tags: ["valencia", "erasmus"]
|
||||||
---
|
---
|
||||||
|
|
||||||
import Image from "@components/Image.astro"
|
import Image from "@components/Image.astro"
|
||||||
|
@ -3,7 +3,9 @@ title: Madeira
|
|||||||
date: 2025-02-16
|
date: 2025-02-16
|
||||||
license: "CC-BY-SA:4.0"
|
license: "CC-BY-SA:4.0"
|
||||||
comments: true
|
comments: true
|
||||||
|
icon: 🏝️
|
||||||
cover: ./images/MAX_0603.jpg
|
cover: ./images/MAX_0603.jpg
|
||||||
|
tags: ["madeira", "travel"]
|
||||||
---
|
---
|
||||||
|
|
||||||
import Image from "@components/Image.astro";
|
import Image from "@components/Image.astro";
|
||||||
|
@ -3,7 +3,9 @@ title: Madeira
|
|||||||
date: 2025-02-16
|
date: 2025-02-16
|
||||||
license: "CC-BY-SA:4.0"
|
license: "CC-BY-SA:4.0"
|
||||||
comments: true
|
comments: true
|
||||||
|
icon: 🏝️
|
||||||
cover: ./images/MAX_0603.jpg
|
cover: ./images/MAX_0603.jpg
|
||||||
|
tags: ["madeira", "travel"]
|
||||||
---
|
---
|
||||||
|
|
||||||
import Image from "@components/Image.astro";
|
import Image from "@components/Image.astro";
|
||||||
|
@ -3,6 +3,8 @@ title: "Peaks of the Balkans"
|
|||||||
date: 2024-06-19
|
date: 2024-06-19
|
||||||
cover: ./images/MAX_9861.jpg
|
cover: ./images/MAX_9861.jpg
|
||||||
license: "CC-BY-SA:4.0"
|
license: "CC-BY-SA:4.0"
|
||||||
|
icon: 🏔️
|
||||||
|
tags: ["balkans", "travel"]
|
||||||
comments: true
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ title: "Peaks of the Balkans"
|
|||||||
date: 2024-06-19
|
date: 2024-06-19
|
||||||
cover: ./images/MAX_9861.jpg
|
cover: ./images/MAX_9861.jpg
|
||||||
license: "CC-BY-SA:4.0"
|
license: "CC-BY-SA:4.0"
|
||||||
|
icon: 🏔️
|
||||||
|
tags: ["balkans", "hiking", "travel"]
|
||||||
comments: true
|
comments: true
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -33,9 +33,21 @@ const posts = filterCollection(
|
|||||||
await getCollection("blog"),
|
await getCollection("blog"),
|
||||||
getLocale(Astro.url),
|
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 featuredPost = list.find((post) => post.data?.featured);
|
||||||
const otherPosts = posts.filter((post) => featuredPost !== post).slice(0, 3);
|
const otherPosts = list.filter((post) => featuredPost !== post).slice(0, 3);
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user