jointrashposs/pages/blog/index.vue

47 lines
1.9 KiB
Vue
Raw Normal View History

2023-07-10 13:41:29 +02:00
<template>
<div>
<GHero>
<template #title>{{ $t('_blog.title') }}</template>
<template #description>
{{ $t('_blog.description') }}
</template>
<template #icon>
<div class="hidden lg:block relative px-6 py-8">
<GDots class="absolute top-0 left-0 w-32 h-32 text-accent-600" />
<GDots class="absolute bottom-0 right-0 w-32 h-32 text-accent-600" />
2023-07-15 10:34:45 +02:00
<div class="relative lg:w-64">
2023-07-10 13:41:29 +02:00
<img class="drop-shadow-xl" src="/img/emojis/open_mailbox_with_raised_flag_3d.png" />
</div>
</div>
</template>
</GHero>
2023-07-11 19:19:32 +02:00
<div class="pb-12 lg:mt-12 pt-6 bg-white dark:bg-slate-950">
2023-07-10 19:54:13 +02:00
<div class="container mx-auto max-w-screen-lg px-6 space-y-4 lg:space-y-2">
2023-09-23 12:07:45 +02:00
<GNuxtLink
2023-07-13 16:59:29 +02:00
class="block p-4 rounded-lg border border-slate-200 dark:border-accent-900 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800"
v-for="item in data"
:key="item._path"
:to="localePath(item._path ?? '', 'ja')"
>
<h3 class="text-lg font-bold mb-2">{{ item.navTitle || item.title }}</h3>
<p class="text-sm">{{ item.date ? $d(new Date(item.date)) : '' }}</p>
2023-09-23 12:07:45 +02:00
</GNuxtLink>
2023-07-10 19:54:13 +02:00
</div>
</div>
2023-07-10 13:41:29 +02:00
</div>
</template>
<script setup lang="ts">
const { locale, t } = useI18n();
const route = useRoute();
const localeState = useState('miHub_blog_originalLocale', () => locale.value);
localeState.value = locale.value;
2023-07-15 11:07:24 +02:00
const { data } = await useAsyncData('blog', () => queryContent('blog').only(['_path', 'navTitle', 'title', 'date']).sort({ date: -1 }).find());
2023-07-10 19:54:13 +02:00
const localePath = useLocalePath();
route.meta.title = t('_blog.title');
route.meta.description = t('_blog.description');
2023-07-10 13:41:29 +02:00
</script>