4
0
Fork 0
This commit is contained in:
Kseninia Mikhaylova 2025-03-13 12:29:27 +03:00
parent 97eec04543
commit 9e447e4c9a
3 changed files with 12 additions and 12 deletions

View File

@ -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,

2
index.d.ts vendored
View File

@ -3,7 +3,7 @@ declare module '*.glb' {
export default src
}
type ApiKpType = {
type Seo = {
id: number
title: string
content: string

View File

@ -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)