From ad5aacce9cfd88c5c9da05fc0aa8d51392a1bc35 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 10 Aug 2024 21:16:36 +0800 Subject: [PATCH] :mag: Sitemap! :wheelchair: Dark mode to protect your eyes --- .env | 2 +- app.vue | 11 +++++++++++ components/post/Item.vue | 2 +- nuxt.config.ts | 13 ++++++++++++- package.json | 1 + pages/index.vue | 5 +++-- pages/posts/[id].vue | 2 +- pages/products/[...slug].vue | 2 +- plugins/vuetify.ts | 16 ++++++++++++++-- server/api/sitemap/posts.ts | 11 +++++++++++ utils/seo.ts | 2 +- 11 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 server/api/sitemap/posts.ts diff --git a/.env b/.env index 3f6807e..71313e5 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ NUXT_PUBLIC_SOLAR_REALM_ID=2 -NUXT_PUBLIC_BASE_URL=https://sn.solsynth.dev +NUXT_PUBLIC_SITE_URL=https://solsynth.dev NUXT_PUBLIC_SOLAR_NETWORK_API=https://api.sn.solsynth.dev NUXT_PUBLIC_SOLIAN_URL=https://sn.solsynth.dev diff --git a/app.vue b/app.vue index f244147..d2f3388 100644 --- a/app.vue +++ b/app.vue @@ -7,5 +7,16 @@ diff --git a/components/post/Item.vue b/components/post/Item.vue index 07c9762..7f0e295 100644 --- a/components/post/Item.vue +++ b/components/post/Item.vue @@ -12,7 +12,7 @@ -
+
diff --git a/nuxt.config.ts b/nuxt.config.ts index 8764989..6f04a27 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -4,11 +4,21 @@ import vuetify, { transformAssetUrls } from "vite-plugin-vuetify" export default defineNuxtConfig({ devtools: { enabled: true }, + site: { + url: "https://solsynth.dev", + name: "Solsynth LLC", + }, + sitemap: { + sources: [ + "/api/sitemap/posts", + ], + }, + css: ["@/assets/index.css"], runtimeConfig: { public: { - baseUrl: "https://solsynth.dev", + siteUrl: "https://solsynth.dev", solarRealmId: 2, solarNetworkApi: "https://api.sn.solsynth.dev", solianUrl: "https://sn.solsynth.dev", @@ -48,6 +58,7 @@ export default defineNuxtConfig({ "@unocss/nuxt", "@nuxt/content", "@nuxt/image", + "@nuxtjs/sitemap", (_options, nuxt) => { nuxt.hooks.hook("vite:extendConfig", (config) => { // @ts-expect-error diff --git a/package.json b/package.json index 98d7248..6f001df 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@mdi/font": "^7.4.47", "@nuxt/content": "^2.13.2", "@nuxt/image": "^1.7.0", + "@nuxtjs/sitemap": "^6.0.0-beta.1", "nuxt": "^3.12.4", "vue": "latest" }, diff --git a/pages/index.vue b/pages/index.vue index 5fb771a..14a6c99 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -32,7 +32,8 @@ const { data: products } = await useAsyncData("products", () => queryContent("/p } .content-section { - margin-top: 3rem; - margin-bottom: 8rem; + height: calc(100vh - 80px); + display: flex; + place-items: center; } diff --git a/pages/posts/[id].vue b/pages/posts/[id].vue index 792d5d5..2907597 100644 --- a/pages/posts/[id].vue +++ b/pages/posts/[id].vue @@ -10,7 +10,7 @@ -
+
diff --git a/pages/products/[...slug].vue b/pages/products/[...slug].vue index 6b4d23d..d2d527c 100644 --- a/pages/products/[...slug].vue +++ b/pages/products/[...slug].vue @@ -25,7 +25,7 @@ -
+