lunasqu.ee-nuxt/components/blog-post.vue

41 lines
1.1 KiB
Vue
Raw Normal View History

2022-10-16 09:37:13 +00:00
<template>
<article class="blog-post">
<div class="blog-post__meta">
2022-10-16 11:04:03 +00:00
<NuxtLink :to="'/blog/' + post.fullSlug">
2022-10-16 09:37:13 +00:00
<time :datetime="new Date(post.date).toISOString()">
{{ post.date }}
</time>
2022-10-16 11:04:03 +00:00
</NuxtLink>
2022-10-16 09:37:13 +00:00
</div>
<div class="blog-post__inner">
<header class="blog-post__title">
<h1>
<template v-if="detail">
{{ post.title }}
</template>
<template v-else>
2022-10-16 11:04:03 +00:00
<NuxtLink :to="'/blog/' + post.fullSlug">{{ post.title }}</NuxtLink>
2022-10-16 09:37:13 +00:00
</template>
</h1>
</header>
<div class="blog-post__content" v-html="post.html"></div>
<div class="blog-post__footer">
<div class="blog-post__tags">
2022-10-16 11:04:03 +00:00
<NuxtLink
2022-10-16 09:37:13 +00:00
v-for="tag of post.tags"
2022-10-16 11:04:03 +00:00
:to="'/blog/tags/' + tag"
2022-10-16 09:37:13 +00:00
class="blog-post__tag"
2022-10-16 11:04:03 +00:00
>#{{ tag }}</NuxtLink
2022-10-16 09:37:13 +00:00
>
</div>
</div>
</div>
</article>
</template>
<script setup lang="ts">
2022-10-16 11:04:03 +00:00
import { BlogPost } from '~~/lib/types/post';
defineProps<{ post: BlogPost; detail?: boolean }>();
2022-10-16 09:37:13 +00:00
</script>