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