From 6c3730a6adfd9e77e3472c3f0e3d10fcd805bda6 Mon Sep 17 00:00:00 2001 From: lyingbug Date: Wed, 14 Oct 2026 16:13:44 +0800 Subject: [PATCH] fix(docs): stabilize anchor navigation and link release topics (#4287) * docs: link v0.8.3 README topics to release sections * fix(docs): reserve screenshot space for stable anchor navigation --- README.md | 14 +++--- README_CN.md | 14 +++--- README_JA.md | 14 +++--- README_KO.md | 14 +++--- website-docs/.vitepress/config.mts | 2 + website-docs/.vitepress/screenshot-sizes.mjs | 27 ++++++++++ website-docs/.vitepress/theme-config.d.ts | 2 + website-docs/.vitepress/theme/Screenshot.vue | 49 ++++++++++++------- website-docs/.vitepress/theme/style.css | 4 -- website-docs/homepage/app/page.tsx | 2 +- website-docs/scripts/check-site.mjs | 22 +++++++-- .../scripts/screenshot-sizes.test.mjs | 25 ++++++++++ 12 files changed, 136 insertions(+), 53 deletions(-) create mode 100644 website-docs/.vitepress/screenshot-sizes.mjs create mode 100644 website-docs/scripts/screenshot-sizes.test.mjs diff --git a/README.md b/README.md index 258fd240..48a8cbd2 100644 --- a/README.md +++ b/README.md @@ -168,13 +168,13 @@ All options, hardware requirements and deployment topologies: [Installation guid ### v0.8.3 · 2026-10-14 · [release notes](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3) -- **Image gallery**: browse document images and filter by source, caption, OCR and image attributes. -- **Multimodal Embedding**: support for multimodal embedding models that encode text and images into a shared vector space, including Tencent WeMM-Embedding and Qwen3-VL-Embedding, with opt-in image-vector retrieval and compatible image-aware reranking. -- **Wiki graph**: clearer group layouts and theme captions, with group focus, switching and return to the full graph. -- **Source citations**: navigate from an answer to the cited passage in the original document. -- **Chat and tools**: on-demand attachment reading without a sandbox, unread replies, @ mention search, Docker terminals, Lite host skills and MCP interoperability updates. -- **Administration and integrations**: platform user management, invitation-only signup mode, administrator model catalog, WeMM embeddings, TEI/Pinecone/Cohere reranking, Seafile and Traditional Chinese. -- **Reliability**: broad retrieval, parsing, datasource, Wiki, OAuth and CLI fixes. Review [upgrade requirements](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes) for registration modes, empty tool lists, database migrations and reindexing. +- **[Image gallery](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#images)**: browse document images and filter by source, caption, OCR and image attributes. +- **[Multimodal Embedding](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#multimodal-embedding)**: support for multimodal embedding models that encode text and images into a shared vector space, including Tencent WeMM-Embedding and Qwen3-VL-Embedding, with opt-in image-vector retrieval and compatible image-aware reranking. +- **[Wiki graph](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#wiki-graph)**: clearer group layouts and theme captions, with group focus, switching and return to the full graph. +- **[Source citations](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#conversation)**: navigate from an answer to the cited passage in the original document. +- **[Chat and tools](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#tools)**: on-demand attachment reading without a sandbox, unread replies, @ mention search, Docker terminals, Lite host skills and MCP interoperability updates. +- **[Administration and integrations](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#administration)**: platform user management, invitation-only signup mode, administrator model catalog, WeMM embeddings, TEI/Pinecone/Cohere reranking, Seafile and Traditional Chinese. +- **[Reliability](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#other-changes)**: broad retrieval, parsing, datasource, Wiki, OAuth and CLI fixes. Review [upgrade requirements](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes) for registration modes, empty tool lists, database migrations and reindexing. ### v0.8.2 · 2026-09-24 · [release notes](https://weknora.weixin.qq.com/docs/07-releases/v0.8.2) diff --git a/README_CN.md b/README_CN.md index 5438f923..b6b34fe6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -168,13 +168,13 @@ docker compose up -d # 用新镜像重建容器 ### v0.8.3 · 2026-10-14 · [版本说明](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3) -- **画廊**:集中浏览文档图片,按来源、描述、OCR 与图片属性筛选,查看原图和出处。 -- **多模态 Embedding**:支持将文字与图片编码到同一向量空间的多模态向量模型,例如腾讯 WeMM-Embedding、Qwen3-VL-Embedding 等;可按需开启图片向量检索,并搭配支持图片输入的重排模型。 -- **Wiki 图谱**:重新组织分组布局与主题说明,支持聚焦分组、切换分组和返回全图。 -- **原文引用**:从回答直接定位原始文档中的引用片段。 -- **对话与工具**:无需沙箱即可按需读取附件,未读回答标记、@ 全局搜索、Docker 终端、Lite 本机技能与 MCP 兼容性更新。 -- **管理与集成**:平台用户管理、仅限邀请注册、管理员模型目录、WeMM 向量、TEI/Pinecone/Cohere 重排、Seafile 数据源与繁体中文。 -- **稳定性**:集中修复检索、解析、数据源、Wiki、OAuth 和 CLI。注册模式、空工具列表、数据库迁移与向量重建要求见[升级须知](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)。 +- **[画廊](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#images)**:集中浏览文档图片,按来源、描述、OCR 与图片属性筛选,查看原图和出处。 +- **[多模态 Embedding](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#multimodal-embedding)**:支持将文字与图片编码到同一向量空间的多模态向量模型,例如腾讯 WeMM-Embedding、Qwen3-VL-Embedding 等;可按需开启图片向量检索,并搭配支持图片输入的重排模型。 +- **[Wiki 图谱](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#wiki-graph)**:重新组织分组布局与主题说明,支持聚焦分组、切换分组和返回全图。 +- **[原文引用](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#conversation)**:从回答直接定位原始文档中的引用片段。 +- **[对话与工具](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#tools)**:无需沙箱即可按需读取附件,未读回答标记、@ 全局搜索、Docker 终端、Lite 本机技能与 MCP 兼容性更新。 +- **[管理与集成](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#administration)**:平台用户管理、仅限邀请注册、管理员模型目录、WeMM 向量、TEI/Pinecone/Cohere 重排、Seafile 数据源与繁体中文。 +- **[稳定性](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#other-changes)**:集中修复检索、解析、数据源、Wiki、OAuth 和 CLI。注册模式、空工具列表、数据库迁移与向量重建要求见[升级须知](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)。 ### v0.8.2 · 2026-09-24 · [版本说明](https://weknora.weixin.qq.com/docs/07-releases/v0.8.2) diff --git a/README_JA.md b/README_JA.md index a7dc5c50..8c2c9716 100644 --- a/README_JA.md +++ b/README_JA.md @@ -168,13 +168,13 @@ docker compose up -d # 新しいイメージでコンテナを再作成 ### v0.8.3 · 2026-10-14 · [リリースノート](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3) -- **画像ギャラリー**:文書内の画像を一覧表示し、出典・説明・OCR・画像属性で絞り込み。 -- **マルチモーダル Embedding**:テキストと画像を同じベクトル空間で扱うモデルに対応。Tencent WeMM-Embedding や Qwen3-VL-Embedding などを利用でき、画像ベクトル検索と対応モデルによる画像リランキングを任意で有効化。 -- **Wiki グラフ**:グループ配置とテーマ説明を改善。グループへのフォーカス、切り替え、全体表示への復帰に対応。 -- **原文引用**:回答から原文の引用箇所へ直接移動。 -- **会話とツール**:サンドボックス不要の添付ファイルのオンデマンド読み取り、未読返信、@ 検索、Docker ターミナル、Lite ローカルスキル、MCP 互換性の改善。 -- **管理と連携**:ユーザー管理、招待による登録、管理者モデルカタログ、WeMM、TEI/Pinecone/Cohere、Seafile、繁体字中国語。 -- **安定性**:検索、解析、同期、Wiki、OAuth、CLI を修正。登録モード、空のツール一覧、DB 移行と再インデックスについては[アップグレード案内](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)を確認してください。 +- **[画像ギャラリー](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#images)**:文書内の画像を一覧表示し、出典・説明・OCR・画像属性で絞り込み。 +- **[マルチモーダル Embedding](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#multimodal-embedding)**:テキストと画像を同じベクトル空間で扱うモデルに対応。Tencent WeMM-Embedding や Qwen3-VL-Embedding などを利用でき、画像ベクトル検索と対応モデルによる画像リランキングを任意で有効化。 +- **[Wiki グラフ](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#wiki-graph)**:グループ配置とテーマ説明を改善。グループへのフォーカス、切り替え、全体表示への復帰に対応。 +- **[原文引用](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#conversation)**:回答から原文の引用箇所へ直接移動。 +- **[会話とツール](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#tools)**:サンドボックス不要の添付ファイルのオンデマンド読み取り、未読返信、@ 検索、Docker ターミナル、Lite ローカルスキル、MCP 互換性の改善。 +- **[管理と連携](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#administration)**:ユーザー管理、招待による登録、管理者モデルカタログ、WeMM、TEI/Pinecone/Cohere、Seafile、繁体字中国語。 +- **[安定性](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#other-changes)**:検索、解析、同期、Wiki、OAuth、CLI を修正。登録モード、空のツール一覧、DB 移行と再インデックスについては[アップグレード案内](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)を確認してください。 ### v0.8.2 · 2026-09-24 · [リリースノート](https://weknora.weixin.qq.com/docs/07-releases/v0.8.2) diff --git a/README_KO.md b/README_KO.md index 55c4f6fb..63877a6b 100644 --- a/README_KO.md +++ b/README_KO.md @@ -178,13 +178,13 @@ docker compose up -d # 새 이미지로 컨테이너 재생성 ### v0.8.3 · 2026-10-14 · [릴리스 노트](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3) -- **이미지 갤러리**: 문서 이미지를 모아 보고 출처, 설명, OCR 및 이미지 속성으로 필터링. -- **멀티모달 Embedding**: 텍스트와 이미지를 같은 벡터 공간으로 인코딩하는 모델 지원. Tencent WeMM-Embedding, Qwen3-VL-Embedding 등을 사용할 수 있으며 이미지 벡터 검색과 호환 모델의 이미지 리랭킹을 선택적으로 활성화. -- **Wiki 그래프**: 그룹 배치와 주제 설명을 개선하고 그룹 집중 보기, 그룹 전환 및 전체 그래프 복귀를 지원. -- **원문 인용**: 답변에서 원문의 인용 부분으로 바로 이동. -- **대화와 도구**: 샌드박스 없이 첨부 파일을 필요할 때 읽기, 읽지 않은 답변 표시, @ 검색, Docker 터미널, Lite 로컬 스킬과 MCP 호환성 개선. -- **관리와 연동**: 플랫폼 사용자 관리, 초대 등록 모드, 관리자 모델 카탈로그, WeMM, TEI/Pinecone/Cohere, Seafile과 번체 중국어. -- **안정성**: 검색, 파싱, 동기화, Wiki, OAuth와 CLI 수정. 등록 모드, 빈 도구 목록, DB 마이그레이션과 재색인은 [업그레이드 안내](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)를 확인하세요. +- **[이미지 갤러리](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#images)**: 문서 이미지를 모아 보고 출처, 설명, OCR 및 이미지 속성으로 필터링. +- **[멀티모달 Embedding](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#multimodal-embedding)**: 텍스트와 이미지를 같은 벡터 공간으로 인코딩하는 모델 지원. Tencent WeMM-Embedding, Qwen3-VL-Embedding 등을 사용할 수 있으며 이미지 벡터 검색과 호환 모델의 이미지 리랭킹을 선택적으로 활성화. +- **[Wiki 그래프](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#wiki-graph)**: 그룹 배치와 주제 설명을 개선하고 그룹 집중 보기, 그룹 전환 및 전체 그래프 복귀를 지원. +- **[원문 인용](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#conversation)**: 답변에서 원문의 인용 부분으로 바로 이동. +- **[대화와 도구](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#tools)**: 샌드박스 없이 첨부 파일을 필요할 때 읽기, 읽지 않은 답변 표시, @ 검색, Docker 터미널, Lite 로컬 스킬과 MCP 호환성 개선. +- **[관리와 연동](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#administration)**: 플랫폼 사용자 관리, 초대 등록 모드, 관리자 모델 카탈로그, WeMM, TEI/Pinecone/Cohere, Seafile과 번체 중국어. +- **[안정성](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#other-changes)**: 검색, 파싱, 동기화, Wiki, OAuth와 CLI 수정. 등록 모드, 빈 도구 목록, DB 마이그레이션과 재색인은 [업그레이드 안내](https://weknora.weixin.qq.com/docs/07-releases/v0.8.3#upgrade-notes)를 확인하세요. ### v0.8.2 · 2026-09-24 · [릴리스 노트](https://weknora.weixin.qq.com/docs/07-releases/v0.8.2) diff --git a/website-docs/.vitepress/config.mts b/website-docs/.vitepress/config.mts index 414afd91..6d5bfffb 100644 --- a/website-docs/.vitepress/config.mts +++ b/website-docs/.vitepress/config.mts @@ -5,6 +5,7 @@ import { defineConfig, type DefaultTheme } from 'vitepress' import { withMermaid } from 'vitepress-plugin-mermaid' import './theme-config.d.ts' import { repoVersionLabel } from './version' +import { readScreenshotSizes } from './screenshot-sizes.mjs' const root = resolve(import.meta.dirname, '..') const require = createRequire(import.meta.url) @@ -133,6 +134,7 @@ export default withMermaid( nav: [], weknoraVersion: repoVersionLabel, + weknoraScreenshotSizes: readScreenshotSizes(resolve(root, 'public/screenshots')), sidebar, diff --git a/website-docs/.vitepress/screenshot-sizes.mjs b/website-docs/.vitepress/screenshot-sizes.mjs new file mode 100644 index 00000000..0260c714 --- /dev/null +++ b/website-docs/.vitepress/screenshot-sizes.mjs @@ -0,0 +1,27 @@ +import { closeSync, openSync, readSync, readdirSync } from 'node:fs'; +import { join } from 'node:path'; + +// Read intrinsic sizes before rendering HTML so anchor positions do not depend +// on when the screenshot requests finish. Product screenshots are PNG files. +export function readScreenshotSizes(directory) { + const sizes = {}; + for (const entry of readdirSync(directory, { withFileTypes: true })) { + if (!entry.isFile() || !entry.name.endsWith('.png')) continue; + const file = openSync(join(directory, entry.name), 'r'); + const header = Buffer.alloc(24); + try { + if (readSync(file, header, 0, 24, 0) !== 24 + || !header.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) + || header.toString('ascii', 12, 16) !== 'IHDR') { + throw new Error(`Invalid PNG screenshot: ${entry.name}`); + } + const width = header.readUInt32BE(16); + const height = header.readUInt32BE(20); + if (!width || !height) throw new Error(`Invalid screenshot dimensions: ${entry.name}`); + sizes[`/screenshots/${entry.name}`] = { width, height }; + } finally { + closeSync(file); + } + } + return sizes; +} diff --git a/website-docs/.vitepress/theme-config.d.ts b/website-docs/.vitepress/theme-config.d.ts index 241b1c8a..60887e95 100644 --- a/website-docs/.vitepress/theme-config.d.ts +++ b/website-docs/.vitepress/theme-config.d.ts @@ -4,5 +4,7 @@ declare module 'vitepress/dist/client/theme-default/config' { export interface ThemeConfig { /** 文档站点展示的 WeKnora 发布版本(来自仓库根 VERSION) */ weknoraVersion?: string + /** Intrinsic screenshot dimensions used to reserve layout before image loading. */ + weknoraScreenshotSizes?: Record } } diff --git a/website-docs/.vitepress/theme/Screenshot.vue b/website-docs/.vitepress/theme/Screenshot.vue index ef502829..ce41f45b 100644 --- a/website-docs/.vitepress/theme/Screenshot.vue +++ b/website-docs/.vitepress/theme/Screenshot.vue @@ -1,6 +1,6 @@