feat(website): drop hash-based router

This commit is contained in:
Simon
2026-02-27 19:46:44 +08:00
parent 5f74f98a97
commit 68d68182e2
28 changed files with 349 additions and 136 deletions

View File

@@ -1,5 +1,6 @@
import { Link } from 'wouter'
import { Heading } from '@/components/Heading'
import { useLanguage } from '@/i18n/context'
export default function LimitationsPage() {
@@ -20,9 +21,9 @@ export default function LimitationsPage() {
<div className="prose prose-lg dark:prose-invert max-w-none">
{/* PageAgent.js vs PageAgentExt */}
<h2 className="text-2xl font-bold mb-3">
<Heading id="pageagent-js-vs-pageagentext" level={2} className="text-2xl font-bold mb-3">
{isZh ? 'PageAgent.js vs PageAgentExt' : 'PageAgent.js vs PageAgentExt'}
</h2>
</Heading>
<p className="text-gray-600 dark:text-gray-300 mb-4">
{isZh
? 'PageAgent.js 是核心库运行在页面内。PageAgentExt 是可选的浏览器扩展,提供额外的浏览器级控制能力。'
@@ -37,7 +38,7 @@ export default function LimitationsPage() {
<th className="text-left py-3 pl-4 font-semibold">
PageAgentExt{' '}
<Link
href="/docs/features/chrome-extension"
href="/features/chrome-extension"
className="text-xs font-normal text-blue-600 dark:text-blue-400 hover:underline"
>
{isZh ? '了解更多' : 'learn more'}
@@ -82,9 +83,9 @@ export default function LimitationsPage() {
</div>
{/* Interaction Limitations */}
<h2 className="text-2xl font-bold mb-3">
<Heading id="interaction-capabilities" level={2} className="text-2xl font-bold mb-3">
{isZh ? '交互能力' : 'Interaction Capabilities'}
</h2>
</Heading>
<div className="bg-gray-50 dark:bg-gray-800 rounded-lg p-6 mb-6">
<div className="grid md:grid-cols-2 gap-6">
<div>
@@ -127,7 +128,9 @@ export default function LimitationsPage() {
</div>
{/* Understanding Limitations */}
<h2 className="text-2xl font-bold mb-3">{isZh ? '理解能力' : 'Understanding'}</h2>
<Heading id="understanding" level={2} className="text-2xl font-bold mb-3">
{isZh ? '理解能力' : 'Understanding'}
</Heading>
<div className="bg-amber-50 dark:bg-amber-900/20 border-l-4 border-amber-400 p-4 mb-6">
<p className="text-amber-800 dark:text-amber-200 mb-2 font-medium">
{isZh
@@ -142,9 +145,9 @@ export default function LimitationsPage() {
</div>
{/* Website Quality */}
<h2 className="text-2xl font-bold mb-3">
<Heading id="page-quality-matters" level={2} className="text-2xl font-bold mb-3">
{isZh ? '网页质量影响' : 'Page Quality Matters'}
</h2>
</Heading>
<div className="bg-gray-50 dark:bg-gray-800 rounded-lg p-6">
<p className="text-gray-600 dark:text-gray-300 text-sm">
{isZh

View File

@@ -1,3 +1,4 @@
import { Heading } from '@/components/Heading'
import { useLanguage } from '@/i18n/context'
export default function Overview() {
@@ -48,9 +49,9 @@ export default function Overview() {
</div>
<section>
<h2 className="text-2xl font-bold mb-4">
<Heading id="what-is-page-agent" level={2} className="text-2xl font-bold mb-4">
{isZh ? '什么是 page-agent' : 'What is page-agent?'}
</h2>
</Heading>
<p className="text-gray-600 dark:text-gray-300 mb-8 leading-relaxed ">
{isZh
@@ -60,7 +61,9 @@ export default function Overview() {
</section>
<section>
<h2 className="text-2xl font-bold mb-3">{isZh ? '核心特性' : 'Core Features'}</h2>
<Heading id="core-features" level={2} className="text-2xl font-bold mb-3">
{isZh ? '核心特性' : 'Core Features'}
</Heading>
<div className="grid md:grid-cols-2 gap-4 mb-8" role="list">
<div className="p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg">
@@ -108,9 +111,9 @@ export default function Overview() {
</div>
</div>
<h2 className="text-2xl font-bold mb-4">
<Heading id="vs-browser-use" level={2} className="text-2xl font-bold mb-4">
{isZh ? '与 browser-use 的区别' : 'vs. browser-use'}
</h2>
</Heading>
<div className="overflow-x-auto mb-8">
<table className="w-full border-collapse border border-gray-300 dark:border-gray-600">
@@ -174,7 +177,9 @@ export default function Overview() {
</table>
</div>
<h2 className="text-2xl font-bold mb-4">{isZh ? '应用场景' : 'Use Cases'}</h2>
<Heading id="use-cases" level={2} className="text-2xl font-bold mb-4">
{isZh ? '应用场景' : 'Use Cases'}
</Heading>
<ul className="space-y-4 mb-8">
<li className="flex items-start space-x-3">

View File

@@ -1,4 +1,5 @@
import CodeEditor from '@/components/CodeEditor'
import { Heading } from '@/components/Heading'
import { CDN_DEMO_CN_URL, CDN_DEMO_URL } from '@/constants'
import { useLanguage } from '@/i18n/context'
@@ -13,7 +14,9 @@ export default function QuickStart() {
{isZh ? '几分钟内完成 page-agent 的集成。' : 'Integrate page-agent in minutes.'}
</p>
<h2 className="text-2xl font-bold mb-3">{isZh ? '安装步骤' : 'Installation Steps'}</h2>
<Heading id="installation-steps" level={2} className="text-2xl font-bold mb-3">
{isZh ? '安装步骤' : 'Installation Steps'}
</Heading>
<div className="space-y-4 mb-6">
{/* Demo CDN - One Line */}

View File

@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'
import { Link } from 'wouter'
import CodeEditor from '@/components/CodeEditor'
import { Heading } from '@/components/Heading'
import { useLanguage } from '@/i18n/context'
// ---------------------------------------------------------------------------
@@ -369,10 +370,14 @@ export default function TroubleshootingPage() {
{/* Main content */}
<div className="flex-1 min-w-0 space-y-12">
{SECTIONS.map((section) => (
<section key={section.id} id={section.id} className="scroll-mt-24">
<h2 className="text-2xl font-bold mb-4 text-gray-900 dark:text-white">
<section key={section.id} className="scroll-mt-24">
<Heading
id={section.id}
level={2}
className="text-2xl font-bold mb-4 text-gray-900 dark:text-white"
>
{isZh ? section.title.zh : section.title.en}
</h2>
</Heading>
{/* Symptom callout */}
<div