Commit Graph

14 Commits

Author SHA1 Message Date
vercel[bot] abde4a8603
feat: Install and configure Vercel Web Analytics (#70)
Implemented Vercel Web Analytics Integration

SUMMARY:
Successfully integrated Vercel Web Analytics into the Docusaurus 2 project following the user's specifications.

CHANGES MADE:

1. Installed @vercel/analytics package
   - Executed: npm install @vercel/analytics
   - Added @vercel/analytics to package.json dependencies
   - Updated package-lock.json with dependency resolution

2. Modified src/pages/index.js (Home page component)
   - Added import for useEffect from React: `import { useEffect } from 'react';`
   - Added import for inject from @vercel/analytics: `import { inject } from '@vercel/analytics';`
   - Added useEffect hook in the Home component to initialize Vercel Analytics on component mount
   - The inject() function runs on the client side as required, with empty dependency array to ensure it runs once

IMPLEMENTATION DETAILS:

The Vercel Web Analytics configuration was added to the main homepage component since this is a Docusaurus 2 site. The inject() function is called within a useEffect hook with an empty dependency array [], ensuring it runs once when the component mounts on the client side.

The implementation follows React best practices:
- Uses useEffect for client-side initialization
- Empty dependency array ensures the analytics initializer runs once
- No route-specific configuration needed (as per user requirements)
- Minimal and non-intrusive changes to existing code

TESTING:

✓ Build completed successfully with no errors
✓ All webpack compilation warnings are pre-existing (LaTeX and Docusaurus-related)
✓ Static files generated without issues
✓ No linter errors introduced (no linter configured in project)

FILES MODIFIED:
- package.json - Added @vercel/analytics dependency
- package-lock.json - Updated with dependency resolution
- src/pages/index.js - Added Vercel Analytics initialization

VERIFICATION:
- Build: npm run build ✓ PASSED
- Package installation: npm install @vercel/analytics ✓ PASSED
- All changes preserve existing code structure and functionality

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2025-12-14 03:50:21 +08:00
千代有希= 5368cb8fe4
feat: 添加页面最后更新信息 (#66)
* test

* fix?

* fix??

* clean pnpm lock

---------

Co-authored-by: KirisameVanilla <118162831+kirisamevanilla@users.noreply.github.com>
2025-11-30 14:50:51 +08:00
KirisameVanilla 2e27ad9310
feat: swizzle comment 2025-09-28 00:39:39 +08:00
KirisameVanilla 1784bbea4a
revert: Revert "feat: 启用评论系统 (#35)"
This reverts commit 471c533afb.
2025-09-28 00:35:53 +08:00
千代=有希 471c533afb
feat: 启用评论系统 (#35)
启用 giscus 评论系统
2025-09-27 22:52:20 +08:00
Chiyo Yuki 04f0beb18b feat: 添加mermaid流程图支持 2025-09-24 01:51:03 +08:00
KirisameVanilla 5627ae6274
misc: use more chinese-friendly search 2025-09-23 21:17:59 +08:00
KirisameVanilla 32c50bbf7d
feat: search text 2025-09-23 19:57:37 +08:00
KirisameVanilla b53fcf417d
breaking: migrate to docusaurus 2025-09-11 02:34:39 +08:00
github-actions[bot] 2695fb6aff
chore(deps): auto-update deps (#15)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-10 10:20:13 +08:00
KirisameVanilla d4a90b3e29
feat: search, watermark; disable comment 2025-09-03 21:20:22 +08:00
KirisameVanilla ef97e28852 feat: make 信安数学基础2 paper 2025-09-02 13:51:07 +08:00
KirisameVanilla 52fc2a626e feat: enable katex 2025-09-01 21:13:57 +08:00
タクヤマ 2625c5c8d2 chore: Initial commit
---------

Co-authored-by: KirisameVanilla <118162831+KirisameVanilla@users.noreply.github.com>
Co-authored-by: Akai_Akari <zzdsnlcg@gmail.com>
Co-authored-by: psycho <10235101500@stu.ecnu.edu.cn>
Co-authored-by: Eagle233 <eagle233real@outlook.com>
2025-09-01 16:43:40 +08:00