-
截图待补充
-
{{ caption }}
-
{{ hint }}
-
website-docs/public{{ src }}
+
{{ caption }}
@@ -41,9 +46,19 @@ const resolved = computed(() => withBase(props.src))
margin: 24px 0;
}
+.wk-shot-media { position: relative; }
+
+.wk-shot-placeholder-sized {
+ position: absolute;
+ inset: 0;
+ justify-content: center;
+ overflow: auto;
+}
+
.wk-shot-img {
display: block;
width: 100%;
+ height: auto;
border: 1px solid var(--vp-c-divider);
border-radius: 10px;
}
diff --git a/website-docs/.vitepress/theme/style.css b/website-docs/.vitepress/theme/style.css
index 5d6d357f..607ff761 100644
--- a/website-docs/.vitepress/theme/style.css
+++ b/website-docs/.vitepress/theme/style.css
@@ -53,10 +53,6 @@
--vp-code-block-bg: #0d1626;
}
-html {
- scroll-behavior: smooth;
-}
-
body {
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
diff --git a/website-docs/homepage/app/page.tsx b/website-docs/homepage/app/page.tsx
index 71de8edb..01440d09 100644
--- a/website-docs/homepage/app/page.tsx
+++ b/website-docs/homepage/app/page.tsx
@@ -34,7 +34,7 @@ const releaseSlides = [
{ name: "画廊", icon: "monitor", shots: [{ label: "浏览图片", icon: "monitor", image: "kb-image-gallery", alt: "知识库画廊:图片瀑布流与来源文档筛选" }, { label: "查看详情", icon: "file", image: "kb-image-gallery-detail", alt: "画廊图片详情:查看原图、图片描述、识别文字与来源文档" }], title: "文档图片,集中浏览", description: "集中浏览文档图片,按来源、描述和图片属性筛选,查看原图与出处。", link: guide("03-features/02-knowledge-base") + "#image-gallery" },
{ name: "多模态 Embedding", icon: "search", image: "kb-image-vector-settings", title: "文字与图片,共同检索", description: <>让图片、图表与文字共同参与知识检索,用自然语言查找相关内容。支持
腾讯 WeMM-Embedding、Qwen3-VL-Embedding 等模型。>, alt: "多模态 Embedding:知识库图像处理中的图片向量检索开关", link: guide("03-features/02-knowledge-base") + "#multimodal-embedding" },
{ name: "Wiki 图谱", icon: "channels", image: "wiki-graph-groups", title: "知识关系,按主题展开", description: "关联页面按主题分组,在全图与分组之间切换,沿关系找到值得继续阅读的内容。", alt: "Wiki 图谱全景:主题分组、页面关系与节点类型图例", link: guide("03-features/14-wiki") + "#wiki-graph" },
- { name: "原文引用定位", icon: "trace", image: "chat-source-location", title: "从回答,回到原文", description: "点击回答中的引用,在原始文档中定位对应段落,对照上下文核对答案。", alt: "回答引用与原始文档中的对应段落高亮", link: guide("03-features/18-chat-experience") },
+ { name: "原文引用定位", icon: "trace", image: "chat-source-location", title: "从回答,回到原文", description: "点击回答中的引用,在原始文档中定位对应段落,对照上下文核对答案。", alt: "回答引用与原始文档中的对应段落高亮", link: guide("03-features/18-chat-experience") + "#查看回答与来源" },
].map(withAvailability);
const browserSlides = [
{ name: "执行任务", icon: "browser", title: "在自己的浏览器里完成任务",
diff --git a/website-docs/scripts/check-site.mjs b/website-docs/scripts/check-site.mjs
index a0f9f8d8..0682eed8 100644
--- a/website-docs/scripts/check-site.mjs
+++ b/website-docs/scripts/check-site.mjs
@@ -21,10 +21,11 @@ const failures = [];
for (const entry of await readdir(root)) {
if (!['index.html', '404.html', 'docs'].includes(entry)) failures.push(`/${entry}: only index.html, 404.html and docs/ may sit at the site root`);
}
-// Screenshot.vue renders a labelled placeholder until the image is added, so a
-// missing docs screenshot is reported as pending instead of failing the build.
+// Missing screenshots may use labelled placeholders; existing images must
+// reserve their intrinsic dimensions before loading to keep anchors stable.
const pendingShots = new Set();
const checked = new Map();
+const targetIds = new Map();
const pages = await walk(root);
for (const file of pages) {
const html = await readFile(file, 'utf8');
@@ -42,6 +43,21 @@ for (const file of pages) {
if (/class="wk-shot-img"/.test(tag) && url.pathname.startsWith('/docs/screenshots/')) pendingShots.add(url.pathname);
else failures.push(`${route}: missing ${url.pathname}`);
}
+ if (tag.startsWith('
![]()
match[1].replaceAll('&', '&'))));
+ }
+ if (!targetIds.get(target).has(decodeURIComponent(url.hash.slice(1)))) failures.push(`${route}: missing anchor ${url.pathname}${url.hash}`);
+ }
+ }
if (url.pathname === '/' && tag.startsWith('
{
+ const dir = mkdtempSync(join(tmpdir(), 'weknora-shot-sizes-'));
+ try {
+ // IHDR bytes from a PNG header; the extractor deliberately does not decode pixels.
+ const header = Buffer.from('89504e470d0a1a0a0000000d4948445200000f0000000840', 'hex');
+ writeFileSync(join(dir, 'wide.png'), header);
+ writeFileSync(join(dir, 'README.md'), 'Not an image');
+ assert.deepEqual(readScreenshotSizes(dir), { '/screenshots/wide.png': { width: 3840, height: 2112 } });
+ header.writeUInt32BE(900, 16);
+ header.writeUInt32BE(1600, 20);
+ writeFileSync(join(dir, 'wide.png'), header);
+ assert.deepEqual(readScreenshotSizes(dir), { '/screenshots/wide.png': { width: 900, height: 1600 } });
+ writeFileSync(join(dir, 'broken.png'), 'truncated');
+ assert.throws(() => readScreenshotSizes(dir), /Invalid PNG screenshot/);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});