version update & use seo
This commit is contained in:
parent
d142e0c749
commit
4ae315eb88
6 changed files with 37 additions and 16 deletions
18
app.vue
18
app.vue
|
@ -2,11 +2,25 @@
|
|||
<NuxtPage />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import type SEOComponent from "./types/component/seoComponent";
|
||||
import type Global from "./types/single/global";
|
||||
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const appTitle = runtimeConfig.public.app.title;
|
||||
|
||||
const { findOne, find } = useStrapi();
|
||||
const { data: global } = await useAsyncData("global", () => findOne<Global>("global"));
|
||||
|
||||
const {
|
||||
metaTitle, metaDescription, keywords,
|
||||
} = global.value?.data?.SEO ?? ({} as SEOComponent);
|
||||
|
||||
useHead({
|
||||
title: appTitle,
|
||||
title: metaTitle ?? appTitle,
|
||||
meta: [
|
||||
{name: "description", content: metaDescription},
|
||||
{name: "keywords", content: keywords},
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue