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

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