component formatting and types
This commit is contained in:
parent
c2a7d15eeb
commit
ce745c06e5
60 changed files with 464 additions and 301 deletions
11
composables/calculateTitle.ts
Normal file
11
composables/calculateTitle.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import provideGlobal from "./provideGlobal";
|
||||
|
||||
export default async function () {
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const appTitle = runtimeConfig.public.app.title;
|
||||
|
||||
const { SEO } = await provideGlobal();
|
||||
const { metaTitle } = SEO ?? {};
|
||||
|
||||
return metaTitle ?? appTitle;
|
||||
}
|
9
composables/provideGlobal.ts
Normal file
9
composables/provideGlobal.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import type Global from "../types/single/global";
|
||||
|
||||
export default async function () {
|
||||
const { findOne } = useStrapi();
|
||||
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
|
||||
const { logo, navbar, footer, SEO } = global.value?.data ?? {};
|
||||
|
||||
return { logo, navbar, footer, SEO };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue