diff --git a/package-lock.json b/package-lock.json
index b6e0bf1..90e5038 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,6 +10,7 @@
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-free": "^6.7.2",
+ "@unhead/vue": "^0.7.0",
"element-plus": "^2.9.5",
"github-calendar": "^2.3.4",
"js-yaml": "^4.1.0",
@@ -22,7 +23,8 @@
"@vitejs/plugin-vue": "^5.2.1",
"path": "^0.12.7",
"unplugin-vue-components": "^28.4.1",
- "vite": "^6.2.0"
+ "vite": "^6.2.0",
+ "vite-plugin-sitemap": "^0.7.1"
}
},
"node_modules/@babel/helper-string-parser": {
@@ -799,6 +801,35 @@
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
"integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ=="
},
+ "node_modules/@unhead/schema": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@unhead/schema/-/schema-0.7.0.tgz",
+ "integrity": "sha512-AcfB3vbY7v5GxZOBNHjNiseRjtS40N+lXyuxr0Ee42/BBmPNcKa8SuAlSX4iSht7ptdSaxIjrzzTsQDOrDllYA==",
+ "license": "MIT",
+ "dependencies": {
+ "@zhead/schema": "1.0.1",
+ "hookable": "^5.4.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/harlan-zw"
+ }
+ },
+ "node_modules/@unhead/vue": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@unhead/vue/-/vue-0.7.0.tgz",
+ "integrity": "sha512-OoJk+zoLObUaetm9yRJXmxoS8PiZgxSnr1oS6VziWm1ImBQ7/kzvOAMiaKVg63JmjOB6Knr3rKSCL7Y+VITOiw==",
+ "license": "MIT",
+ "dependencies": {
+ "@unhead/schema": "0.7.0",
+ "hookable": "^5.4.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/harlan-zw"
+ },
+ "peerDependencies": {
+ "vue": ">=2.7 || >=3"
+ }
+ },
"node_modules/@vitejs/plugin-vue": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz",
@@ -991,6 +1022,15 @@
}
}
},
+ "node_modules/@zhead/schema": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@zhead/schema/-/schema-1.0.1.tgz",
+ "integrity": "sha512-n6BDs+MjSOesuv6krG2QGyCPfdndxWX0M/G2wEGu1SPHc5jLHHi3EY1+vQvudFVXRVXquZHKsDPE7pSyeyGgHg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/harlan-zw"
+ }
+ },
"node_modules/acorn": {
"version": "8.14.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
@@ -1308,6 +1348,12 @@
"node": ">= 6"
}
},
+ "node_modules/hookable": {
+ "version": "5.5.3",
+ "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz",
+ "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==",
+ "license": "MIT"
+ },
"node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
@@ -1890,6 +1936,12 @@
}
}
},
+ "node_modules/vite-plugin-sitemap": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/vite-plugin-sitemap/-/vite-plugin-sitemap-0.7.1.tgz",
+ "integrity": "sha512-4NRTkiWytLuAmcikckrLcLl9iYA20+5v6l8XshcOrzxH1WR8H0O3S6sTQYfjMrE8su/LG6Y0cTodvOdcOIxaLw==",
+ "dev": true
+ },
"node_modules/vue": {
"version": "3.5.13",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.13.tgz",
diff --git a/package.json b/package.json
index 5cf9b1d..b3e2ff6 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@fortawesome/fontawesome-free": "^6.7.2",
+ "@unhead/vue": "^0.7.0",
"element-plus": "^2.9.5",
"github-calendar": "^2.3.4",
"js-yaml": "^4.1.0",
@@ -23,6 +24,7 @@
"@vitejs/plugin-vue": "^5.2.1",
"path": "^0.12.7",
"unplugin-vue-components": "^28.4.1",
- "vite": "^6.2.0"
+ "vite": "^6.2.0",
+ "vite-plugin-sitemap": "^0.7.1"
}
}
diff --git a/public/robots.txt b/public/robots.txt
new file mode 100644
index 0000000..296dd18
--- /dev/null
+++ b/public/robots.txt
@@ -0,0 +1,3 @@
+User-agent: *
+Allow: /
+Sitemap: https://www.kisechan.space/sitemap.xml
\ No newline at end of file
diff --git a/src/App.vue b/src/App.vue
index 62f7d39..1028e24 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,9 +1,22 @@
@@ -60,4 +73,4 @@ body {
.github-corner:hover {
color: #409eff;
}
-
+
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index f432199..e76dbb6 100644
--- a/src/main.js
+++ b/src/main.js
@@ -8,14 +8,17 @@ import './assets/styles/global.css'
import '@fortawesome/fontawesome-free/css/all.css';
import 'github-calendar/dist/github-calendar-responsive.css';
import 'element-plus/theme-chalk/dark/css-vars.css'
+import { createHead } from '@unhead/vue'
const app = createApp(App)
+const head = createHead()
// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
+app.use(head)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index 8eb801a..67eefb7 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -5,19 +5,44 @@ const routes = [
path: "/",
name: "home",
component: () => import("@/views/HomeView.vue"),
- meta: { hideFooter: true, title: "主页" },
+ meta: {
+ hideFooter: true,
+ title: "主页",
+ metaTags: [
+ {
+ name: "description",
+ content: "Kisechan的个人主页。",
+ },
+ ],
+ },
},
{
path: "/links",
name: "links",
component: () => import("@/views/LinksView.vue"),
- meta: { title: "友链" },
+ meta: {
+ title: "友链",
+ metaTags: [
+ {
+ name: "description",
+ content: "Kisechan的个人主页 - 友链部分。",
+ },
+ ],
+ },
},
{
path: "/tools",
name: "tools",
component: () => import("@/views/ToolsView.vue"),
- meta: { title: "工具" },
+ meta: {
+ title: "工具",
+ metaTags: [
+ {
+ name: "description",
+ content: "Kisechan的个人主页 - 工具部分。",
+ },
+ ],
+ },
},
{
path: "/404",
diff --git a/vite.config.js b/vite.config.js
index 75f4617..ab281ea 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -1,12 +1,23 @@
-import { defineConfig } from 'vite'
-import vue from '@vitejs/plugin-vue'
-import path from 'path'
+import { defineConfig } from "vite";
+import vue from "@vitejs/plugin-vue";
+import path from "path";
+import sitemap from "vite-plugin-sitemap";
export default defineConfig({
- plugins: [vue()],
+ plugins: [
+ vue(),
+ sitemap({
+ hostname: "https://www.kisechan.space",
+ routes: [
+ { path: "/", name: "主页" },
+ { path: "/links", name: "友链" },
+ { path: "/tools", name: "工具" },
+ ],
+ }),
+ ],
resolve: {
alias: {
- '@': path.resolve(__dirname, './src')
- }
- }
-})
\ No newline at end of file
+ "@": path.resolve(__dirname, "./src"),
+ },
+ },
+});