Files
web/components/post-card.vue
T
2025-08-25 21:13:08 +07:00

26 lines
898 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<template v-if="post">
<NuxtLink class="project-card" :to="post.path">
<img :src="baseUrl + '/portal/f/assets/' + post.coverImage" :alt="post?.title + 's cover image'"/>
<div class="project-card-content">
<h3>{{ post.title }}</h3>
<p :title="post.description">{{ post.description }}</p>
<p class="mt-4 text-xs" :title="useFormatDate(post.dateUpdated)">{{ useRelativeDate(post.dateUpdated) }}</p>
</div>
</NuxtLink>
</template>
</template>
<script setup lang="ts">
const config = useRuntimeConfig();
const baseUrl = config.public.baseUrl
import { useFormatDate } from '~/composables/formatDate';
import { useRelativeDate } from '~/composables/relativeDate';
import type { PostsCollectionItem } from '@nuxt/content'
defineProps<{
post: PostsCollectionItem
}>()
</script>