Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(website): expose community in shared top navigation

tt-a1i217e0f2c13b0
diff --git a/archify/test/site-language-continuity.test.mjs b/archify/test/site-language-continuity.test.mjs
index d659209a..0371baef 100644
--- a/archify/test/site-language-continuity.test.mjs
+++ b/archify/test/site-language-continuity.test.mjs
@@ -291,6 +291,8 @@ test('all site pages consume one language runtime and one navigation contract',
assert.match(html, /href="guide\.html"/, `${relative}: Guide navigation missing`);
assert.match(html, /href="gallery\.html"/, `${relative}: Proof Lab navigation missing`);
assert.match(html, /href="start\.html"/, `${relative}: Start navigation missing`);
+ assert.match(html, /<a class="nav-link" href="community\.html"/, `${relative}: Community navigation missing`);
+ assert.match(html, /<div class="nav-links">/, `${relative}: shared link row missing`);
assert.match(html, /class="btn btn-primary nav-cta"/, `${relative}: install action missing`);
assert.doesNotMatch(html, /(?:^|\s)nav\s*\{/, `${relative}: inline navigation layout bypasses the shared contract`);
assert.doesNotMatch(html, /\.nav-right\s*\{/, `${relative}: inline navigation actions bypass the shared contract`);
@@ -304,7 +306,7 @@ test('all site pages consume one language runtime and one navigation contract',
const navigation = fs.readFileSync(navigationPath, 'utf8');
assert.match(navigation, /\.site-nav\s*\{/);
assert.match(navigation, /\.site-nav \.nav-right\s*\{/);
- assert.match(navigation, /@media \(max-width: 640px\)/);
+ assert.match(navigation, /@media \(max-width: 960px\)/);
});
test('site page identity paths localize with the selected language', () => {
@@ -381,7 +383,7 @@ test('scenario guide type filters use consistent Chinese diagram names', () => {
test('real Chrome preserves language through entry, navigation, selection, refresh, and consistent navigation chrome', {
skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real site regression.',
- timeout: 60000,
+ timeout: 120000,
}, async () => {
const docsRoot = process.env.ARCHIFY_SITE_ROOT ? path.resolve(process.env.ARCHIFY_SITE_ROOT) : path.join(repoRoot, 'docs');
const basePath = process.env.ARCHIFY_SITE_ROOT ? '/archify' : '';
@@ -507,6 +509,8 @@ test('real Chrome preserves language through entry, navigation, selection, refre
assert.equal(await evaluate(browser, sessionId, 'document.querySelector(".nav-logo-path").textContent'), '/ 快速上手');
const pages = ['index.html', 'gallery.html', 'guide.html', 'start.html'];
+ if (fs.existsSync(path.join(docsRoot, 'community.html'))) pages.push('community.html');
+ if (process.env.ARCHIFY_SITE_ROOT) assert.ok(pages.includes('community.html'), 'built site must include the catalog');
const desktopReceipts = [];
for (const page of pages) {
await navigate(browser, sessionId, `${baseUrl}/${page}`);
@@ -534,33 +538,63 @@ test('real Chrome preserves language through entry, navigation, selection, refre
languageRadius: languageStyle.borderRadius,
ctaHeight: cta.getBoundingClientRect().height,
ctaRadius: ctaStyle.borderRadius,
- linkCount: nav.querySelectorAll('.nav-link').length
+ linkCount: nav.querySelectorAll('.nav-link').length,
+ communityLabel: nav.querySelector('a[href="community.html"]').textContent.trim()
};
})()`));
}
+ assert.equal(desktopReceipts[0].linkCount, 5);
+ assert.equal(desktopReceipts[0].communityLabel, '社区包');
for (const receipt of desktopReceipts.slice(1)) assert.deepEqual(receipt, desktopReceipts[0]);
- await browser.cdp.send('Emulation.setDeviceMetricsOverride', {
- width: 390,
- height: 844,
- deviceScaleFactor: 1,
- mobile: true,
- }, sessionId);
- for (const page of pages) {
- await navigate(browser, sessionId, `${baseUrl}/${page}`);
- const mobile = await evaluate(browser, sessionId, `(function () {
- var nav = document.querySelector('.site-nav');
- var rect = nav.getBoundingClientRect();
- var actions = nav.querySelector('.nav-right').getBoundingClientRect();
- return {
- height: rect.height,
- left: rect.left,
- right: rect.right,
- actionsRight: actions.right,
- linkDisplay: getComputedStyle(nav.querySelector('.nav-link')).display
- };
- })()`);
- assert.deepEqual(mobile, { height: 60, left: 0, right: 390, actionsRight: 370, linkDisplay: 'none' }, page);
+ for (const width of [320, 390, 768]) {
+ await browser.cdp.send('Emulation.setDeviceMetricsOverride', {
+ width, height: 844, deviceScaleFactor: 1, mobile: true,
+ }, sessionId);
+ for (const language of ['en', 'zh']) {
+ for (const page of pages) {
+ await navigate(browser, sessionId, `${baseUrl}/${page}?lang=${language}`);
+ const mobile = await evaluate(browser, sessionId, `(function () {
+ var nav = document.querySelector('.site-nav');
+ var rect = nav.getBoundingClientRect();
+ var community = nav.querySelector('a[href="community.html"]');
+ var linkRect = community.getBoundingClientRect();
+ var x = linkRect.x + linkRect.width / 2;
+ var y = linkRect.y + linkRect.height / 2;
+ return {
+ height: rect.height, left: rect.left, right: rect.right,
+ communityLabel: community.textContent.trim(),
+ language: document.documentElement.lang,
+ active: nav.querySelector('[aria-current="page"]')?.getAttribute('href') || null,
+ linksFit: [...nav.querySelectorAll('a, button')].every(node => {
+ var box = node.getBoundingClientRect();
+ return box.left >= 0 && box.right <= innerWidth && box.top >= 0 && box.bottom <= rect.bottom;
+ }),
+ reachable: document.elementFromPoint(x, y)?.closest('a') === community,
+ targetHeight: linkRect.height, x, y
+ };
+ })()`);
+ assert.equal(mobile.height, 104, page);
+ assert.equal(mobile.left, 0, page);
+ assert.equal(mobile.right, width, page);
+ assert.equal(mobile.language, language === 'zh' ? 'zh-CN' : 'en', page);
+ assert.equal(mobile.communityLabel, language === 'zh' ? '社区包' : 'Community', page);
+ assert.equal(mobile.active, page === 'index.html' ? null : page, page);
+ assert.ok(mobile.linksFit, `${page} ${language} ${width}: navigation must fit`);
+ assert.ok(mobile.reachable, `${page} ${language} ${width}: Community must be reachable`);
+ assert.ok(mobile.targetHeight >= 44, 'mobile navigation must retain a 44px touch target');
+ if (page === 'index.html' && pages.includes('community.html')) {
+ const loaded = browser.cdp.waitFor('Page.loadEventFired', sessionId);
+ for (const type of ['mousePressed', 'mouseReleased']) {
+ await browser.cdp.send('Input.dispatchMouseEvent', { type, x: mobile.x, y: mobile.y, button: 'left', clickCount: 1 }, sessionId);
+ }
+ await loaded;
+ assert.equal(await evaluate(browser, sessionId, 'location.pathname'), `${basePath}/community.html`);
+ assert.equal(await evaluate(browser, sessionId, 'document.documentElement.lang'), language === 'zh' ? 'zh-CN' : 'en');
+ assert.equal(await evaluate(browser, sessionId, 'document.querySelector(".site-nav a[aria-current=page]").getAttribute("href")'), 'community.html');
+ }
+ }
+ }
}
} finally {
await browser.close();
diff --git a/docs/assets/site-navigation.css b/docs/assets/site-navigation.css
index f985ba12..a4f5c0b6 100644
--- a/docs/assets/site-navigation.css
+++ b/docs/assets/site-navigation.css
@@ -59,7 +59,16 @@
gap: 1.25rem;
}
+.site-nav .nav-links {
+ display: flex;
+ align-items: center;
+ gap: 1.25rem;
+}
+
.site-nav .nav-link {
+ min-height: 44px;
+ display: inline-flex;
+ align-items: center;
color: #60686d;
font-family: var(--font-mono);
font-size: 0.625rem;
@@ -128,14 +137,23 @@
transform: translateY(-1px);
}
-@media (max-width: 640px) {
+@media (max-width: 960px) {
.site-nav {
+ height: 104px;
padding: 0 1.25rem;
- gap: 0.75rem;
+ gap: 0 0.625rem;
+ flex-wrap: wrap;
+ align-content: center;
}
- .site-nav .nav-right { gap: 0.625rem; }
- .site-nav .nav-link { display: none; }
+ .site-nav .nav-logo { margin-right: auto; }
+ .site-nav .nav-right { display: contents; }
+ .site-nav .nav-links {
+ order: 1;
+ flex: 0 0 100%;
+ justify-content: space-between;
+ gap: 0.25rem;
+ }
.site-nav .nav-cta { padding: 0.55rem 0.75rem; }
}
diff --git a/docs/gallery.html b/docs/gallery.html
index cb116be5..a1beffcf 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -230,10 +230,13 @@
<span class="nav-logo-path" data-en="/ proof lab" data-zh="/ 验证作品集">/ proof lab</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" data-en="Guide" data-zh="场景指南">Guide</a>
<a class="nav-link" href="gallery.html" aria-current="page" data-en="Proof Lab" data-zh="验证作品集">Proof Lab</a>
<a class="nav-link" href="start.html" data-en="Start" data-zh="快速上手">Start</a>
+ <a class="nav-link" href="community.html" data-en="Community" data-zh="社区包">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="start.html" data-en="Install Skill" data-zh="安装技能">Install Skill</a>
</div>
diff --git a/docs/guide.html b/docs/guide.html
index 15e08d0b..fc0cd6b7 100644
--- a/docs/guide.html
+++ b/docs/guide.html
@@ -191,10 +191,13 @@
<span class="nav-logo-path" data-en="/ guide" data-zh="/ 场景指南">/ guide</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" aria-current="page" data-i18n="navGuide">Guide</a>
<a class="nav-link" href="gallery.html" data-i18n="navProof">Proof Lab</a>
<a class="nav-link" href="start.html" data-i18n="navStart">Start</a>
+ <a class="nav-link" href="community.html" data-i18n="navCommunity">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="start.html" data-i18n="navInstall">Install Skill</a>
</div>
@@ -253,12 +256,12 @@
var lastRecipe = null;
var copy = {
en: {
- navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v3.0.1',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
+ navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navCommunity:'Community',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v3.0.1',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
metricRecipes:'real-world<br>recipes',metricModes:'typed diagram<br>modes',metricRuntime:'runtime<br>dependencies',chooserTitle:'What must the diagram explain?',chooserBody:'Write a situation, not a diagram type. Specific system facts produce a stronger recommendation.',placeholder:'Example: Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.',recommend:'Recommend a recipe →',clear:'Clear',libraryEyebrow:'Recipe library',libraryTitle:'12 small, opinionated starting points.',libraryBody:'Each recipe answers one technical question. That boundary keeps the result legible, reviewable, and honest about missing evidence.',footerLeft:'Generated from the same recipe source as the Archify CLI.',all:'All recipes',recommended:'Recommended recipe',use:'Use when',avoid:'Avoid when',must:'Evidence to include',presentation:'Presentation',prompt:'Copy-ready prompt',copyPrompt:'Copy prompt',copied:'Copied',alternatives:'Other possible fits:',confidence:'confidence',open:'Open recipe',proofReady:'Verified proof',proofLink:'Open verified example ↗',
samples:[['API + cache miss','Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.'],['Kafka + DLQ','Map Kafka topics, ordered processors, consumer groups, replay, state stores, and the dead-letter queue.'],['Incident response','Show how responders detect, triage, mitigate, escalate, communicate, and verify recovery.']]
},
zh: {
- navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v3.0.1',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
+ navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navCommunity:'社区包',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v3.0.1',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
metricRecipes:'个真实场景<br>配方',metricModes:'种类型化<br>图表模式',metricRuntime:'个运行时<br>依赖',chooserTitle:'这张图必须解释什么?',chooserBody:'写清场景,不要只写图表类型。系统事实越具体,推荐越可靠。',placeholder:'例如:展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。',recommend:'推荐配方 →',clear:'清空',libraryEyebrow:'配方库',libraryTitle:'12 个小而专的起点。',libraryBody:'每个配方只回答一个技术问题。清晰的边界让图更易读、可评审,也不会掩盖证据缺口。',footerLeft:'网页与 Archify CLI 使用同一份配方数据生成。',all:'全部配方',recommended:'推荐配方',use:'适合',avoid:'不要这样用',must:'必须包含的证据',presentation:'表现建议',prompt:'可直接复制的提示词',copyPrompt:'复制提示词',copied:'已复制',alternatives:'其他可能:',confidence:'置信度',open:'打开配方',proofReady:'已验证成品',proofLink:'打开验证成品 ↗',
samples:[['API + 缓存未命中','展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。'],['Kafka + 死信','梳理 Kafka Topic、有序处理器、消费者组、重放、状态存储和死信队列。'],['事故处置','展示响应者如何发现、分诊、缓解、升级、沟通并验证恢复。']]
}
diff --git a/docs/index.html b/docs/index.html
index 5b3663b1..94d17fb2 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -377,10 +377,13 @@
<img class="nav-logo-text brand-lockup" src="assets/archify-lockup-light.svg" alt="Archify" width="117" height="32">
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" data-i18n="nav-guide">Guide</a>
<a class="nav-link" href="gallery.html" data-i18n="nav-gallery">Proof Lab</a>
<a class="nav-link" href="start.html" data-i18n="nav-start">Start</a>
+ <a class="nav-link" href="community.html" data-i18n="nav-community">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn btn-lang" id="btn-lang">中文</button>
<a class="btn btn-primary nav-cta" href="#quickstart" data-i18n="nav-install">Install Skill</a>
</div>
@@ -842,7 +845,7 @@
══════════════════════════════════════ */
const LANGS = {
en: {
- 'nav-guide':'Guide','nav-gallery':'Proof Lab','nav-start':'Start','nav-install':'Install Skill',
+ 'nav-guide':'Guide','nav-gallery':'Proof Lab','nav-start':'Start','nav-community':'Community','nav-install':'Install Skill',
'hero-badge':'Agent Skill &nbsp;·&nbsp; stable &nbsp;·&nbsp; v3.0.1',
'hero-h1':'From plain English<br>to architecture <em>you can trust.</em>',
'hero-sub':'Describe your system in chat. Archify generates a polished, explorable HTML diagram — with progressive MAP → READ → FULL detail, a semantic camera, path-aware stories, motion, and ultra-crisp export built in.',
@@ -902,7 +905,7 @@
'footer-changelog':'Changelog','footer-license':'License'
},
zh: {
- 'nav-guide':'场景指南','nav-gallery':'验证作品集','nav-start':'快速上手','nav-install':'安装技能',
+ 'nav-guide':'场景指南','nav-gallery':'验证作品集','nav-start':'快速上手','nav-community':'社区包','nav-install':'安装技能',
'hero-badge':'Agent 技能 &nbsp;·&nbsp; 稳定版 &nbsp;·&nbsp; v3.0.1',
'hero-h1':'用自然语言,<br>生成<em>可信的架构图。</em>',
'hero-sub':'在对话中描述你的系统,Archify 生成精美、可探索的 HTML 技术图——信息会按 MAP → READ → FULL 渐进展开,并内置语义镜头、路径故事、动态效果和超清导出。',
diff --git a/docs/start.html b/docs/start.html
index 9cf8368c..364f5ec2 100644
--- a/docs/start.html
+++ b/docs/start.html
@@ -186,10 +186,13 @@
<span class="nav-logo-path" data-en="/ start" data-zh="/ 快速上手">/ start</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" data-en="Guide" data-zh="场景指南">Guide</a>
<a class="nav-link" href="gallery.html" data-en="Proof Lab" data-zh="验证作品集">Proof Lab</a>
<a class="nav-link" href="start.html" aria-current="page" data-en="Start" data-zh="快速上手">Start</a>
+ <a class="nav-link" href="community.html" data-en="Community" data-zh="社区包">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="#install" data-en="Install Skill" data-zh="安装技能">Install Skill</a>
</div>
diff --git a/scripts/gallery-template.html b/scripts/gallery-template.html
index 13c5b977..4a8bbecd 100644
--- a/scripts/gallery-template.html
+++ b/scripts/gallery-template.html
@@ -230,10 +230,13 @@
<span class="nav-logo-path" data-en="/ proof lab" data-zh="/ 验证作品集">/ proof lab</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" data-en="Guide" data-zh="场景指南">Guide</a>
<a class="nav-link" href="gallery.html" aria-current="page" data-en="Proof Lab" data-zh="验证作品集">Proof Lab</a>
<a class="nav-link" href="start.html" data-en="Start" data-zh="快速上手">Start</a>
+ <a class="nav-link" href="community.html" data-en="Community" data-zh="社区包">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="start.html" data-en="Install Skill" data-zh="安装技能">Install Skill</a>
</div>
diff --git a/scripts/guide-template.html b/scripts/guide-template.html
index 6db8a6ba..b5695b74 100644
--- a/scripts/guide-template.html
+++ b/scripts/guide-template.html
@@ -191,10 +191,13 @@
<span class="nav-logo-path" data-en="/ guide" data-zh="/ 场景指南">/ guide</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" aria-current="page" data-i18n="navGuide">Guide</a>
<a class="nav-link" href="gallery.html" data-i18n="navProof">Proof Lab</a>
<a class="nav-link" href="start.html" data-i18n="navStart">Start</a>
+ <a class="nav-link" href="community.html" data-i18n="navCommunity">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="start.html" data-i18n="navInstall">Install Skill</a>
</div>
@@ -253,12 +256,12 @@
var lastRecipe = null;
var copy = {
en: {
- navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v[[ARCHIFY_VERSION]]',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
+ navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navCommunity:'Community',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v[[ARCHIFY_VERSION]]',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
metricRecipes:'real-world<br>recipes',metricModes:'typed diagram<br>modes',metricRuntime:'runtime<br>dependencies',chooserTitle:'What must the diagram explain?',chooserBody:'Write a situation, not a diagram type. Specific system facts produce a stronger recommendation.',placeholder:'Example: Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.',recommend:'Recommend a recipe →',clear:'Clear',libraryEyebrow:'Recipe library',libraryTitle:'[[RECIPE_COUNT]] small, opinionated starting points.',libraryBody:'Each recipe answers one technical question. That boundary keeps the result legible, reviewable, and honest about missing evidence.',footerLeft:'Generated from the same recipe source as the Archify CLI.',all:'All recipes',recommended:'Recommended recipe',use:'Use when',avoid:'Avoid when',must:'Evidence to include',presentation:'Presentation',prompt:'Copy-ready prompt',copyPrompt:'Copy prompt',copied:'Copied',alternatives:'Other possible fits:',confidence:'confidence',open:'Open recipe',proofReady:'Verified proof',proofLink:'Open verified example ↗',
samples:[['API + cache miss','Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.'],['Kafka + DLQ','Map Kafka topics, ordered processors, consumer groups, replay, state stores, and the dead-letter queue.'],['Incident response','Show how responders detect, triage, mitigate, escalate, communicate, and verify recovery.']]
},
zh: {
- navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v[[ARCHIFY_VERSION]]',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
+ navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navCommunity:'社区包',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v[[ARCHIFY_VERSION]]',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
metricRecipes:'个真实场景<br>配方',metricModes:'种类型化<br>图表模式',metricRuntime:'个运行时<br>依赖',chooserTitle:'这张图必须解释什么?',chooserBody:'写清场景,不要只写图表类型。系统事实越具体,推荐越可靠。',placeholder:'例如:展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。',recommend:'推荐配方 →',clear:'清空',libraryEyebrow:'配方库',libraryTitle:'[[RECIPE_COUNT]] 个小而专的起点。',libraryBody:'每个配方只回答一个技术问题。清晰的边界让图更易读、可评审,也不会掩盖证据缺口。',footerLeft:'网页与 Archify CLI 使用同一份配方数据生成。',all:'全部配方',recommended:'推荐配方',use:'适合',avoid:'不要这样用',must:'必须包含的证据',presentation:'表现建议',prompt:'可直接复制的提示词',copyPrompt:'复制提示词',copied:'已复制',alternatives:'其他可能:',confidence:'置信度',open:'打开配方',proofReady:'已验证成品',proofLink:'打开验证成品 ↗',
samples:[['API + 缓存未命中','展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。'],['Kafka + 死信','梳理 Kafka Topic、有序处理器、消费者组、重放、状态存储和死信队列。'],['事故处置','展示响应者如何发现、分诊、缓解、升级、沟通并验证恢复。']]
}
diff --git a/scripts/start-template.html b/scripts/start-template.html
index e4f1e3f5..de4b1928 100644
--- a/scripts/start-template.html
+++ b/scripts/start-template.html
@@ -186,10 +186,13 @@
<span class="nav-logo-path" data-en="/ start" data-zh="/ 快速上手">/ start</span>
</a>
<div class="nav-right">
+ <div class="nav-links">
<a class="nav-link" href="guide.html" data-en="Guide" data-zh="场景指南">Guide</a>
<a class="nav-link" href="gallery.html" data-en="Proof Lab" data-zh="验证作品集">Proof Lab</a>
<a class="nav-link" href="start.html" aria-current="page" data-en="Start" data-zh="快速上手">Start</a>
+ <a class="nav-link" href="community.html" data-en="Community" data-zh="社区包">Community</a>
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class="btn-lang" id="language" type="button" aria-label="Switch language">中文</button>
<a class="btn btn-primary nav-cta" href="#install" data-en="Install Skill" data-zh="安装技能">Install Skill</a>
</div>
diff --git a/website/src/components/Navigation.astro b/website/src/components/Navigation.astro
index c484769d..cbc2087e 100644
--- a/website/src/components/Navigation.astro
+++ b/website/src/components/Navigation.astro
@@ -10,19 +10,13 @@ const identities = {
community: { en: '/ community', zh: '/ 社区包', label: 'Archify home' },
};
const identity = home ? undefined : identities[page];
-const guideKeys: Record<string, string> = { guide: 'navGuide', gallery: 'navProof', start: 'navStart' };
+const guideKeys: Record<string, string> = { guide: 'navGuide', gallery: 'navProof', start: 'navStart', community: 'navCommunity' };
const links = [
{ page: 'guide', en: 'Guide', zh: '场景指南' },
{ page: 'gallery', en: 'Proof Lab', zh: '验证作品集' },
{ page: 'start', en: 'Start', zh: '快速上手' },
{ page: 'community', en: 'Community', zh: '社区包' },
];
-// The four baseline pages (index/gallery/guide/start) must keep identical
-// navigation: site-language continuity tests deep-compare nav metrics across
-// pages, and gallery/guide/start are deep-compared against the docs/
-// migration baselines. The community link lives on the community page itself
-// and in the index footer.
-const visibleLinks = page === 'community' ? links : links.filter(link => link.page !== 'community');
---
<nav class="site-nav" aria-label="Primary navigation">
<a class="nav-logo" href={home ? '#' : './'} aria-label={identity?.label}>
@@ -30,8 +24,10 @@ const visibleLinks = page === 'community' ? links : links.filter(link => link.pa
{identity && <span class="nav-logo-path" data-en={identity.en} data-zh={identity.zh}>{identity.en}</span>}
</a>
<div class="nav-right">
- {visibleLinks.map(link => <a class="nav-link" href={`${link.page}.html`} aria-current={page === link.page ? 'page' : undefined} {...(home ? { 'data-i18n': `nav-${link.page}` } : page === 'guide' ? { 'data-i18n': guideKeys[link.page] } : { 'data-en': link.en, 'data-zh': link.zh })}>{link.en}</a>)}
+ <div class="nav-links">
+ {links.map(link => <a class="nav-link" href={`${link.page}.html`} aria-current={page === link.page ? 'page' : undefined} {...(home ? { 'data-i18n': `nav-${link.page}` } : page === 'guide' ? { 'data-i18n': guideKeys[link.page] } : { 'data-en': link.en, 'data-zh': link.zh })}>{link.en}</a>)}
<a class="nav-link" href="https://github.com/tt-a1i/archify" target="_blank" rel="noopener">GitHub</a>
+ </div>
<button class={home ? 'btn btn-lang' : 'btn-lang'} id={home ? 'btn-lang' : 'language'} type={home ? undefined : 'button'} aria-label={home ? undefined : 'Switch language'}>中文</button>
<a class="btn btn-primary nav-cta" href={home ? '#quickstart' : page === 'start' ? '#install' : 'start.html'} {...(home ? { 'data-i18n': 'nav-install' } : page === 'guide' ? { 'data-i18n': 'navInstall' } : { 'data-en': 'Install Skill', 'data-zh': '安装技能' })}>Install Skill</a>
</div>
diff --git a/website/src/scripts/guide.js b/website/src/scripts/guide.js
index 0f00e2cd..61d8459c 100644
--- a/website/src/scripts/guide.js
+++ b/website/src/scripts/guide.js
@@ -9,12 +9,12 @@
var lastRecipe = null;
var copy = {
en: {
- navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v[[ARCHIFY_VERSION]]',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
+ navGuide:'Guide',navProof:'Proof Lab',navStart:'Start',navCommunity:'Community',navInstall:'Install Skill',versionLabel:'Scenario guide / stable / v[[ARCHIFY_VERSION]]',eyebrow:'Question-first diagramming', headline:'Choose the question.<br>Get the <em>right diagram.</em>', lede:'Describe what your audience needs to understand. Archify recommends one bounded visual recipe—plus the evidence it must contain, when not to use it, and a prompt you can copy.',
metricRecipes:'real-world<br>recipes',metricModes:'typed diagram<br>modes',metricRuntime:'runtime<br>dependencies',chooserTitle:'What must the diagram explain?',chooserBody:'Write a situation, not a diagram type. Specific system facts produce a stronger recommendation.',placeholder:'Example: Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.',recommend:'Recommend a recipe →',clear:'Clear',libraryEyebrow:'Recipe library',libraryTitle:'12 small, opinionated starting points.',libraryBody:'Each recipe answers one technical question. That boundary keeps the result legible, reviewable, and honest about missing evidence.',footerLeft:'Generated from the same recipe source as the Archify CLI.',all:'All recipes',recommended:'Recommended recipe',use:'Use when',avoid:'Avoid when',must:'Evidence to include',presentation:'Presentation',prompt:'Copy-ready prompt',copyPrompt:'Copy prompt',copied:'Copied',alternatives:'Other possible fits:',confidence:'confidence',open:'Open recipe',proofReady:'Verified proof',proofLink:'Open verified example ↗',
samples:[['API + cache miss','Show an API request with JWT auth, a Redis cache miss, database fallback, and async tracing.'],['Kafka + DLQ','Map Kafka topics, ordered processors, consumer groups, replay, state stores, and the dead-letter queue.'],['Incident response','Show how responders detect, triage, mitigate, escalate, communicate, and verify recovery.']]
},
zh: {
- navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v[[ARCHIFY_VERSION]]',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
+ navGuide:'场景指南',navProof:'验证作品集',navStart:'快速上手',navCommunity:'社区包',navInstall:'安装技能',versionLabel:'场景指南 / 稳定版 / v[[ARCHIFY_VERSION]]',eyebrow:'先问题,后图表',headline:'先选对问题,<br>再得到<em>对的图。</em>',lede:'描述受众真正需要理解的内容。Archify 会推荐一个有边界的视觉配方,同时给出证据清单、禁用条件和可复制提示词。',
metricRecipes:'个真实场景<br>配方',metricModes:'种类型化<br>图表模式',metricRuntime:'个运行时<br>依赖',chooserTitle:'这张图必须解释什么?',chooserBody:'写清场景,不要只写图表类型。系统事实越具体,推荐越可靠。',placeholder:'例如:展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。',recommend:'推荐配方 →',clear:'清空',libraryEyebrow:'配方库',libraryTitle:'12 个小而专的起点。',libraryBody:'每个配方只回答一个技术问题。清晰的边界让图更易读、可评审,也不会掩盖证据缺口。',footerLeft:'网页与 Archify CLI 使用同一份配方数据生成。',all:'全部配方',recommended:'推荐配方',use:'适合',avoid:'不要这样用',must:'必须包含的证据',presentation:'表现建议',prompt:'可直接复制的提示词',copyPrompt:'复制提示词',copied:'已复制',alternatives:'其他可能:',confidence:'置信度',open:'打开配方',proofReady:'已验证成品',proofLink:'打开验证成品 ↗',
samples:[['API + 缓存未命中','展示带 JWT 鉴权、Redis 缓存未命中、数据库回退和异步追踪的 API 请求。'],['Kafka + 死信','梳理 Kafka Topic、有序处理器、消费者组、重放、状态存储和死信队列。'],['事故处置','展示响应者如何发现、分诊、缓解、升级、沟通并验证恢复。']]
}
diff --git a/website/test/navigation.test.mjs b/website/test/navigation.test.mjs
new file mode 100644
index 00000000..717ce74e
--- /dev/null
+++ b/website/test/navigation.test.mjs
@@ -0,0 +1,38 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import fs from 'node:fs';
+import { parse } from 'parse5';
+
+const nodes = node => [node, ...(node.childNodes || []).flatMap(nodes)];
+const attr = (node, name) => node.attrs?.find(item => item.name === name)?.value;
+const hasClass = (node, name) => (attr(node, 'class') || '').split(/\s+/).includes(name);
+const pages = ['index', 'gallery', 'guide', 'start', 'community'];
+
+test('all five built pages expose one shared top navigation and the correct current page', () => {
+ for (const page of pages) {
+ const dom = parse(fs.readFileSync(new URL(`../dist/${page}.html`, import.meta.url), 'utf8'));
+ const nav = nodes(dom).find(node => node.tagName === 'nav' && hasClass(node, 'site-nav'));
+ assert.ok(nav, page);
+ const links = nodes(nav).filter(node => node.tagName === 'a' && hasClass(node, 'nav-link'));
+ assert.deepEqual(links.map(node => attr(node, 'href')), [
+ 'guide.html', 'gallery.html', 'start.html', 'community.html', 'https://github.com/tt-a1i/archify',
+ ], page);
+ assert.deepEqual(links.filter(node => attr(node, 'aria-current') === 'page').map(node => attr(node, 'href')),
+ page === 'index' ? [] : [`${page}.html`], page);
+ const community = links.find(node => attr(node, 'href') === 'community.html');
+ if (page === 'index' || page === 'guide') {
+ assert.equal(attr(community, 'data-i18n'), page === 'index' ? 'nav-community' : 'navCommunity', page);
+ } else {
+ assert.equal(attr(community, 'data-en'), 'Community', page);
+ assert.equal(attr(community, 'data-zh'), '社区包', page);
+ }
+ const row = nodes(nav).find(node => hasClass(node, 'nav-links'));
+ assert.equal(nodes(row).filter(node => node.tagName === 'a').length, 5, page);
+ }
+});
+
+test('the homepage retains its footer catalog link alongside the top entry', () => {
+ const dom = parse(fs.readFileSync(new URL('../dist/index.html', import.meta.url), 'utf8'));
+ const footer = nodes(dom).find(node => node.tagName === 'footer');
+ assert.ok(nodes(footer).some(node => node.tagName === 'a' && attr(node, 'href') === 'community.html'));
+});