mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-02-11 16:07:11 +01:00
Add favorite property to projects and update sorting in project listing
This commit is contained in:
@@ -11,6 +11,7 @@ useSeoMeta({
|
|||||||
|
|
||||||
const { data: projects } = await useAsyncData('all-projects', () => {
|
const { data: projects } = await useAsyncData('all-projects', () => {
|
||||||
return queryCollection('projects')
|
return queryCollection('projects')
|
||||||
|
.order('favorite', 'DESC')
|
||||||
.order('publishedAt', 'DESC')
|
.order('publishedAt', 'DESC')
|
||||||
.all()
|
.all()
|
||||||
})
|
})
|
||||||
@@ -35,9 +36,17 @@ const { data: projects } = await useAsyncData('all-projects', () => {
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col gap-2"
|
class="flex flex-col gap-2"
|
||||||
>
|
>
|
||||||
<h1 class="font-bold text-lg text-black dark:text-white">
|
<div class="flex items-center gap-2">
|
||||||
{{ project.title }}
|
<h1 class="font-bold text-lg text-black dark:text-white">
|
||||||
</h1>
|
{{ project.title }}
|
||||||
|
</h1>
|
||||||
|
<UIcon
|
||||||
|
v-if="project.favorite"
|
||||||
|
name="i-ph-star-duotone"
|
||||||
|
size="16"
|
||||||
|
class="text-amber-500"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<h3 class="text-md text-neutral-500 dark:text-neutral-400">
|
<h3 class="text-md text-neutral-500 dark:text-neutral-400">
|
||||||
{{ project.description }}
|
{{ project.description }}
|
||||||
</h3>
|
</h3>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const collections = {
|
|||||||
publishedAt: z.date(),
|
publishedAt: z.date(),
|
||||||
tags: z.array(z.string()),
|
tags: z.array(z.string()),
|
||||||
cover: z.string(),
|
cover: z.string(),
|
||||||
|
favorite: z.boolean().optional(),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
writings: defineCollection({
|
writings: defineCollection({
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ description: My personal website, my portfolio, and my blog.
|
|||||||
publishedAt: 2024/06/01
|
publishedAt: 2024/06/01
|
||||||
readingTime: 1
|
readingTime: 1
|
||||||
cover: artsite/cover.png
|
cover: artsite/cover.png
|
||||||
|
favorite: true
|
||||||
tags:
|
tags:
|
||||||
- web
|
- web
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ title: 🎓 Studies projects
|
|||||||
description: A collection of projects done during my studies.
|
description: A collection of projects done during my studies.
|
||||||
publishedAt: 2023/09/01
|
publishedAt: 2023/09/01
|
||||||
readingTime: 1
|
readingTime: 1
|
||||||
|
favorite: true
|
||||||
tags:
|
tags:
|
||||||
- data
|
- data
|
||||||
- python
|
- python
|
||||||
|
|||||||
Reference in New Issue
Block a user