From 882860e4dbb1408c30e3a8f3e24d2d787cb6f302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=8F=89=E6=A0=91=E6=A0=91?= Date: Thu, 11 Sep 2025 06:58:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Vercel=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=B7=A5=E5=85=B7=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加@vercel/analytics依赖并在布局中初始化,用于收集网站访问数据 --- package.json | 1 + pnpm-lock.yaml | 3 +++ src/layouts/Layout.astro | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c2663008..95b121fcf 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "@iconify/svelte": "^4.2.0", "@swup/astro": "^1.6.0", "@tailwindcss/typography": "^0.5.16", + "@vercel/analytics": "^1.5.0", "astro": "5.7.9", "astro-expressive-code": "^0.41.3", "astro-icon": "^1.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e60638075..dccf664ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,6 +73,9 @@ importers: '@tailwindcss/typography': specifier: ^0.5.16 version: 0.5.16(tailwindcss@3.4.17) + '@vercel/analytics': + specifier: ^1.5.0 + version: 1.5.0(svelte@5.28.2) astro: specifier: 5.7.9 version: 5.7.9(patch_hash=ysrllw3gj6hylybllnynya5oma)(@types/node@22.14.1)(jiti@1.21.7)(lightningcss@1.29.3)(rollup@2.79.2)(sass@1.80.4)(stylus@0.64.0)(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.0) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 376803ce5..131643468 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,4 +1,5 @@ --- +import Analytics from '@vercel/analytics/astro' import "@fontsource/roboto/400.css"; import "@fontsource/roboto/500.css"; import "@fontsource/roboto/700.css"; @@ -342,7 +343,7 @@ var _hmt = _hmt || []; checkDomain(); } - +