forked from mns/mini-skamja
seo
This commit is contained in:
parent
97eec04543
commit
9e447e4c9a
|
@ -6,7 +6,7 @@ const { fetchData } = useApiFetch()
|
|||
import type { NuxtError } from '#app'
|
||||
import og_img from '/og_img.png'
|
||||
|
||||
const { data: seoData } = await fetchData<ApiKpType>(`kp/2/`)
|
||||
const { data: seoData } = await fetchData<Seo>(`kp/2/`)
|
||||
|
||||
useSeoMeta({
|
||||
title: seoData.value?.title,
|
||||
|
|
|
@ -3,7 +3,7 @@ declare module '*.glb' {
|
|||
export default src
|
||||
}
|
||||
|
||||
type ApiKpType = {
|
||||
type Seo = {
|
||||
id: number
|
||||
title: string
|
||||
content: string
|
||||
|
|
|
@ -7,16 +7,16 @@ import { marked } from 'marked';
|
|||
|
||||
import og_img from '/og_img.png'
|
||||
|
||||
// const { data: seoData } = await apiFetch<ApiKpType>(`kp/1/`)
|
||||
// useSeoMeta({
|
||||
// title: seoData.value?.title,
|
||||
// ogTitle: seoData.value?.title,
|
||||
// description: seoData.value?.content,
|
||||
// ogDescription: seoData.value?.content,
|
||||
// ogImage: config.public.baseUrl + og_img,
|
||||
// // twitterCard: 'summary_large_image',
|
||||
// })
|
||||
const { data, status, error } = await fetchData<Menu[]>(`menu/`)
|
||||
const { data: seo } = await fetchData<Seo[]>(`seo/`)
|
||||
useSeoMeta({
|
||||
title: seo.value && seo.value[0].title,
|
||||
ogTitle: seo.value && seo.value[0].title,
|
||||
description: seo.value && seo.value[0].content,
|
||||
ogDescription: seo.value && seo.value[0].content,
|
||||
ogImage: config.public.baseUrl + og_img,
|
||||
})
|
||||
|
||||
const { data } = await fetchData<Menu[]>(`menu/`)
|
||||
const pages = computed(() => {
|
||||
const menu = data.value?.find(el => el.type == 1)
|
||||
return (menu?.pages || []).sort((a, b) => a.order - b.order)
|
||||
|
|
Loading…
Reference in New Issue