add: article view
View for blog articles
This commit is contained in:
parent
579491f216
commit
4104477533
15 changed files with 121 additions and 33 deletions
|
@ -1,9 +1,33 @@
|
|||
<template>
|
||||
<section class="BlogArticle content">
|
||||
<NuxtLink class="text inline-flex-row" to="/blog">
|
||||
<Icon name="ph:arrow-left-duotone"/>
|
||||
Zurück zur Übersicht
|
||||
</NuxtLink>
|
||||
|
||||
<p v-if="!article">
|
||||
Sorry bro, aber der Artikel existiert einfach nicht.
|
||||
</p>
|
||||
|
||||
<div v-else>
|
||||
<header>
|
||||
<div class="image z-2">
|
||||
<img :src="article.image" alt="Artikelbild" aria-hidden="true"/>
|
||||
</div>
|
||||
<h1 class="margin-top">{{ article.title }}</h1>
|
||||
<h2>{{ article.description }}</h2>
|
||||
</header>
|
||||
<div class="flex-col gap-default">
|
||||
<ContentRenderer v-if="article" :value="article" :style="{ display: 'contents' }"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const route = useRoute()
|
||||
|
||||
const { data: article } = await useAsyncData('article', () => queryCollection('blog').path(route.path).first())
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue