mirror of
https://github.com/ArthurDanjou/artchat.git
synced 2026-01-24 13:52:09 +01:00
feat: add Writings section with dynamic content; enhance localization for projects and writings
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
<script lang="ts" setup>
|
||||
const { locale, locales, t } = useI18n()
|
||||
const { locale, locales } = useI18n()
|
||||
const currentLocale = computed(() => locales.value.find(l => l.code === locale.value))
|
||||
|
||||
const { data: projects } = await useAsyncData('projects-index', async () => await queryCollection('projects').where('favorite', '=', true).select().all())
|
||||
const { data: projects } = await useAsyncData('projects-index', async () => await queryCollection('projects').where('favorite', '=', true).select('title', 'description', 'id', 'publishedAt', 'tags', 'slug').all())
|
||||
const date = (date: string) => useDateFormat(new Date(date), 'DD MMMM YYYY', { locales: currentLocale.value?.code ?? 'en' })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section>
|
||||
<PostAlert class="mb-2" />
|
||||
<div class="prose dark:prose-invert">
|
||||
<p>{{ t('tool.projects') }}</p>
|
||||
<PostAlert class="mb-2" />
|
||||
<i18n-t keypath="tool.projects" tag="p">
|
||||
<template #canva>
|
||||
CANVA
|
||||
</template>
|
||||
<template #space>
|
||||
<br>
|
||||
</template>
|
||||
</i18n-t>
|
||||
</div>
|
||||
<div v-if="projects" class="m-1 my-4 flex flex-col gap-4">
|
||||
<div v-for="project in projects" :key="project.id">
|
||||
<NuxtLink :to="`/projects/${project.slug}`">
|
||||
<UCard variant="subtle" class="shadow-sm bg-white dark:bg-neutral-900">
|
||||
<UCard variant="subtle" class="shadow-sm bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-black duration-300">
|
||||
<h1 class="text-xl font-medium">
|
||||
{{ project.title }}
|
||||
</h1>
|
||||
|
||||
Reference in New Issue
Block a user