blog posts loading functional

This commit is contained in:
Clevetop 2024-07-26 21:37:20 +10:00
parent db78dd8066
commit 2656ef7e74
8 changed files with 2077 additions and 30 deletions

View file

@ -0,0 +1,20 @@
---
title: 'About This Site'
description: 'A look behind the technologies and inspiration for this site'
date: '20-07-2024'
---
# meow
## meow meow
### meow meow meow
nya nya nya
- nyaaaaaa

View file

@ -0,0 +1,18 @@
---
title: 'First Blog Post'
description: 'A simple test post to make sure everythings working'
date: '20-07-2024'
---
title
# Hello world
Markdown test post
- meow
- nya
dsadsa

View file

@ -1,7 +0,0 @@
# Hello world
Markdown test post
- meow
dsadsa

View file

@ -2,5 +2,9 @@
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
css: ["@/assets/css/main.scss"]
css: ["@/assets/css/main.scss"],
modules: ["@nuxt/content"],
content: {
documentDriven: false
}
})

2020
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -10,6 +10,7 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/content": "^2.13.2",
"nuxt": "^3.12.3",
"vue": "latest"
},

View file

@ -1,3 +0,0 @@
<template>
<p>meow~</p>
</template>

View file

@ -1,4 +1,4 @@
<script>
<!-- <script>
export default {
async asyncData({ $content, params }) {
const post = await $content('blog', params.slug).fetch()
@ -6,11 +6,31 @@
return { post }
}
}
</script>
</script> -->
<template>
<main>
<ContentDoc />
<a href="/"><-- Return Home</a>
<ContentDoc v-slot="{ doc }">
<article class="post">
<h1>{{ doc.title }}</h1>
<p>{{ doc.date }}</p>
<hr/>
<ContentRenderer :value="doc" />
</article>
</ContentDoc>
</main>
<!-- <main>
<ContentSlot :use="$slots.title" unwrap="p" />
<ContentDoc />
</main> -->
</template>
<style>
.post{
width: 80%;
}
</style>