added proper blog page and fixed listing to make it much more automatic and stable
This commit is contained in:
parent
f31e5e49d2
commit
bb7e3329f3
9 changed files with 622 additions and 21 deletions
34
pages/blog-index.vue
Normal file
34
pages/blog-index.vue
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<template>
|
||||
<main>
|
||||
<a href="/"><-- Return Home</a>
|
||||
<h1>Tom's Blog</h1>
|
||||
|
||||
|
||||
<TextCard v-for="post in data"
|
||||
:key="post.id"
|
||||
:href="post._path"
|
||||
:heading="post.title"
|
||||
:subheading="post.date"
|
||||
:description="post.description"
|
||||
:id="post.id"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
var { data } = await useAsyncData('home', () => queryContent('blog').sort({id:-1}).find())
|
||||
</script>
|
||||
|
||||
<style>
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 2rem;
|
||||
margin-top: 3.5rem;
|
||||
gap: 2rem;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue