This commit is contained in:
biss committed 2026-07-18 15:05:37 +08:00
1 parent b20f5d736d
commit 44b81c0677
12 files changed
+441 -1

No files matched your search

+3
View File
@@ -11,6 +11,7 @@
- 综合试卷:把纪念试卷做成网页,并保留 Word 原卷下载。
- 留言墙:接入 Twikoo 后可在页面中留言。
- 全站搜索:通过 Typesense 搜索并筛选时间线、照片、文章和同学公开资料。
- PWA:支持添加到主屏幕,并离线访问站点外壳及已浏览的同源内容。
## 技术栈
@@ -37,6 +38,8 @@ npm run preview # 预览构建结果
npm run search:sync # 将公开内容同步到 Typesense
```
`npm run build` 会在 Astro 构建完成后生成带内容版本号的 Service Worker,并预缓存页面、样式、脚本、应用图标和首页主视觉。照片等大体积资源采用访问后缓存,第三方接口始终走网络。
## Typesense 全站搜索
复制 `.env.example` 中的配置到本地 `.env`、`.env.local` 或部署平台的环境变量。`npm run search:sync` 会自动读取这两个本地文件,且 `.env.local` 中的同名配置优先:
+1 -1
View File
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "astro build && node scripts/build-pwa.mjs",
"preview": "astro preview",
"search:key": "node --env-file-if-exists=.env --env-file-if-exists=.env.local scripts/create-typesense-search-key.mjs",
"search:sync": "node --env-file-if-exists=.env --env-file-if-exists=.env.local --import tsx scripts/sync-typesense.ts"
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Loaded 3 of 12 files, more files were not shown because too many files have changed in this diff. Show more