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
This commit is contained in:
parent
427d9ae276
commit
0a481fee5e
19 changed files with 264 additions and 329 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<NuxtLink :to="link" class="BlogCard z-2">
|
||||
<NuxtLink :to="link" :external="isExternal" :target="isExternal ? '_blank' : '_self'" class="BlogCard z-2">
|
||||
<div class="image">
|
||||
<img :src="image" alt=" " aria-hidden="true"/>
|
||||
</div>
|
||||
|
@ -14,27 +14,16 @@
|
|||
</p>
|
||||
</main>
|
||||
<footer>
|
||||
<BlogAuthor :name="author.name" :date="date"/>
|
||||
<BlogAuthor :name="author.name" :img="author.img" :date="date"/>
|
||||
</footer>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Category } from './types'
|
||||
import type { BlogCard } from './types'
|
||||
|
||||
type Props = {
|
||||
title: string
|
||||
description: string
|
||||
image: string
|
||||
date: string
|
||||
link: string
|
||||
category: Category
|
||||
author: {
|
||||
name: string
|
||||
}
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
const { link } = defineProps<BlogCard>()
|
||||
|
||||
const isExternal = computed(() => link.startsWith('http'))
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue