fix seo but with correct data

This commit is contained in:
Zoe
2024-04-23 20:23:47 -05:00
parent 523238ca99
commit 3f8e72f855
2 changed files with 2 additions and 5 deletions

View File

@@ -77,6 +77,4 @@ export default defineNuxtConfig({
}, },
sourcemap: false, sourcemap: false,
ssr: true
}) })

View File

@@ -7,8 +7,7 @@ const location = useBrowserLocation()
let year = new Date().getFullYear(); let year = new Date().getFullYear();
let route = useRoute(); let route = useRoute();
// cant use "useAsyncData" here for some reason because it leads to the posts not rendering correctly const { data: doc } = await useAsyncData(`${route.path}-data`, () => queryContent(route.path).findOne())
const doc = await queryContent(route.path).findOne()
if (!doc) { if (!doc) {
throw createError({ statusCode: 404, statusMessage: 'Article not found', fatal: true }) throw createError({ statusCode: 404, statusMessage: 'Article not found', fatal: true })
} }
@@ -67,7 +66,7 @@ useHead({
meta: [ meta: [
{ {
name: "copyright", name: "copyright",
content: "© ${year} juls07" content: `© ${year} juls07`
}, },
{ {
name: "robots", name: "robots",