get seo data
This commit is contained in:
parent
1497281945
commit
6192f87a4d
27
app.vue
27
app.vue
|
@ -1,5 +1,30 @@
|
|||
<script setup lang="ts">
|
||||
const config = useRuntimeConfig()
|
||||
const apiBase = config.public.apiBase
|
||||
|
||||
type ApiKpType = {
|
||||
id: number
|
||||
title: string
|
||||
content: string
|
||||
url: string
|
||||
meta_title: any
|
||||
meta_description: string
|
||||
keywords: any
|
||||
is_indexed: boolean
|
||||
}
|
||||
|
||||
const { data: seoData } = await useFetch<ApiKpType>(`${apiBase}/kp/1`)
|
||||
useSeoMeta({
|
||||
title: seoData.value?.title,
|
||||
ogTitle: seoData.value?.title,
|
||||
description: seoData.value?.content,
|
||||
ogDescription: seoData.value?.content,
|
||||
// ogImage: 'https://example.com/image.png',
|
||||
// twitterCard: 'summary_large_image',
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<NuxtWelcome />
|
||||
<NuxtPage />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
this is index page
|
||||
</template>
|
Loading…
Reference in New Issue