version update & use seo
This commit is contained in:
parent
d142e0c749
commit
4ae315eb88
6 changed files with 37 additions and 16 deletions
|
@ -2,4 +2,5 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
.git/
|
.git/
|
||||||
.nuxt/
|
.nuxt/
|
||||||
.env
|
.env
|
||||||
|
.output/
|
18
app.vue
18
app.vue
|
@ -2,11 +2,25 @@
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</template>
|
</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 runtimeConfig = useRuntimeConfig();
|
||||||
const appTitle = runtimeConfig.public.app.title;
|
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({
|
useHead({
|
||||||
title: appTitle,
|
title: metaTitle ?? appTitle,
|
||||||
|
meta: [
|
||||||
|
{name: "description", content: metaDescription},
|
||||||
|
{name: "keywords", content: keywords},
|
||||||
|
]
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
23
package-lock.json
generated
23
package-lock.json
generated
|
@ -1,14 +1,16 @@
|
||||||
{
|
{
|
||||||
"name": "nuxt-app",
|
"name": "nuxt-app",
|
||||||
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "nuxt-app",
|
"name": "nuxt-app",
|
||||||
|
"version": "1.0.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/image": "^1.8.1",
|
"@nuxt/image": "^1.8.1",
|
||||||
"@nuxtjs/strapi": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
|
"@nuxtjs/strapi": "^2.0.0",
|
||||||
"nuxt": "^3.13.2",
|
"nuxt": "^3.13.2",
|
||||||
"vue": "latest",
|
"vue": "latest",
|
||||||
"vue-router": "latest"
|
"vue-router": "latest"
|
||||||
|
@ -17,8 +19,7 @@
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"postcss": "^8.4.47",
|
"postcss": "^8.4.47",
|
||||||
"tailwindcss": "^3.4.14"
|
"tailwindcss": "^3.4.14"
|
||||||
},
|
}
|
||||||
"version": "1.0.1"
|
|
||||||
},
|
},
|
||||||
"node_modules/@alloc/quick-lru": {
|
"node_modules/@alloc/quick-lru": {
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
|
@ -1354,10 +1355,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nuxtjs/strapi": {
|
"node_modules/@nuxtjs/strapi": {
|
||||||
"name": "@nuxtjs/strapi-edge",
|
"version": "2.0.0",
|
||||||
"version": "1.12.0-28818224.f53bdf9",
|
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi/-/strapi-2.0.0.tgz",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi-edge/-/strapi-edge-1.12.0-28818224.f53bdf9.tgz",
|
"integrity": "sha512-6Q34PQd980ruBTaMzVx23V/GP3YeoqWt9NKxVG79d1TJMwpKHCkFqZEN5jI/2csMyncYuzP4ozt2lIi5JYTudA==",
|
||||||
"integrity": "sha512-SdazV9/5qJr/b5F//fveU9DVxBFeYKfB6Gg7wyvZoNUW9z9BSPuQyoCfDdzRkPy+QqdaLhFXPjFJdPNeK/8agA==",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/kit": "^3.13.2",
|
"@nuxt/kit": "^3.13.2",
|
||||||
|
@ -10923,9 +10923,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@nuxtjs/strapi": {
|
"@nuxtjs/strapi": {
|
||||||
"version": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi-edge/-/strapi-edge-1.12.0-28818224.f53bdf9.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxtjs/strapi/-/strapi-2.0.0.tgz",
|
||||||
"integrity": "sha512-SdazV9/5qJr/b5F//fveU9DVxBFeYKfB6Gg7wyvZoNUW9z9BSPuQyoCfDdzRkPy+QqdaLhFXPjFJdPNeK/8agA==",
|
"integrity": "sha512-6Q34PQd980ruBTaMzVx23V/GP3YeoqWt9NKxVG79d1TJMwpKHCkFqZEN5jI/2csMyncYuzP4ozt2lIi5JYTudA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nuxt/kit": "^3.13.2",
|
"@nuxt/kit": "^3.13.2",
|
||||||
"defu": "^6.1.4",
|
"defu": "^6.1.4",
|
||||||
|
@ -16597,6 +16597,5 @@
|
||||||
"readable-stream": "^4.0.0"
|
"readable-stream": "^4.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"version": "1.0.1"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/image": "^1.8.1",
|
"@nuxt/image": "^1.8.1",
|
||||||
"@nuxtjs/strapi": "npm:@nuxtjs/strapi-edge@1.12.0-28818224.f53bdf9",
|
"@nuxtjs/strapi": "^2.0.0",
|
||||||
"nuxt": "^3.13.2",
|
"nuxt": "^3.13.2",
|
||||||
"vue": "latest",
|
"vue": "latest",
|
||||||
"vue-router": "latest"
|
"vue-router": "latest"
|
||||||
|
|
5
types/component/seoComponent.ts
Normal file
5
types/component/seoComponent.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export default interface SEOComponent {
|
||||||
|
metaTitle: string;
|
||||||
|
metaDescription: string;
|
||||||
|
keywords: string;
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import type Footer from "../component/globalFooter";
|
import type Footer from "../component/globalFooter";
|
||||||
import type Navbar from "../component/globalNavbar";
|
import type Navbar from "../component/globalNavbar";
|
||||||
|
import type SEOComponent from "../component/seoComponent";
|
||||||
|
|
||||||
export default interface Global {
|
export default interface Global {
|
||||||
id: number;
|
id: number;
|
||||||
|
@ -10,4 +11,5 @@ export default interface Global {
|
||||||
locale: string;
|
locale: string;
|
||||||
navbar: Navbar;
|
navbar: Navbar;
|
||||||
footer: Footer;
|
footer: Footer;
|
||||||
|
SEO: SEOComponent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue