wf4/app/components/Blog/Card.vue
webfussel 0a481fee5e add: first post, external posts, new comps
Add first post for monday, add external posts from other authors, add components for internal and external links
2025-07-11 13:32:59 +02:00

29 lines
No EOL
765 B
Vue

<template>
<NuxtLink :to="link" :external="isExternal" :target="isExternal ? '_blank' : '_self'" class="BlogCard z-2">
<div class="image">
<img :src="image" alt=" " aria-hidden="true"/>
</div>
<div class="card-content">
<header>
<span class="chip"><BlogCategory :name="category"/></span>
<h2>{{ title }}</h2>
</header>
<main>
<p>
{{ description }}
</p>
</main>
<footer>
<BlogAuthor :name="author.name" :img="author.img" :date="date"/>
</footer>
</div>
</NuxtLink>
</template>
<script setup lang="ts">
import type { BlogCard } from './types'
const { link } = defineProps<BlogCard>()
const isExternal = computed(() => link.startsWith('http'))
</script>