fix seo but with correct data
This commit is contained in:
@@ -77,6 +77,4 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
|
|
||||||
ssr: true
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user