This is an automated email from the ASF dual-hosted git repository. Yilialinn pushed a commit to branch codex/recover-apisix-core-search-visibility in repository https://gitbox.apache.org/repos/asf/apisix-website.git
commit 085fc6a0fea52a6bac32739b35029eac6968e25f Author: Yilia Lin <[email protected]> AuthorDate: Thu Sep 10 16:40:49 2026 +0800 refactor(seo): clarify core search intent paths --- next/src/components/HomePage.astro | 19 ++++++++++- next/tests/e2e/main-pages.spec.mjs | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/next/src/components/HomePage.astro b/next/src/components/HomePage.astro index c1855121140..427d79fa075 100644 --- a/next/src/components/HomePage.astro +++ b/next/src/components/HomePage.astro @@ -16,7 +16,12 @@ const STATS = [ const QUICK_CARDS = [ { title: t(locale, 'Get started', '快速开始'), body: t(locale, 'Install APISIX and configure your first route in minutes.', '几分钟内安装 APISIX 并配置你的第一条路由。'), link: t(locale, 'Read the docs →', '阅读文档 →'), href: `${p}/docs/apisix/getting-started/README/` }, - { title: t(locale, 'Learn the concepts', '学习核心概念'), body: t(locale, 'API gateway, AI gateway, rate limiting, mTLS, Kubernetes and more.', 'API 网关、AI 网关、限流限速、mTLS、Kubernetes 等。'), link: t(locale, 'Explore the learning center →', '进入学习中心 →'), href: `${p}/learning-center/` }, + { + title: t(locale, 'Understand API gateways', '学习核心概念'), + body: t(locale, 'Learn how an API gateway routes, secures, and observes traffic, and where Apache APISIX fits.', 'API 网关、AI 网关、限流限速、mTLS、Kubernetes 等。'), + link: t(locale, 'Read the API gateway guide →', '进入学习中心 →'), + href: locale === 'zh' ? '/zh/learning-center/' : '/learning-center/what-is-an-api-gateway/', + }, { title: t(locale, 'Case studies', '用户案例'), body: t(locale, 'See how teams run Apache APISIX in production at scale.', '看看各团队如何在生产环境大规模运行 Apache APISIX。'), link: t(locale, 'Read case studies →', '阅读用户案例 →'), href: `${p}/blog/` }, ]; @@ -218,6 +223,18 @@ const SOFTWARE_APPLICATION_SCHEMA = { <p class="feature-lead">{t(locale, 'APISIX API Gateway offers 100+ open-source plugins, comprehensive API management capabilities, and advanced technical advantages.', 'APISIX API 网关提供 100+ 开源插件、全面的 API 管理能力和先进的技术优势。')}</p> + <p> + {t(locale, 'Evaluating open-source options?', '正在评估开源方案?')} + {' '} + <a + class="cta-link" + href={locale === 'zh' ? '/zh/comparisons/' : '/learning-center/open-source-api-gateway-comparison/'} + > + {t(locale, + 'Compare API gateway architectures, extensibility, Kubernetes support, and operations →', + '查看 API 网关对比与选型内容 →')} + </a> + </p> </div> </div> </section> diff --git a/next/tests/e2e/main-pages.spec.mjs b/next/tests/e2e/main-pages.spec.mjs index f8660af09bd..897ecec1809 100644 --- a/next/tests/e2e/main-pages.spec.mjs +++ b/next/tests/e2e/main-pages.spec.mjs @@ -45,6 +45,49 @@ async function expectSocialImage(page) { await expect(page.locator('meta[name="twitter:card"]')).toHaveAttribute('content', 'summary_large_image'); } +test('homepage keeps verified positioning and distinct search-intent paths', async ({ page }) => { + await page.goto('/'); + + await expect(page).toHaveTitle('Apache APISIX - Open Source API Gateway & AI Gateway'); + await expect(page.locator('meta[name="description"]')).toHaveAttribute( + 'content', + 'Apache APISIX is a dynamic, high-performance, open-source API gateway and AI gateway. Features include load balancing, authentication, rate limiting, AI proxying, LLM load balancing, and 100+ plugins.', + ); + await expect(page.getByRole('heading', { + level: 1, + name: 'The open-source API Gateway & AI Gateway', + })).toBeVisible(); + await expect(page.locator('link[rel="canonical"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/'); + await expect(page.locator('link[rel="alternate"][hreflang="en"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/'); + await expect(page.locator('link[rel="alternate"][hreflang="zh"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/zh/'); + await expect(page.locator('link[rel="alternate"][hreflang="x-default"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/'); + + await expect(page.locator('.stat')).toHaveCount(4); + await expect(page.locator('.stat').nth(0)).toContainText('100+'); + await expect(page.locator('.stat').nth(0)).toContainText('open-source plugins'); + await expect(page.locator('.stat').nth(1)).toContainText('Dynamic'); + await expect(page.locator('.stat').nth(1)).toContainText('routing and configuration'); + await expect(page.locator('.stat').nth(2)).toContainText('Hot-reloadable'); + await expect(page.locator('.stat').nth(2)).toContainText('plugins'); + await expect(page.locator('.stat').nth(3)).toContainText('Apache 2.0'); + await expect(page.locator('.stat').nth(3)).toContainText('licensed'); + + await expect(page.locator('main').getByText(/MCP/i)).toHaveCount(0); + await expect(page.getByText('~18k', { exact: true })).toHaveCount(0); + await expect(page.getByText('0.2 ms', { exact: true })).toHaveCount(0); + await expect(page.getByRole('link', { name: 'Prompt transformation' })) + .toHaveAttribute('href', '/docs/apisix/plugins/ai-prompt-template/'); + await expect(page.getByRole('link', { name: /Understand API gateways/ })) + .toHaveAttribute('href', '/learning-center/what-is-an-api-gateway/'); + await expect(page.getByRole('link', { name: /Compare API gateway architectures/ })) + .toHaveAttribute('href', '/learning-center/open-source-api-gateway-comparison/'); + await expectNoPageOverflow(page); +}); + test('AI Gateway has complete responsive content and valid footer links', async ({ page }, testInfo) => { await page.goto('/ai-gateway/'); @@ -117,6 +160,27 @@ test('Downloads exposes release artifacts, signatures, and checksums', async ({ }); test('Chinese routes keep localized primary content', async ({ page }) => { + await page.goto('/zh/'); + await expect(page).toHaveTitle('Apache APISIX - 开源 API 网关与 AI 网关'); + await expect(page.locator('meta[name="description"]')).toHaveAttribute( + 'content', + 'Apache APISIX 是一个动态、高性能的开源 API 网关和 AI 网关,提供负载均衡、身份认证、限流限速、AI 代理、LLM 负载均衡等能力和 100+ 插件。', + ); + await expect(page.getByRole('heading', { level: 1, name: '开源 API 网关与 AI 网关' })) + .toBeVisible(); + await expect(page.locator('link[rel="canonical"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/zh/'); + await expect(page.locator('link[rel="alternate"][hreflang="en"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/'); + await expect(page.locator('link[rel="alternate"][hreflang="zh"]')) + .toHaveAttribute('href', 'https://apisix.apache.org/zh/'); + await expect(page.getByRole('link', { name: /学习核心概念/ })) + .toHaveAttribute('href', '/zh/learning-center/'); + await expect(page.getByRole('link', { name: /查看 API 网关对比与选型内容/ })) + .toHaveAttribute('href', '/zh/comparisons/'); + await expect(page.locator('main').getByText(/MCP/i)).toHaveCount(0); + await expectNoPageOverflow(page); + await page.goto('/zh/ai-gateway/'); await expect(page.getByRole('heading', { level: 1, name: '面向 LLM 与 AI Agent 的开源 AI 网关' })) .toBeVisible();
