From fca19e2dc3172d82186f79882769f9fe6ad1eceb Mon Sep 17 00:00:00 2001 From: "yanqi.zong" Date: Mon, 26 May 2025 11:11:56 -0700 Subject: [PATCH 1/3] feat: update-docs-ci use vercel-deploy --- .github/actions/vercel-build/action.yml | 39 ++++++++++++++++++++++++ .github/actions/vercel-deploy/action.yml | 28 +++++------------ .github/workflows/prerelease.yml | 8 +++-- .github/workflows/update-docs-ci.yml | 27 +++++++++++++--- 4 files changed, 76 insertions(+), 26 deletions(-) create mode 100644 .github/actions/vercel-build/action.yml diff --git a/.github/actions/vercel-build/action.yml b/.github/actions/vercel-build/action.yml new file mode 100644 index 00000000..06389809 --- /dev/null +++ b/.github/actions/vercel-build/action.yml @@ -0,0 +1,39 @@ +name: "Vercel Build" +description: "Build project artifacts using Vercel CLI for deployment." +inputs: + environment: + description: "Vercel environment (production or preview)" + required: true + prodFlag: + description: "Set to --prod for production deploys, empty for preview" + required: false + default: "" + vercel_project_id: + required: true + vercel_org_id: + required: true + vercel_token: + required: true +runs: + using: "composite" + steps: + - name: Pull Vercel Environment Information + run: npx vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.vercel_token }} + env: + VERCEL_PROJECT_ID: ${{ inputs.vercel_project_id }} + VERCEL_ORG_ID: ${{ inputs.vercel_org_id }} + shell: bash + - name: Echo Vercel Environment File + run: | + ls -l .vercel/.env* + for f in .vercel/.env*; do + echo "\n----- $f -----" + cat "$f" + done + shell: bash + - name: Build Project Artifacts + run: npx vercel build ${{ inputs.prodFlag }} --token=${{ inputs.vercel_token }} + env: + VERCEL_PROJECT_ID: ${{ inputs.vercel_project_id }} + VERCEL_ORG_ID: ${{ inputs.vercel_org_id }} + shell: bash diff --git a/.github/actions/vercel-deploy/action.yml b/.github/actions/vercel-deploy/action.yml index 7ff908f4..a7a496eb 100644 --- a/.github/actions/vercel-deploy/action.yml +++ b/.github/actions/vercel-deploy/action.yml @@ -24,26 +24,14 @@ outputs: runs: using: "composite" steps: - - name: Pull Vercel Environment Information - run: npx vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.vercel_token }} - env: - VERCEL_PROJECT_ID: ${{ inputs.vercel_project_id }} - VERCEL_ORG_ID: ${{ inputs.vercel_org_id }} - shell: bash - - name: Echo Vercel Environment File - run: | - ls -l .vercel/.env* - for f in .vercel/.env*; do - echo "\n----- $f -----" - cat "$f" - done - shell: bash - - name: Build Project Artifacts - run: npx vercel build ${{ inputs.prodFlag }} --token=${{ inputs.vercel_token }} - env: - VERCEL_PROJECT_ID: ${{ inputs.vercel_project_id }} - VERCEL_ORG_ID: ${{ inputs.vercel_org_id }} - shell: bash + - name: Build with Vercel + uses: ./.github/actions/vercel-build + with: + environment: ${{ inputs.environment }} + prodFlag: ${{ inputs.prodFlag }} + vercel_project_id: ${{ inputs.vercel_project_id }} + vercel_org_id: ${{ inputs.vercel_org_id }} + vercel_token: ${{ inputs.vercel_token }} - name: Deploy Project Artifacts id: vercel_deploy run: | diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index f4a8d0ac..708adad0 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,12 +1,14 @@ name: Prerelease on: - workflow_dispatch: pull_request: types: - opened - labeled - synchronize + branches-ignore: + - docs/update-translations + - docs/sync-nextjs-documentation permissions: pull-requests: write @@ -14,6 +16,9 @@ permissions: jobs: deploy: + if: | + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'prerelease') runs-on: ubuntu-latest strategy: matrix: @@ -94,7 +99,6 @@ jobs: needs: deploy name: Comment Vercel Previews runs-on: ubuntu-latest - if: always() steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/.github/workflows/update-docs-ci.yml b/.github/workflows/update-docs-ci.yml index d0d7449e..5401c044 100644 --- a/.github/workflows/update-docs-ci.yml +++ b/.github/workflows/update-docs-ci.yml @@ -7,15 +7,34 @@ on: - docs/sync-nextjs-documentation jobs: - translate: + deploy-and-update-index: runs-on: ubuntu-latest + strategy: + matrix: + include: + - locale: en + secret_project_id: VERCEL_PROJECT_EN_ID + orama_private_api_key: ORAMA_PRIVATE_API_KEY_EN + - locale: zh-hans + secret_project_id: VERCEL_PROJECT_ZH_HANS_ID + orama_private_api_key: ORAMA_PRIVATE_API_KEY_ZH_HANS + - locale: zh-hant + secret_project_id: VERCEL_PROJECT_ZH_HANT_ID + orama_private_api_key: ORAMA_PRIVATE_API_KEY_ZH_HANT + name: Build ${{ matrix.locale }} steps: - # Checkout the repository first to access local actions - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 1 - name: Setup Tools - # After pnpm install, apps/docs will execute postinstall: fumadocs-mdx - # Which will generated MDX types (check if the docs frontmatter is correct) uses: ./.github/actions/setup + - name: Build ${{ matrix.locale }} + id: deploy + uses: ./.github/actions/vercel-build + with: + environment: production + prodFlag: --prod + vercel_project_id: ${{ secrets[matrix.secret_project_id] }} + vercel_org_id: ${{ secrets.VERCEL_ORG_ID }} + vercel_token: ${{ secrets.VERCEL_TOKEN }} From 6cc03a47d2417df263877e9591179d36d3a9474f Mon Sep 17 00:00:00 2001 From: "yanqi.zong" Date: Mon, 26 May 2025 11:12:27 -0700 Subject: [PATCH 2/3] feat: update translate prompt --- packages/translate/src/openai.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/translate/src/openai.ts b/packages/translate/src/openai.ts index 256d9f64..13c101ce 100644 --- a/packages/translate/src/openai.ts +++ b/packages/translate/src/openai.ts @@ -70,6 +70,8 @@ General rules: • NEVER start a frontmatter value with inline code (text between \`backticks\`) • This applies to ALL inline code including \`\` tags, \`functions\`, variables, etc. • In frontmatter (sections between --- marks), ALWAYS rearrange sentences so inline code appears AFTER some text +• If a frontmatter value would start with inline code after translation, ALWAYS rewrite the sentence so that some descriptive text comes before the inline code. For example, instead of \`title: \`public\` 目錄中的靜態資源\`, use \`title: 靜態資源(\`public\` 目錄)\` or \`title: 關於 public 目錄的靜態資源\`. +• This rule applies to ALL frontmatter keys (title, description, etc.), not just description. • ALWAYS preserve both the opening and closing frontmatter delimiters (---) - never omit the closing delimiter • Maintain the exact structure of frontmatter - beginning with ---, followed by key-value pairs, and ending with --- • These rules are ABSOLUTELY REQUIRED for proper rendering of the documentation @@ -127,6 +129,20 @@ Examples of MDX Frontmatter Translation: description: 关于 \`\` 组件的 API 参考文档。 (missing closing delimiter) +# Example 4: Do NOT start with inline code in any frontmatter key +✓ CORRECT (Always do this): + Original: + title: \`public\` directory static assets + Translation: + title: 靜態資源(public 目錄) + title: 關於 public 目錄的靜態資源 + +✗ INCORRECT (Never do this): + Original: + title: \`public\` directory static assets + Translation: + title: \`public\` 目錄中的靜態資源 + These rules apply ONLY to frontmatter (between --- marks) and are CRITICAL for proper document rendering. REMEMBER: You must NEVER start with inline code in frontmatter values and ALWAYS include both opening and closing --- delimiters. From 857e9cbe5700d51d75338013f1ba127950f478f9 Mon Sep 17 00:00:00 2001 From: "yanqi.zong" Date: Mon, 26 May 2025 11:13:04 -0700 Subject: [PATCH 3/3] docs: update translation --- .../docs/01-app/01-getting-started/06-css.mdx | 54 +- .../03-server-actions-and-mutations.mdx | 179 +- .../01-getting-started/01-installation.mdx | 341 ++++ .../02-project-structure.mdx | 406 ++++ .../03-layouts-and-pages.mdx | 253 +++ .../01-app/01-getting-started/04-images.mdx | 163 ++ .../01-app/01-getting-started/05-fonts.mdx | 203 ++ .../docs/01-app/01-getting-started/06-css.mdx | 294 +++ .../07-server-and-client-components.mdx | 568 ++++++ .../01-getting-started/08-fetching-data.mdx | 627 +++++++ .../01-getting-started/09-updating-data.mdx | 352 ++++ .../01-getting-started/10-error-handling.mdx | 317 ++++ .../11-partial-prerendering.mdx | 283 +++ .../12-metadata-and-og-images.mdx | 322 ++++ .../01-getting-started/13-deploying.mdx | 82 + .../01-getting-started/14-upgrading.mdx | 54 + .../docs/01-app/01-getting-started/index.mdx | 23 + .../docs/01-app/02-guides/analytics.mdx | 234 +++ .../docs/01-app/02-guides/authentication.mdx | 1652 +++++++++++++++++ .../01-app/02-guides/ci-build-caching.mdx | 171 ++ .../02-guides/content-security-policy.mdx | 299 +++ .../docs/01-app/02-guides/css-in-js.mdx | 323 ++++ .../docs/01-app/02-guides/custom-server.mdx | 123 ++ .../docs/01-app/02-guides/debugging.mdx | 181 ++ .../docs/01-app/02-guides/draft-mode.mdx | 217 +++ .../02-guides/environment-variables.mdx | 280 +++ .../incremental-static-regeneration.mdx | 614 ++++++ .../zh-hant/docs/01-app/02-guides/index.mdx | 65 + .../docs/01-app/02-guides/instrumentation.mdx | 98 + .../01-app/02-guides/internationalization.mdx | 218 +++ .../zh-hant/docs/01-app/02-guides/json-ld.mdx | 79 + .../docs/01-app/02-guides/lazy-loading.mdx | 258 +++ .../01-app/02-guides/local-development.mdx | 188 ++ .../zh-hant/docs/01-app/02-guides/mdx.mdx | 896 +++++++++ .../docs/01-app/02-guides/memory-usage.mdx | 132 ++ .../migrating/app-router-migration.mdx | 935 ++++++++++ .../migrating/from-create-react-app.mdx | 583 ++++++ .../01-app/02-guides/migrating/from-vite.mdx | 552 ++++++ .../docs/01-app/02-guides/migrating/index.mdx | 6 + .../docs/01-app/02-guides/multi-tenant.mdx | 9 + .../docs/01-app/02-guides/multi-zones.mdx | 144 ++ .../docs/01-app/02-guides/open-telemetry.mdx | 370 ++++ .../01-app/02-guides/package-bundling.mdx | 140 ++ .../01-app/02-guides/production-checklist.mdx | 152 ++ .../01-app/02-guides/progressive-web-apps.mdx | 659 +++++++ .../zh-hant/docs/01-app/02-guides/sass.mdx | 125 ++ .../zh-hant/docs/01-app/02-guides/scripts.mdx | 424 +++++ .../docs/01-app/02-guides/self-hosting.mdx | 271 +++ .../02-guides/single-page-applications.mdx | 426 +++++ .../docs/01-app/02-guides/static-exports.mdx | 369 ++++ .../docs/01-app/02-guides/tailwind-css.mdx | 163 ++ .../docs/01-app/02-guides/testing/cypress.mdx | 289 +++ .../docs/01-app/02-guides/testing/index.mdx | 28 + .../docs/01-app/02-guides/testing/jest.mdx | 389 ++++ .../01-app/02-guides/testing/playwright.mdx | 132 ++ .../docs/01-app/02-guides/testing/vitest.mdx | 206 ++ .../02-guides/third-party-libraries.mdx | 435 +++++ .../01-app/02-guides/upgrading/codemods.mdx | 554 ++++++ .../docs/01-app/02-guides/upgrading/index.mdx | 9 + .../01-app/02-guides/upgrading/version-14.mdx | 39 + .../01-app/02-guides/upgrading/version-15.mdx | 604 ++++++ .../zh-hant/docs/01-app/02-guides/videos.mdx | 272 +++ .../01-routing/03-layouts-and-templates.mdx | 308 +++ .../01-routing/04-linking-and-navigating.mdx | 322 ++++ .../01-routing/05-error-handling.mdx | 270 +++ .../06-loading-ui-and-streaming.mdx | 198 ++ .../01-routing/07-redirecting.mdx | 648 +++++++ .../01-routing/08-route-groups.mdx | 29 + .../01-routing/10-dynamic-routes.mdx | 142 ++ .../01-routing/11-parallel-routes.mdx | 480 +++++ .../01-routing/12-intercepting-routes.mdx | 85 + .../01-routing/13-route-handlers.mdx | 617 ++++++ .../01-routing/14-middleware.mdx | 663 +++++++ .../01-routing/index.mdx | 7 + .../02-data-fetching/01-fetching.mdx | 243 +++ .../03-server-actions-and-mutations.mdx | 1018 ++++++++++ .../02-data-fetching/index.mdx | 6 + .../03-building-your-application/index.mdx | 8 + .../docs/01-app/04-deep-dive/caching.mdx | 592 ++++++ .../docs/01-app/04-deep-dive/index.mdx | 6 + .../05-api-reference/01-directives/index.mdx | 8 + .../01-directives/use-cache.mdx | 377 ++++ .../01-directives/use-client.mdx | 125 ++ .../01-directives/use-server.mdx | 163 ++ .../05-api-reference/02-components/font.mdx | 1074 +++++++++++ .../05-api-reference/02-components/form.mdx | 404 ++++ .../05-api-reference/02-components/image.mdx | 1252 +++++++++++++ .../05-api-reference/02-components/index.mdx | 8 + .../05-api-reference/02-components/link.mdx | 1521 +++++++++++++++ .../05-api-reference/02-components/script.mdx | 470 +++++ .../01-metadata/app-icons.mdx | 261 +++ .../03-file-conventions/01-metadata/index.mdx | 18 + .../01-metadata/manifest.mdx | 74 + .../01-metadata/opengraph-image.mdx | 464 +++++ .../01-metadata/robots.mdx | 150 ++ .../01-metadata/sitemap.mdx | 427 +++++ .../03-file-conventions/default.mdx | 60 + .../03-file-conventions/error.mdx | 324 ++++ .../03-file-conventions/forbidden.mdx | 52 + .../03-file-conventions/index.mdx | 6 + .../instrumentation-client.mdx | 48 + .../03-file-conventions/instrumentation.mdx | 141 ++ .../03-file-conventions/layout.mdx | 269 +++ .../03-file-conventions/loading.mdx | 36 + .../03-file-conventions/mdx-components.mdx | 73 + .../03-file-conventions/middleware.mdx | 137 ++ .../03-file-conventions/not-found.mdx | 99 + .../03-file-conventions/page.mdx | 198 ++ .../03-file-conventions/public-folder.mdx | 47 + .../route-segment-config.mdx | 227 +++ .../03-file-conventions/route.mdx | 141 ++ .../03-file-conventions/src-folder.mdx | 37 + .../03-file-conventions/template.mdx | 57 + .../03-file-conventions/unauthorized.mdx | 116 ++ .../05-api-reference/04-functions/after.mdx | 184 ++ .../04-functions/cacheLife.mdx | 256 +++ .../04-functions/cacheTag.mdx | 204 ++ .../04-functions/connection.mdx | 60 + .../05-api-reference/04-functions/cookies.mdx | 291 +++ .../04-functions/draft-mode.mdx | 139 ++ .../05-api-reference/04-functions/fetch.mdx | 101 + .../04-functions/forbidden.mdx | 174 ++ .../04-functions/generate-image-metadata.mdx | 228 +++ .../04-functions/generate-metadata.mdx | 1309 +++++++++++++ .../04-functions/generate-sitemaps.mdx | 81 + .../04-functions/generate-static-params.mdx | 447 +++++ .../04-functions/generate-viewport.mdx | 239 +++ .../05-api-reference/04-functions/headers.mdx | 75 + .../04-functions/image-response.mdx | 214 +++ .../05-api-reference/04-functions/index.mdx | 8 + .../04-functions/next-request.mdx | 125 ++ .../04-functions/next-response.mdx | 148 ++ .../04-functions/not-found.mdx | 41 + .../04-functions/permanentRedirect.mdx | 64 + .../04-functions/redirect.mdx | 208 +++ .../04-functions/revalidatePath.mdx | 124 ++ .../04-functions/revalidateTag.mdx | 79 + .../04-functions/unauthorized.mdx | 236 +++ .../04-functions/unstable_cache.mdx | 100 + .../04-functions/unstable_noStore.mdx | 49 + .../04-functions/unstable_rethrow.mdx | 66 + .../04-functions/use-link-status.mdx | 228 +++ .../04-functions/use-params.mdx | 75 + .../04-functions/use-pathname.mdx | 97 + .../04-functions/use-report-web-vitals.mdx | 228 +++ .../04-functions/use-router.mdx | 164 ++ .../04-functions/use-search-params.mdx | 373 ++++ .../use-selected-layout-segment.mdx | 172 ++ .../use-selected-layout-segments.mdx | 79 + .../04-functions/userAgent.mdx | 81 + .../01-next-config-js/allowedDevOrigins.mdx | 20 + .../05-config/01-next-config-js/appDir.mdx | 13 + .../01-next-config-js/assetPrefix.mdx | 77 + .../01-next-config-js/authInterrupts.mdx | 35 + .../05-config/01-next-config-js/basePath.mdx | 81 + .../05-config/01-next-config-js/cacheLife.mdx | 81 + .../05-config/01-next-config-js/compress.mdx | 24 + .../01-next-config-js/crossOrigin.mdx | 21 + .../01-next-config-js/cssChunking.mdx | 44 + .../01-next-config-js/devIndicators.mdx | 60 + .../05-config/01-next-config-js/distDir.mdx | 22 + .../05-config/01-next-config-js/dynamicIO.mdx | 39 + .../05-config/01-next-config-js/env.mdx | 67 + .../05-config/01-next-config-js/eslint.mdx | 23 + .../01-next-config-js/expireTime.mdx | 23 + .../01-next-config-js/exportPathMap.mdx | 89 + .../01-next-config-js/generateBuildId.mdx | 21 + .../01-next-config-js/generateEtags.mdx | 18 + .../05-config/01-next-config-js/headers.mdx | 585 ++++++ .../01-next-config-js/htmlLimitedBots.mdx | 36 + .../01-next-config-js/httpAgentOptions.mdx | 20 + .../05-config/01-next-config-js/images.mdx | 273 +++ .../incrementalCacheHandlerPath.mdx | 78 + .../05-config/01-next-config-js/index.mdx | 148 ++ .../05-config/01-next-config-js/inlineCss.mdx | 69 + .../05-config/01-next-config-js/logging.mdx | 73 + .../05-config/01-next-config-js/mdxRs.mdx | 23 + .../01-next-config-js/onDemandEntries.mdx | 23 + .../optimizePackageImports.mdx | 48 + .../05-config/01-next-config-js/output.mdx | 136 ++ .../01-next-config-js/pageExtensions.mdx | 59 + .../01-next-config-js/poweredByHeader.mdx | 16 + .../05-config/01-next-config-js/ppr.mdx | 89 + .../productionBrowserSourceMaps.mdx | 23 + .../01-next-config-js/reactCompiler.mdx | 97 + .../reactMaxHeadersLength.mdx | 18 + .../01-next-config-js/reactStrictMode.mdx | 24 + .../05-config/01-next-config-js/redirects.mdx | 324 ++++ .../05-config/01-next-config-js/rewrites.mdx | 470 +++++ .../01-next-config-js/sassOptions.mdx | 48 + .../01-next-config-js/serverActions.mdx | 57 + .../serverComponentsHmrCache.mdx | 38 + .../serverExternalPackages.mdx | 96 + .../01-next-config-js/staleTimes.mdx | 47 + .../01-next-config-js/staticGeneration.mdx | 43 + .../05-config/01-next-config-js/taint.mdx | 228 +++ .../01-next-config-js/trailingSlash.mdx | 35 + .../01-next-config-js/transpilePackages.mdx | 25 + .../05-config/01-next-config-js/turbopack.mdx | 160 ++ .../01-next-config-js/typedRoutes.mdx | 20 + .../01-next-config-js/typescript.mdx | 27 + .../01-next-config-js/urlImports.mdx | 94 + .../05-config/01-next-config-js/useCache.mdx | 31 + .../01-next-config-js/useLightningcss.mdx | 32 + .../01-next-config-js/viewTransition.mdx | 41 + .../webVitalsAttribution.mdx | 29 + .../05-config/01-next-config-js/webpack.mdx | 90 + .../05-config/02-typescript.mdx | 299 +++ .../05-api-reference/05-config/03-eslint.mdx | 328 ++++ .../05-api-reference/05-config/index.mdx | 6 + .../06-cli/create-next-app.mdx | 88 + .../01-app/05-api-reference/06-cli/index.mdx | 13 + .../01-app/05-api-reference/06-cli/next.mdx | 240 +++ .../docs/01-app/05-api-reference/07-edge.mdx | 179 ++ .../01-app/05-api-reference/08-turbopack.mdx | 175 ++ .../docs/01-app/05-api-reference/index.mdx | 8 + .../content/zh-hant/docs/01-app/index.mdx | 13 + .../01-getting-started/01-installation.mdx | 10 + .../02-project-structure.mdx | 10 + .../02-pages/01-getting-started/04-images.mdx | 15 + .../02-pages/01-getting-started/05-fonts.mdx | 15 + .../02-pages/01-getting-started/06-css.mdx | 17 + .../01-getting-started/11-deploying.mdx | 8 + .../02-pages/01-getting-started/index.mdx | 7 + .../zh-hant/docs/02-pages/02-guides/amp.mdx | 159 ++ .../docs/02-pages/02-guides/analytics.mdx | 10 + .../02-pages/02-guides/authentication.mdx | 10 + .../zh-hant/docs/02-pages/02-guides/babel.mdx | 68 + .../02-pages/02-guides/ci-build-caching.mdx | 10 + .../02-guides/content-security-policy.mdx | 10 + .../docs/02-pages/02-guides/css-in-js.mdx | 10 + .../docs/02-pages/02-guides/custom-server.mdx | 10 + .../docs/02-pages/02-guides/debugging.mdx | 10 + .../docs/02-pages/02-guides/draft-mode.mdx | 183 ++ .../02-guides/environment-variables.mdx | 10 + .../incremental-static-regeneration.mdx | 10 + .../zh-hant/docs/02-pages/02-guides/index.mdx | 6 + .../02-pages/02-guides/instrumentation.mdx | 10 + .../02-guides/internationalization.mdx | 352 ++++ .../docs/02-pages/02-guides/lazy-loading.mdx | 10 + .../zh-hant/docs/02-pages/02-guides/mdx.mdx | 10 + .../migrating/app-router-migration.mdx | 10 + .../migrating/from-create-react-app.mdx | 10 + .../02-guides/migrating/from-vite.mdx | 10 + .../02-pages/02-guides/migrating/index.mdx | 6 + .../docs/02-pages/02-guides/multi-zones.mdx | 10 + .../02-pages/02-guides/open-telemetry.mdx | 10 + .../02-pages/02-guides/package-bundling.mdx | 14 + .../docs/02-pages/02-guides/post-css.mdx | 160 ++ .../docs/02-pages/02-guides/preview-mode.mdx | 252 +++ .../02-guides/production-checklist.mdx | 10 + .../zh-hant/docs/02-pages/02-guides/sass.mdx | 10 + .../docs/02-pages/02-guides/scripts.mdx | 10 + .../docs/02-pages/02-guides/self-hosting.mdx | 10 + .../02-pages/02-guides/static-exports.mdx | 10 + .../docs/02-pages/02-guides/tailwind-css.mdx | 9 + .../02-pages/02-guides/testing/cypress.mdx | 10 + .../docs/02-pages/02-guides/testing/index.mdx | 9 + .../docs/02-pages/02-guides/testing/jest.mdx | 10 + .../02-pages/02-guides/testing/playwright.mdx | 10 + .../02-pages/02-guides/testing/vitest.mdx | 10 + .../02-guides/third-party-libraries.mdx | 10 + .../02-pages/02-guides/upgrading/codemods.mdx | 9 + .../02-pages/02-guides/upgrading/index.mdx | 8 + .../02-guides/upgrading/version-10.mdx | 29 + .../02-guides/upgrading/version-11.mdx | 151 ++ .../02-guides/upgrading/version-12.mdx | 155 ++ .../02-guides/upgrading/version-13.mdx | 90 + .../02-guides/upgrading/version-14.mdx | 10 + .../02-guides/upgrading/version-9.mdx | 228 +++ .../01-routing/01-pages-and-layouts.mdx | 215 +++ .../01-routing/02-dynamic-routes.mdx | 66 + .../01-routing/03-linking-and-navigating.mdx | 187 ++ .../01-routing/04-redirecting.mdx | 9 + .../01-routing/05-custom-app.mdx | 91 + .../01-routing/06-custom-document.mdx | 149 ++ .../01-routing/07-api-routes.mdx | 445 +++++ .../01-routing/08-custom-error.mdx | 100 + .../01-routing/11-middleware.mdx | 9 + .../01-routing/index.mdx | 8 + .../02-rendering/01-server-side-rendering.mdx | 34 + .../02-static-site-generation.mdx | 185 ++ .../04-automatic-static-optimization.mdx | 50 + .../02-rendering/05-client-side-rendering.mdx | 74 + .../02-rendering/index.mdx | 23 + .../03-data-fetching/01-get-static-props.mdx | 203 ++ .../03-data-fetching/02-get-static-paths.mdx | 143 ++ .../03-forms-and-mutations.mdx | 410 ++++ .../03-get-server-side-props.mdx | 109 ++ .../03-data-fetching/05-client-side.mdx | 72 + .../03-data-fetching/index.mdx | 39 + .../06-configuring/12-error-handling.mdx | 104 ++ .../06-configuring/index.mdx | 8 + .../03-building-your-application/index.mdx | 9 + .../04-api-reference/01-components/font.mdx | 10 + .../04-api-reference/01-components/form.mdx | 9 + .../04-api-reference/01-components/head.mdx | 68 + .../01-components/image-legacy.mdx | 629 +++++++ .../04-api-reference/01-components/image.mdx | 9 + .../04-api-reference/01-components/index.mdx | 9 + .../04-api-reference/01-components/link.mdx | 9 + .../04-api-reference/01-components/script.mdx | 9 + .../02-file-conventions/index.mdx | 6 + .../02-file-conventions/instrumentation.mdx | 9 + .../02-file-conventions/public-folder.mdx | 10 + .../02-file-conventions/src-folder.mdx | 9 + .../03-functions/get-initial-props.mdx | 60 + .../03-functions/get-server-side-props.mdx | 142 ++ .../03-functions/get-static-paths.mdx | 260 +++ .../03-functions/get-static-props.mdx | 230 +++ .../04-api-reference/03-functions/index.mdx | 9 + .../03-functions/next-request.mdx | 9 + .../03-functions/next-response.mdx | 9 + .../04-api-reference/03-functions/use-amp.mdx | 88 + .../03-functions/use-report-web-vitals.mdx | 9 + .../03-functions/use-router.mdx | 587 ++++++ .../03-functions/userAgent.mdx | 9 + .../01-next-config-js/allowedDevOrigins.mdx | 9 + .../01-next-config-js/assetPrefix.mdx | 9 + .../04-config/01-next-config-js/basePath.mdx | 9 + .../bundlePagesRouterDependencies.mdx | 25 + .../04-config/01-next-config-js/compress.mdx | 9 + .../01-next-config-js/crossOrigin.mdx | 9 + .../01-next-config-js/devIndicators.mdx | 9 + .../04-config/01-next-config-js/distDir.mdx | 9 + .../04-config/01-next-config-js/env.mdx | 9 + .../04-config/01-next-config-js/eslint.mdx | 9 + .../01-next-config-js/exportPathMap.mdx | 9 + .../01-next-config-js/generateBuildId.mdx | 9 + .../01-next-config-js/generateEtags.mdx | 9 + .../04-config/01-next-config-js/headers.mdx | 9 + .../01-next-config-js/httpAgentOptions.mdx | 9 + .../04-config/01-next-config-js/images.mdx | 9 + .../04-config/01-next-config-js/index.mdx | 9 + .../01-next-config-js/onDemandEntries.mdx | 9 + .../optimizePackageImports.mdx | 9 + .../04-config/01-next-config-js/output.mdx | 9 + .../01-next-config-js/pageExtensions.mdx | 9 + .../01-next-config-js/poweredByHeader.mdx | 9 + .../productionBrowserSourceMaps.mdx | 9 + .../01-next-config-js/reactStrictMode.mdx | 9 + .../04-config/01-next-config-js/redirects.mdx | 9 + .../04-config/01-next-config-js/rewrites.mdx | 9 + .../runtime-configuration.mdx | 62 + .../serverExternalPackages.mdx | 92 + .../01-next-config-js/trailingSlash.mdx | 9 + .../01-next-config-js/transpilePackages.mdx | 9 + .../04-config/01-next-config-js/turbo.mdx | 10 + .../01-next-config-js/typescript.mdx | 9 + .../01-next-config-js/urlImports.mdx | 10 + .../01-next-config-js/useLightningcss.mdx | 10 + .../webVitalsAttribution.mdx | 9 + .../04-config/01-next-config-js/webpack.mdx | 10 + .../04-config/01-typescript.mdx | 9 + .../04-api-reference/04-config/02-eslint.mdx | 9 + .../04-api-reference/04-config/index.mdx | 6 + .../05-cli/create-next-app.mdx | 9 + .../04-api-reference/05-cli/index.mdx | 9 + .../02-pages/04-api-reference/05-cli/next.mdx | 9 + .../02-pages/04-api-reference/06-edge.mdx | 9 + .../04-api-reference/08-turbopack.mdx | 7 + .../docs/02-pages/04-api-reference/index.mdx | 6 + .../content/zh-hant/docs/02-pages/index.mdx | 12 + .../docs/03-architecture/accessibility.mdx | 36 + .../docs/03-architecture/fast-refresh.mdx | 58 + .../zh-hant/docs/03-architecture/index.mdx | 8 + .../docs/03-architecture/nextjs-compiler.mdx | 358 ++++ .../03-architecture/supported-browsers.mdx | 68 + .../04-community/01-contribution-guide.mdx | 416 +++++ .../zh-hant/docs/04-community/index.mdx | 33 + .../13/01-getting-started/01-installation.mdx | 194 ++ .../02-project-structure.mdx | 151 ++ .../docs/13/01-getting-started/index.mdx | 6 + .../01-routing/01-defining-routes.mdx | 60 + .../01-routing/02-pages-and-layouts.mdx | 275 +++ .../01-routing/03-linking-and-navigating.mdx | 246 +++ .../01-routing/04-route-groups.mdx | 80 + .../01-routing/05-dynamic-routes.mdx | 127 ++ .../06-loading-ui-and-streaming.mdx | 183 ++ .../01-routing/07-error-handling.mdx | 228 +++ .../01-routing/08-parallel-routes.mdx | 328 ++++ .../01-routing/09-intercepting-routes.mdx | 83 + .../01-routing/10-route-handlers.mdx | 692 +++++++ .../01-routing/11-middleware.mdx | 401 ++++ .../01-routing/12-colocation.mdx | 182 ++ .../01-routing/13-internationalization.mdx | 154 ++ .../01-routing/index.mdx | 162 ++ .../01-fetching-caching-and-revalidating.mdx | 375 ++++ .../02-data-fetching/02-patterns.mdx | 314 ++++ .../03-forms-and-mutations.mdx | 983 ++++++++++ .../02-data-fetching/index.mdx | 6 + .../03-rendering/01-server-components.mdx | 138 ++ .../03-rendering/02-client-components.mdx | 108 ++ .../03-rendering/03-composition-patterns.mdx | 556 ++++++ .../04-edge-and-nodejs-runtimes.mdx | 86 + .../03-rendering/index.mdx | 80 + .../04-caching/index.mdx | 603 ++++++ .../05-styling/01-css-modules.mdx | 297 +++ .../05-styling/02-tailwind-css.mdx | 183 ++ .../05-styling/03-css-in-js.mdx | 313 ++++ .../05-styling/04-sass.mdx | 83 + .../05-styling/index.mdx | 18 + .../06-optimizing/01-images.mdx | 359 ++++ .../06-optimizing/02-fonts.mdx | 644 +++++++ .../06-optimizing/03-scripts.mdx | 377 ++++ .../06-optimizing/04-metadata.mdx | 369 ++++ .../06-optimizing/05-static-assets.mdx | 37 + .../06-optimizing/06-lazy-loading.mdx | 246 +++ .../06-optimizing/07-analytics.mdx | 211 +++ .../06-optimizing/08-open-telemetry.mdx | 339 ++++ .../06-optimizing/09-instrumentation.mdx | 96 + .../06-optimizing/index.mdx | 48 + .../07-configuring/01-typescript.mdx | 304 +++ .../07-configuring/02-eslint.mdx | 301 +++ .../03-environment-variables.mdx | 184 ++ ...04-absolute-imports-and-module-aliases.mdx | 167 ++ .../07-configuring/05-mdx.mdx | 453 +++++ .../07-configuring/06-src-directory.mdx | 34 + .../07-configuring/11-draft-mode.mdx | 246 +++ .../15-content-security-policy.mdx | 199 ++ .../07-configuring/index.mdx | 10 + .../08-deploying/01-static-exports.mdx | 371 ++++ .../08-deploying/index.mdx | 170 ++ .../08-upgrading/03-from-vite.mdx | 467 +++++ .../09-upgrading/01-codemods.mdx | 321 ++++ .../09-upgrading/02-app-router-migration.mdx | 917 +++++++++ .../09-upgrading/index.mdx | 9 + .../01-building-your-application/index.mdx | 24 + .../02-api-reference/01-components/font.mdx | 356 ++++ .../02-api-reference/01-components/image.mdx | 815 ++++++++ .../02-api-reference/01-components/index.mdx | 8 + .../02-api-reference/01-components/link.mdx | 456 +++++ .../02-api-reference/01-components/script.mdx | 456 +++++ .../01-metadata/app-icons.mdx | 285 +++ .../02-file-conventions/01-metadata/index.mdx | 13 + .../01-metadata/manifest.mdx | 72 + .../01-metadata/opengraph-image.mdx | 430 +++++ .../01-metadata/robots.mdx | 88 + .../01-metadata/sitemap.mdx | 143 ++ .../02-file-conventions/default.mdx | 8 + .../02-file-conventions/error.mdx | 161 ++ .../02-file-conventions/index.mdx | 6 + .../02-file-conventions/layout.mdx | 135 ++ .../02-file-conventions/loading.mdx | 36 + .../02-file-conventions/not-found.mdx | 93 + .../02-file-conventions/page.mdx | 59 + .../route-segment-config.mdx | 226 +++ .../02-file-conventions/route.mdx | 80 + .../02-file-conventions/template.mdx | 57 + .../02-api-reference/04-functions/cookies.mdx | 159 ++ .../04-functions/draft-mode.mdx | 28 + .../02-api-reference/04-functions/fetch.mdx | 109 ++ .../04-functions/generate-image-metadata.mdx | 230 +++ .../04-functions/generate-metadata.mdx | 1161 ++++++++++++ .../04-functions/generate-static-params.mdx | 310 ++++ .../02-api-reference/04-functions/headers.mdx | 90 + .../04-functions/image-response.mdx | 46 + .../02-api-reference/04-functions/index.mdx | 8 + .../04-functions/next-request.mdx | 91 + .../04-functions/next-response.mdx | 146 ++ .../04-functions/not-found.mdx | 40 + .../04-functions/permanentRedirect.mdx | 60 + .../04-functions/redirect.mdx | 64 + .../04-functions/revalidatePath.mdx | 113 ++ .../04-functions/revalidateTag.mdx | 69 + .../04-functions/server-actions.mdx | 177 ++ .../04-functions/use-params.mdx | 75 + .../04-functions/use-pathname.mdx | 96 + .../04-functions/use-report-web-vitals.mdx | 224 +++ .../04-functions/use-router.mdx | 163 ++ .../04-functions/use-search-params.mdx | 367 ++++ .../use-selected-layout-segment.mdx | 172 ++ .../use-selected-layout-segments.mdx | 79 + .../05-next-config-js/appDir.mdx | 12 + .../05-next-config-js/assetPrefix.mdx | 68 + .../05-next-config-js/basePath.mdx | 81 + .../05-next-config-js/compress.mdx | 18 + .../05-next-config-js/devIndicators.mdx | 56 + .../05-next-config-js/distDir.mdx | 22 + .../05-next-config-js/env.mdx | 73 + .../05-next-config-js/eslint.mdx | 23 + .../05-next-config-js/exportPathMap.mdx | 96 + .../05-next-config-js/generateBuildId.mdx | 21 + .../05-next-config-js/generateEtags.mdx | 18 + .../05-next-config-js/headers.mdx | 514 +++++ .../05-next-config-js/httpAgentOptions.mdx | 20 + .../05-next-config-js/images.mdx | 187 ++ .../incrementalCacheHandlerPath.mdx | 69 + .../05-next-config-js/index.mdx | 88 + .../05-next-config-js/mdxRs.mdx | 22 + .../05-next-config-js/onDemandEntries.mdx | 23 + .../optimizePackageImports.mdx | 22 + .../05-next-config-js/output.mdx | 143 ++ .../05-next-config-js/pageExtensions.mdx | 62 + .../05-next-config-js/poweredByHeader.mdx | 16 + .../productionBrowserSourceMaps.mdx | 23 + .../05-next-config-js/reactStrictMode.mdx | 24 + .../05-next-config-js/redirects.mdx | 322 ++++ .../05-next-config-js/rewrites.mdx | 477 +++++ .../serverComponentsExternalPackages.mdx | 71 + .../05-next-config-js/trailingSlash.mdx | 26 + .../05-next-config-js/transpilePackages.mdx | 25 + .../05-next-config-js/turbo.mdx | 74 + .../05-next-config-js/typedRoutes.mdx | 20 + .../05-next-config-js/typescript.mdx | 27 + .../05-next-config-js/urlImports.mdx | 93 + .../webVitalsAttribution.mdx | 26 + .../05-next-config-js/webpack.mdx | 92 + .../02-api-reference/06-create-next-app.mdx | 132 ++ .../13/02-app/02-api-reference/07-edge.mdx | 168 ++ .../02-app/02-api-reference/08-next-cli.mdx | 176 ++ .../docs/13/02-app/02-api-reference/index.mdx | 8 + .../content/zh-hant/docs/13/02-app/index.mdx | 72 + .../01-routing/01-pages-and-layouts.mdx | 215 +++ .../01-routing/02-dynamic-routes.mdx | 66 + .../01-routing/03-linking-and-navigating.mdx | 200 ++ .../01-routing/04-custom-app.mdx | 91 + .../01-routing/05-custom-document.mdx | 149 ++ .../01-routing/06-custom-error.mdx | 100 + .../01-routing/07-api-routes.mdx | 425 +++++ .../01-routing/08-internationalization.mdx | 353 ++++ .../01-routing/09-authenticating.mdx | 143 ++ .../01-routing/10-middleware.mdx | 9 + .../01-routing/index.mdx | 8 + .../02-rendering/01-server-side-rendering.mdx | 34 + .../02-static-site-generation.mdx | 176 ++ .../03-incremental-static-regeneration.mdx | 197 ++ .../04-automatic-static-optimization.mdx | 50 + .../02-rendering/05-client-side-rendering.mdx | 74 + .../06-edge-and-nodejs-runtimes.mdx | 9 + .../02-rendering/index.mdx | 23 + .../03-data-fetching/01-get-static-props.mdx | 201 ++ .../03-data-fetching/02-get-static-paths.mdx | 143 ++ .../03-forms-and-mutations.mdx | 10 + .../03-get-server-side-props.mdx | 146 ++ .../04-incremental-static-regeneration.mdx | 197 ++ .../03-data-fetching/05-client-side.mdx | 72 + .../03-data-fetching/index.mdx | 28 + .../04-styling/01-css-modules.mdx | 9 + .../04-styling/02-tailwind-css.mdx | 9 + .../04-styling/03-css-in-js.mdx | 9 + .../04-styling/04-sass.mdx | 9 + .../04-styling/index.mdx | 9 + .../05-optimizing/01-images.mdx | 10 + .../05-optimizing/02-fonts.mdx | 10 + .../05-optimizing/03-scripts.mdx | 10 + .../05-optimizing/05-static-assets.mdx | 9 + .../05-optimizing/06-lazy-loading.mdx | 9 + .../05-optimizing/07-analytics.mdx | 9 + .../05-optimizing/08-open-telemetry.mdx | 9 + .../05-optimizing/09-instrumentation.mdx | 9 + .../05-optimizing/10-testing.mdx | 543 ++++++ .../05-optimizing/index.mdx | 10 + .../06-configuring/01-typescript.mdx | 9 + .../06-configuring/02-eslint.mdx | 9 + .../03-environment-variables.mdx | 9 + ...04-absolute-imports-and-module-aliases.mdx | 9 + .../06-configuring/05-src-directory.mdx | 9 + .../06-configuring/06-mdx.mdx | 9 + .../06-configuring/07-amp.mdx | 158 ++ .../06-configuring/08-babel.mdx | 67 + .../06-configuring/09-post-css.mdx | 166 ++ .../06-configuring/10-custom-server.mdx | 120 ++ .../06-configuring/11-draft-mode.mdx | 182 ++ .../06-configuring/12-error-handling.mdx | 104 ++ .../06-configuring/13-debugging.mdx | 116 ++ .../06-configuring/14-preview-mode.mdx | 241 +++ .../15-content-security-policy.mdx | 9 + .../06-configuring/index.mdx | 9 + .../07-deploying/01-production-checklist.mdx | 145 ++ .../07-deploying/02-static-exports.mdx | 9 + .../07-deploying/03-multi-zones.mdx | 35 + .../07-deploying/04-ci-build-caching.mdx | 130 ++ .../07-deploying/index.mdx | 9 + .../08-upgrading/01-codemods.mdx | 9 + .../08-upgrading/02-app-router-migration.mdx | 9 + .../08-upgrading/03-version-13.mdx | 81 + .../08-upgrading/04-version-12.mdx | 146 ++ .../08-upgrading/05-version-11.mdx | 138 ++ .../08-upgrading/06-version-10.mdx | 16 + .../08-upgrading/07-version-9.mdx | 224 +++ .../08-upgrading/index.mdx | 9 + .../01-building-your-application/index.mdx | 9 + .../02-api-reference/01-components/font.mdx | 10 + .../02-api-reference/01-components/head.mdx | 65 + .../01-components/image-legacy.mdx | 578 ++++++ .../02-api-reference/01-components/image.mdx | 9 + .../02-api-reference/01-components/index.mdx | 9 + .../02-api-reference/01-components/link.mdx | 9 + .../02-api-reference/01-components/script.mdx | 9 + .../02-functions/get-initial-props.mdx | 60 + .../02-functions/get-server-side-props.mdx | 132 ++ .../02-functions/get-static-paths.mdx | 260 +++ .../02-functions/get-static-props.mdx | 229 +++ .../02-api-reference/02-functions/index.mdx | 9 + .../02-functions/next-server.mdx | 172 ++ .../02-api-reference/02-functions/use-amp.mdx | 88 + .../02-functions/use-report-web-vitals.mdx | 9 + .../02-functions/use-router.mdx | 530 ++++++ .../03-next-config-js/assetPrefix.mdx | 9 + .../03-next-config-js/basePath.mdx | 9 + .../03-next-config-js/compress.mdx | 9 + .../03-next-config-js/devIndicators.mdx | 9 + .../03-next-config-js/distDir.mdx | 9 + .../03-next-config-js/env.mdx | 9 + .../03-next-config-js/eslint.mdx | 9 + .../03-next-config-js/exportPathMap.mdx | 9 + .../03-next-config-js/generateBuildId.mdx | 9 + .../03-next-config-js/generateEtags.mdx | 9 + .../03-next-config-js/headers.mdx | 9 + .../03-next-config-js/httpAgentOptions.mdx | 9 + .../03-next-config-js/images.mdx | 9 + .../03-next-config-js/index.mdx | 9 + .../03-next-config-js/onDemandEntries.mdx | 9 + .../03-next-config-js/output.mdx | 9 + .../03-next-config-js/pageExtensions.mdx | 9 + .../03-next-config-js/poweredByHeader.mdx | 9 + .../productionBrowserSourceMaps.mdx | 9 + .../03-next-config-js/reactStrictMode.mdx | 9 + .../03-next-config-js/redirects.mdx | 9 + .../03-next-config-js/rewrites.mdx | 9 + .../runtime-configuration.mdx | 58 + .../03-next-config-js/trailingSlash.mdx | 9 + .../03-next-config-js/transpilePackages.mdx | 9 + .../03-next-config-js/turbo.mdx | 10 + .../03-next-config-js/typescript.mdx | 9 + .../03-next-config-js/urlImports.mdx | 9 + .../webVitalsAttribution.mdx | 9 + .../03-next-config-js/webpack.mdx | 10 + .../02-api-reference/04-create-next-app.mdx | 9 + .../03-pages/02-api-reference/05-next-cli.mdx | 9 + .../13/03-pages/02-api-reference/06-edge.mdx | 9 + .../13/03-pages/02-api-reference/index.mdx | 6 + .../zh-hant/docs/13/03-pages/index.mdx | 10 + .../docs/13/04-architecture/accessibility.mdx | 36 + .../docs/13/04-architecture/fast-refresh.mdx | 65 + .../zh-hant/docs/13/04-architecture/index.mdx | 8 + .../13/04-architecture/nextjs-compiler.mdx | 312 ++++ .../13/04-architecture/supported-browsers.mdx | 72 + .../docs/13/04-architecture/turbopack.mdx | 31 + .../13/05-community/01-contribution-guide.mdx | 410 ++++ .../zh-hant/docs/13/05-community/index.mdx | 33 + apps/docs/content/zh-hant/docs/13/index.mdx | 59 + .../14/01-getting-started/01-installation.mdx | 196 ++ .../02-project-structure.mdx | 169 ++ .../docs/14/01-getting-started/index.mdx | 6 + .../01-routing/01-defining-routes.mdx | 60 + .../01-routing/02-pages-and-layouts.mdx | 271 +++ .../01-routing/03-linking-and-navigating.mdx | 417 +++++ .../04-loading-ui-and-streaming.mdx | 186 ++ .../01-routing/05-error-handling.mdx | 232 +++ .../01-routing/06-redirecting.mdx | 623 +++++++ .../01-routing/07-route-groups.mdx | 80 + .../01-routing/08-colocation.mdx | 182 ++ .../01-routing/09-dynamic-routes.mdx | 128 ++ .../01-routing/10-parallel-routes.mdx | 466 +++++ .../01-routing/11-intercepting-routes.mdx | 85 + .../01-routing/12-route-handlers.mdx | 730 ++++++++ .../01-routing/13-middleware.mdx | 584 ++++++ .../01-routing/14-internationalization.mdx | 155 ++ .../01-routing/index.mdx | 162 ++ .../01-fetching-caching-and-revalidating.mdx | 310 ++++ .../02-server-actions-and-mutations.mdx | 1000 ++++++++++ .../02-data-fetching/03-patterns.mdx | 405 ++++ .../02-data-fetching/index.mdx | 6 + .../03-rendering/01-server-components.mdx | 135 ++ .../03-rendering/02-client-components.mdx | 108 ++ .../03-rendering/03-composition-patterns.mdx | 560 ++++++ .../04-edge-and-nodejs-runtimes.mdx | 86 + .../03-rendering/index.mdx | 80 + .../04-caching/index.mdx | 583 ++++++ .../05-styling/01-css-modules.mdx | 357 ++++ .../05-styling/02-tailwind-css.mdx | 183 ++ .../05-styling/03-css-in-js.mdx | 324 ++++ .../05-styling/04-sass.mdx | 82 + .../05-styling/index.mdx | 18 + .../06-optimizing/01-images.mdx | 375 ++++ .../06-optimizing/02-videos.mdx | 275 +++ .../06-optimizing/03-fonts.mdx | 644 +++++++ .../06-optimizing/04-metadata.mdx | 370 ++++ .../06-optimizing/05-scripts.mdx | 377 ++++ .../06-optimizing/06-bundle-analyzer.mdx | 51 + .../06-optimizing/07-lazy-loading.mdx | 246 +++ .../06-optimizing/08-analytics.mdx | 216 +++ .../06-optimizing/09-instrumentation.mdx | 99 + .../06-optimizing/10-open-telemetry.mdx | 352 ++++ .../06-optimizing/11-static-assets.mdx | 52 + .../12-third-party-libraries.mdx | 428 +++++ .../06-optimizing/13-memory-usage.mdx | 98 + .../06-optimizing/index.mdx | 48 + .../07-configuring/01-typescript.mdx | 326 ++++ .../07-configuring/02-eslint.mdx | 314 ++++ .../03-environment-variables.mdx | 235 +++ ...04-absolute-imports-and-module-aliases.mdx | 167 ++ .../07-configuring/05-mdx.mdx | 451 +++++ .../07-configuring/06-src-directory.mdx | 36 + .../07-configuring/11-draft-mode.mdx | 246 +++ .../15-content-security-policy.mdx | 249 +++ .../07-configuring/index.mdx | 10 + .../08-testing/01-vitest.mdx | 208 +++ .../08-testing/02-jest.mdx | 387 ++++ .../08-testing/03-playwright.mdx | 134 ++ .../08-testing/04-cypress.mdx | 290 +++ .../08-testing/index.mdx | 28 + .../09-authentication/index.mdx | 892 +++++++++ .../10-deploying/01-production-checklist.mdx | 167 ++ .../10-deploying/02-static-exports.mdx | 372 ++++ .../10-deploying/03-multi-zones.mdx | 91 + .../10-deploying/index.mdx | 284 +++ .../11-upgrading/01-codemods.mdx | 380 ++++ .../11-upgrading/02-app-router-migration.mdx | 919 +++++++++ .../11-upgrading/03-version-14.mdx | 38 + .../11-upgrading/04-from-vite.mdx | 555 ++++++ .../11-upgrading/05-from-create-react-app.mdx | 550 ++++++ .../11-upgrading/index.mdx | 9 + .../01-building-your-application/index.mdx | 24 + .../02-api-reference/01-components/font.mdx | 356 ++++ .../02-api-reference/01-components/image.mdx | 1086 +++++++++++ .../02-api-reference/01-components/index.mdx | 8 + .../02-api-reference/01-components/link.mdx | 511 +++++ .../02-api-reference/01-components/script.mdx | 470 +++++ .../01-metadata/app-icons.mdx | 285 +++ .../02-file-conventions/01-metadata/index.mdx | 13 + .../01-metadata/manifest.mdx | 72 + .../01-metadata/opengraph-image.mdx | 430 +++++ .../01-metadata/robots.mdx | 148 ++ .../01-metadata/sitemap.mdx | 300 +++ .../02-file-conventions/default.mdx | 41 + .../02-file-conventions/error.mdx | 161 ++ .../02-file-conventions/index.mdx | 6 + .../02-file-conventions/instrumentation.mdx | 55 + .../02-file-conventions/layout.mdx | 133 ++ .../02-file-conventions/loading.mdx | 36 + .../02-file-conventions/middleware.mdx | 137 ++ .../02-file-conventions/not-found.mdx | 95 + .../02-file-conventions/page.mdx | 59 + .../route-segment-config.mdx | 227 +++ .../02-file-conventions/route.mdx | 94 + .../02-file-conventions/template.mdx | 57 + .../02-api-reference/04-functions/cookies.mdx | 159 ++ .../04-functions/draft-mode.mdx | 28 + .../02-api-reference/04-functions/fetch.mdx | 109 ++ .../04-functions/generate-image-metadata.mdx | 230 +++ .../04-functions/generate-metadata.mdx | 1199 ++++++++++++ .../04-functions/generate-sitemaps.mdx | 76 + .../04-functions/generate-static-params.mdx | 328 ++++ .../04-functions/generate-viewport.mdx | 240 +++ .../02-api-reference/04-functions/headers.mdx | 129 ++ .../04-functions/image-response.mdx | 47 + .../02-api-reference/04-functions/index.mdx | 8 + .../04-functions/next-request.mdx | 153 ++ .../04-functions/next-response.mdx | 148 ++ .../04-functions/not-found.mdx | 40 + .../04-functions/permanentRedirect.mdx | 63 + .../04-functions/redirect.mdx | 145 ++ .../04-functions/revalidatePath.mdx | 125 ++ .../04-functions/revalidateTag.mdx | 80 + .../04-functions/unstable_cache.mdx | 50 + .../04-functions/unstable_noStore.mdx | 45 + .../04-functions/use-params.mdx | 75 + .../04-functions/use-pathname.mdx | 96 + .../04-functions/use-report-web-vitals.mdx | 230 +++ .../04-functions/use-router.mdx | 163 ++ .../04-functions/use-search-params.mdx | 369 ++++ .../use-selected-layout-segment.mdx | 174 ++ .../use-selected-layout-segments.mdx | 79 + .../04-functions/userAgent.mdx | 73 + .../05-next-config-js/appDir.mdx | 12 + .../05-next-config-js/assetPrefix.mdx | 78 + .../05-next-config-js/basePath.mdx | 81 + .../05-next-config-js/compress.mdx | 37 + .../05-next-config-js/crossOrigin.mdx | 21 + .../05-next-config-js/devIndicators.mdx | 56 + .../05-next-config-js/distDir.mdx | 22 + .../05-next-config-js/env.mdx | 66 + .../05-next-config-js/eslint.mdx | 24 + .../05-next-config-js/exportPathMap.mdx | 96 + .../05-next-config-js/generateBuildId.mdx | 21 + .../05-next-config-js/generateEtags.mdx | 18 + .../05-next-config-js/headers.mdx | 543 ++++++ .../05-next-config-js/httpAgentOptions.mdx | 20 + .../05-next-config-js/images.mdx | 229 +++ .../incrementalCacheHandlerPath.mdx | 61 + .../05-next-config-js/index.mdx | 98 + .../05-next-config-js/instrumentationHook.mdx | 23 + .../05-next-config-js/logging.mdx | 22 + .../05-next-config-js/mdxRs.mdx | 22 + .../05-next-config-js/onDemandEntries.mdx | 23 + .../optimizePackageImports.mdx | 48 + .../05-next-config-js/output.mdx | 143 ++ .../05-next-config-js/pageExtensions.mdx | 62 + .../partial-prerendering.mdx | 36 + .../05-next-config-js/poweredByHeader.mdx | 16 + .../productionBrowserSourceMaps.mdx | 23 + .../05-next-config-js/reactStrictMode.mdx | 24 + .../05-next-config-js/redirects.mdx | 322 ++++ .../05-next-config-js/rewrites.mdx | 478 +++++ .../05-next-config-js/serverActions.mdx | 57 + .../serverComponentsExternalPackages.mdx | 75 + .../05-next-config-js/staleTimes.mdx | 49 + .../05-next-config-js/trailingSlash.mdx | 28 + .../05-next-config-js/transpilePackages.mdx | 25 + .../05-next-config-js/turbo.mdx | 106 ++ .../05-next-config-js/typedRoutes.mdx | 20 + .../05-next-config-js/typescript.mdx | 28 + .../05-next-config-js/urlImports.mdx | 93 + .../webVitalsAttribution.mdx | 26 + .../05-next-config-js/webpack.mdx | 90 + .../06-cli/create-next-app.mdx | 87 + .../02-app/02-api-reference/06-cli/index.mdx | 13 + .../02-app/02-api-reference/06-cli/next.mdx | 240 +++ .../14/02-app/02-api-reference/07-edge.mdx | 167 ++ .../docs/14/02-app/02-api-reference/index.mdx | 8 + .../content/zh-hant/docs/14/02-app/index.mdx | 74 + .../01-routing/01-pages-and-layouts.mdx | 215 +++ .../01-routing/02-dynamic-routes.mdx | 66 + .../01-routing/03-linking-and-navigating.mdx | 193 ++ .../01-routing/04-redirecting.mdx | 9 + .../01-routing/05-custom-app.mdx | 91 + .../01-routing/06-custom-document.mdx | 149 ++ .../01-routing/07-api-routes.mdx | 425 +++++ .../01-routing/08-custom-error.mdx | 100 + .../01-routing/10-internationalization.mdx | 353 ++++ .../01-routing/11-middleware.mdx | 9 + .../01-routing/index.mdx | 8 + .../02-rendering/01-server-side-rendering.mdx | 34 + .../02-static-site-generation.mdx | 175 ++ .../04-automatic-static-optimization.mdx | 50 + .../02-rendering/05-client-side-rendering.mdx | 74 + .../06-edge-and-nodejs-runtimes.mdx | 9 + .../02-rendering/index.mdx | 23 + .../03-data-fetching/01-get-static-props.mdx | 203 ++ .../03-data-fetching/02-get-static-paths.mdx | 143 ++ .../03-forms-and-mutations.mdx | 408 ++++ .../03-get-server-side-props.mdx | 125 ++ .../04-incremental-static-regeneration.mdx | 181 ++ .../03-data-fetching/05-client-side.mdx | 72 + .../03-data-fetching/index.mdx | 28 + .../04-styling/01-css-modules.mdx | 9 + .../04-styling/02-tailwind-css.mdx | 9 + .../04-styling/03-css-in-js.mdx | 9 + .../04-styling/04-sass.mdx | 9 + .../04-styling/index.mdx | 9 + .../05-optimizing/01-images.mdx | 10 + .../05-optimizing/02-fonts.mdx | 10 + .../05-optimizing/03-scripts.mdx | 10 + .../05-optimizing/05-static-assets.mdx | 9 + .../05-optimizing/06-bundle-analyzer.mdx | 13 + .../05-optimizing/07-analytics.mdx | 9 + .../05-optimizing/08-lazy-loading.mdx | 9 + .../05-optimizing/09-instrumentation.mdx | 9 + .../05-optimizing/10-open-telemetry.mdx | 9 + .../11-third-party-libraries.mdx | 9 + .../05-optimizing/index.mdx | 10 + .../06-configuring/01-typescript.mdx | 9 + .../06-configuring/02-eslint.mdx | 9 + .../03-environment-variables.mdx | 9 + ...04-absolute-imports-and-module-aliases.mdx | 9 + .../06-configuring/05-src-directory.mdx | 9 + .../06-configuring/06-mdx.mdx | 10 + .../06-configuring/07-amp.mdx | 155 ++ .../06-configuring/08-babel.mdx | 67 + .../06-configuring/09-post-css.mdx | 166 ++ .../06-configuring/10-custom-server.mdx | 121 ++ .../06-configuring/11-draft-mode.mdx | 182 ++ .../06-configuring/12-error-handling.mdx | 104 ++ .../06-configuring/13-debugging.mdx | 120 ++ .../06-configuring/14-preview-mode.mdx | 241 +++ .../15-content-security-policy.mdx | 9 + .../06-configuring/index.mdx | 9 + .../07-testing/01-vitest.mdx | 10 + .../07-testing/02-jest.mdx | 10 + .../07-testing/03-playwright.mdx | 10 + .../07-testing/04-cypress.mdx | 10 + .../07-testing/index.mdx | 9 + .../08-authentication/index.mdx | 9 + .../09-deploying/01-production-checklist.mdx | 9 + .../09-deploying/02-static-exports.mdx | 9 + .../09-deploying/03-multi-zones.mdx | 9 + .../09-deploying/04-ci-build-caching.mdx | 170 ++ .../09-deploying/index.mdx | 9 + .../10-upgrading/01-codemods.mdx | 9 + .../10-upgrading/02-app-router-migration.mdx | 9 + .../10-upgrading/03-from-vite.mdx | 9 + .../10-upgrading/04-from-create-react-app.mdx | 9 + .../10-upgrading/05-version-14.mdx | 9 + .../10-upgrading/06-version-13.mdx | 89 + .../10-upgrading/07-version-12.mdx | 154 ++ .../10-upgrading/08-version-11.mdx | 150 ++ .../10-upgrading/09-version-10.mdx | 28 + .../10-upgrading/10-version-9.mdx | 236 +++ .../10-upgrading/index.mdx | 9 + .../01-building-your-application/index.mdx | 9 + .../02-api-reference/01-components/font.mdx | 10 + .../02-api-reference/01-components/head.mdx | 74 + .../01-components/image-legacy.mdx | 603 ++++++ .../02-api-reference/01-components/image.mdx | 9 + .../02-api-reference/01-components/index.mdx | 9 + .../02-api-reference/01-components/link.mdx | 9 + .../02-api-reference/01-components/script.mdx | 9 + .../02-functions/get-initial-props.mdx | 60 + .../02-functions/get-server-side-props.mdx | 142 ++ .../02-functions/get-static-paths.mdx | 260 +++ .../02-functions/get-static-props.mdx | 230 +++ .../02-api-reference/02-functions/index.mdx | 9 + .../02-functions/next-request.mdx | 9 + .../02-functions/next-response.mdx | 9 + .../02-api-reference/02-functions/use-amp.mdx | 88 + .../02-functions/use-report-web-vitals.mdx | 9 + .../02-functions/use-router.mdx | 516 +++++ .../02-functions/userAgent.mdx | 9 + .../03-next-config-js/assetPrefix.mdx | 9 + .../03-next-config-js/basePath.mdx | 9 + .../03-next-config-js/compress.mdx | 9 + .../03-next-config-js/crossOrigin.mdx | 9 + .../03-next-config-js/devIndicators.mdx | 9 + .../03-next-config-js/distDir.mdx | 9 + .../03-next-config-js/env.mdx | 9 + .../03-next-config-js/eslint.mdx | 9 + .../03-next-config-js/exportPathMap.mdx | 9 + .../03-next-config-js/generateBuildId.mdx | 9 + .../03-next-config-js/generateEtags.mdx | 9 + .../03-next-config-js/headers.mdx | 9 + .../03-next-config-js/httpAgentOptions.mdx | 9 + .../03-next-config-js/images.mdx | 9 + .../03-next-config-js/index.mdx | 9 + .../03-next-config-js/instrumentationHook.mdx | 9 + .../03-next-config-js/onDemandEntries.mdx | 9 + .../optimizePackageImports.mdx | 9 + .../03-next-config-js/output.mdx | 9 + .../03-next-config-js/pageExtensions.mdx | 9 + .../03-next-config-js/poweredByHeader.mdx | 9 + .../productionBrowserSourceMaps.mdx | 9 + .../03-next-config-js/reactStrictMode.mdx | 9 + .../03-next-config-js/redirects.mdx | 9 + .../03-next-config-js/rewrites.mdx | 9 + .../runtime-configuration.mdx | 62 + .../03-next-config-js/trailingSlash.mdx | 9 + .../03-next-config-js/transpilePackages.mdx | 9 + .../03-next-config-js/turbo.mdx | 10 + .../03-next-config-js/typescript.mdx | 9 + .../03-next-config-js/urlImports.mdx | 9 + .../webVitalsAttribution.mdx | 9 + .../03-next-config-js/webpack.mdx | 10 + .../14/03-pages/02-api-reference/05-edge.mdx | 9 + .../06-cli/create-next-app.mdx | 9 + .../02-api-reference/06-cli/index.mdx | 9 + .../03-pages/02-api-reference/06-cli/next.mdx | 9 + .../14/03-pages/02-api-reference/index.mdx | 6 + .../zh-hant/docs/14/03-pages/index.mdx | 10 + .../docs/14/04-architecture/accessibility.mdx | 36 + .../docs/14/04-architecture/fast-refresh.mdx | 58 + .../zh-hant/docs/14/04-architecture/index.mdx | 8 + .../14/04-architecture/nextjs-compiler.mdx | 321 ++++ .../14/04-architecture/supported-browsers.mdx | 68 + .../docs/14/04-architecture/turbopack.mdx | 64 + .../14/05-community/01-contribution-guide.mdx | 410 ++++ .../zh-hant/docs/14/05-community/index.mdx | 33 + apps/docs/content/zh-hant/docs/14/index.mdx | 59 + apps/docs/content/zh-hant/docs/index.mdx | 60 + 960 files changed, 132713 insertions(+), 116 deletions(-) create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/01-installation.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/02-project-structure.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/03-layouts-and-pages.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/04-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/05-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/06-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/07-server-and-client-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/08-fetching-data.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/09-updating-data.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/10-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/11-partial-prerendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/12-metadata-and-og-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/13-deploying.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/14-upgrading.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/01-getting-started/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/authentication.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/ci-build-caching.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/custom-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/debugging.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/incremental-static-regeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/json-ld.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/local-development.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/memory-usage.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/migrating/app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/migrating/from-create-react-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/migrating/from-vite.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/migrating/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/multi-tenant.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/multi-zones.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/package-bundling.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/production-checklist.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/progressive-web-apps.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/self-hosting.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/single-page-applications.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/testing/cypress.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/testing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/testing/jest.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/testing/playwright.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/testing/vitest.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/third-party-libraries.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/upgrading/codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/upgrading/version-14.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/upgrading/version-15.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/02-guides/videos.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/03-layouts-and-templates.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/04-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/05-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/06-loading-ui-and-streaming.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/07-redirecting.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/08-route-groups.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/10-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/11-parallel-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/12-intercepting-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/13-route-handlers.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/14-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/02-data-fetching/01-fetching.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/02-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/03-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/04-deep-dive/caching.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/04-deep-dive/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/01-directives/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/01-directives/use-cache.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/01-directives/use-client.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/01-directives/use-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/form.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/02-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/app-icons.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/manifest.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/opengraph-image.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/robots.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/01-metadata/sitemap.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/default.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/error.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/forbidden.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/instrumentation-client.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/layout.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/mdx-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/page.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/public-folder.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/route-segment-config.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/route.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/src-folder.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/template.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/03-file-conventions/unauthorized.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/after.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/cacheLife.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/cacheTag.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/connection.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/cookies.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/fetch.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/forbidden.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/generate-image-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/generate-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/generate-sitemaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/generate-static-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/generate-viewport.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/image-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/next-request.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/next-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/permanentRedirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/redirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/revalidatePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/revalidateTag.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/unauthorized.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/unstable_cache.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/unstable_noStore.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/unstable_rethrow.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-link-status.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-pathname.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-search-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-selected-layout-segment.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/use-selected-layout-segments.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/04-functions/userAgent.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/allowedDevOrigins.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/appDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/authInterrupts.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/cacheLife.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/crossOrigin.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/cssChunking.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/dynamicIO.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/expireTime.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/htmlLimitedBots.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/incrementalCacheHandlerPath.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/inlineCss.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/logging.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/mdxRs.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/optimizePackageImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/ppr.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/reactCompiler.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/reactMaxHeadersLength.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/sassOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/serverActions.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/serverComponentsHmrCache.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/serverExternalPackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/staleTimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/staticGeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/taint.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/turbopack.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/typedRoutes.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/useCache.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/useLightningcss.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/viewTransition.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/01-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/02-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/03-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/05-config/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/06-cli/create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/06-cli/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/06-cli/next.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/07-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/08-turbopack.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/05-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/01-app/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/01-installation.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/02-project-structure.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/04-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/05-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/06-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/11-deploying.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/01-getting-started/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/authentication.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/babel.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/ci-build-caching.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/custom-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/debugging.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/incremental-static-regeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/migrating/app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/migrating/from-create-react-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/migrating/from-vite.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/migrating/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/multi-zones.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/package-bundling.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/post-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/preview-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/production-checklist.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/self-hosting.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/testing/cypress.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/testing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/testing/jest.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/testing/playwright.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/testing/vitest.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/third-party-libraries.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-10.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-11.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-12.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-13.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-14.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/02-guides/upgrading/version-9.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/01-pages-and-layouts.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/02-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/03-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/04-redirecting.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/05-custom-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/06-custom-document.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/07-api-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/08-custom-error.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/11-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/02-rendering/01-server-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/02-rendering/02-static-site-generation.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/02-rendering/04-automatic-static-optimization.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/02-rendering/05-client-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/02-rendering/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/01-get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/02-get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/03-forms-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/03-get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/05-client-side.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/03-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/06-configuring/12-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/06-configuring/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/03-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/form.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/head.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/image-legacy.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/01-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/02-file-conventions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/02-file-conventions/instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/02-file-conventions/public-folder.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/02-file-conventions/src-folder.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/get-initial-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/next-request.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/next-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/use-amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/03-functions/userAgent.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/allowedDevOrigins.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/bundlePagesRouterDependencies.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/crossOrigin.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/optimizePackageImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/runtime-configuration.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/serverExternalPackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/turbo.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/useLightningcss.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/01-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/02-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/04-config/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/05-cli/create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/05-cli/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/05-cli/next.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/06-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/08-turbopack.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/04-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/02-pages/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/03-architecture/accessibility.mdx create mode 100644 apps/docs/content/zh-hant/docs/03-architecture/fast-refresh.mdx create mode 100644 apps/docs/content/zh-hant/docs/03-architecture/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/03-architecture/nextjs-compiler.mdx create mode 100644 apps/docs/content/zh-hant/docs/03-architecture/supported-browsers.mdx create mode 100644 apps/docs/content/zh-hant/docs/04-community/01-contribution-guide.mdx create mode 100644 apps/docs/content/zh-hant/docs/04-community/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/01-getting-started/01-installation.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/01-getting-started/02-project-structure.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/01-getting-started/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/01-defining-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/02-pages-and-layouts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/03-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/04-route-groups.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/05-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/06-loading-ui-and-streaming.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/07-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/08-parallel-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/09-intercepting-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/10-route-handlers.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/11-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/12-colocation.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/13-internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/02-data-fetching/01-fetching-caching-and-revalidating.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/02-data-fetching/02-patterns.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/02-data-fetching/03-forms-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/02-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/03-rendering/01-server-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/03-rendering/02-client-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/03-rendering/04-edge-and-nodejs-runtimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/03-rendering/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/04-caching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/05-styling/01-css-modules.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/05-styling/02-tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/05-styling/03-css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/05-styling/04-sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/05-styling/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/01-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/02-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/03-scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/04-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/05-static-assets.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/06-lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/07-analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/08-open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/09-instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/06-optimizing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/01-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/02-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/04-absolute-imports-and-module-aliases.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/05-mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/06-src-directory.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/11-draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/15-content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/07-configuring/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/08-deploying/01-static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/08-deploying/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/08-upgrading/03-from-vite.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/09-upgrading/01-codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/09-upgrading/02-app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/09-upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/01-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/01-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/01-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/01-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/01-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/01-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/app-icons.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/manifest.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/opengraph-image.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/robots.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/default.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/error.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/layout.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/page.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/route.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/02-file-conventions/template.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/cookies.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/fetch.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/generate-image-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/generate-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/generate-static-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/image-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/next-request.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/next-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/permanentRedirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/redirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/revalidatePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/revalidateTag.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/server-actions.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-pathname.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-search-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-selected-layout-segment.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/04-functions/use-selected-layout-segments.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/appDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/mdxRs.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/optimizePackageImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/turbo.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/typedRoutes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/05-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/06-create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/07-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/08-next-cli.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/02-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/02-app/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/01-pages-and-layouts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/02-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/03-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/04-custom-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/05-custom-document.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/06-custom-error.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/07-api-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/08-internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/09-authenticating.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/10-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/01-server-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/02-static-site-generation.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/03-incremental-static-regeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/04-automatic-static-optimization.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/05-client-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/06-edge-and-nodejs-runtimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/02-rendering/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/01-get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/02-get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/03-forms-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/03-get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/05-client-side.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/03-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/04-styling/01-css-modules.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/04-styling/02-tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/04-styling/03-css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/04-styling/04-sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/04-styling/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/01-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/02-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/03-scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/05-static-assets.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/06-lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/07-analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/08-open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/09-instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/10-testing.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/05-optimizing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/01-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/02-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/03-environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/04-absolute-imports-and-module-aliases.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/05-src-directory.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/06-mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/07-amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/08-babel.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/09-post-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/11-draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/12-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/13-debugging.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/14-preview-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/15-content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/06-configuring/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/07-deploying/01-production-checklist.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/07-deploying/02-static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/07-deploying/03-multi-zones.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/07-deploying/04-ci-build-caching.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/07-deploying/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/01-codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/02-app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/03-version-13.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/04-version-12.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/05-version-11.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/06-version-10.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/07-version-9.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/08-upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/01-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/head.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/image-legacy.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/01-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/get-initial-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/next-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/use-amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/02-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/runtime-configuration.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/turbo.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/03-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/04-create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/05-next-cli.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/06-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/02-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/03-pages/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/accessibility.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/fast-refresh.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/nextjs-compiler.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/supported-browsers.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/04-architecture/turbopack.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/05-community/01-contribution-guide.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/05-community/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/13/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/01-getting-started/01-installation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/01-getting-started/02-project-structure.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/01-getting-started/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/01-defining-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/02-pages-and-layouts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/03-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/04-loading-ui-and-streaming.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/05-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/06-redirecting.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/07-route-groups.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/08-colocation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/09-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/10-parallel-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/11-intercepting-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/12-route-handlers.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/13-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/14-internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/02-data-fetching/01-fetching-caching-and-revalidating.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/02-data-fetching/02-server-actions-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/02-data-fetching/03-patterns.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/02-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/03-rendering/01-server-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/03-rendering/02-client-components.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/03-rendering/04-edge-and-nodejs-runtimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/03-rendering/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/04-caching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/05-styling/01-css-modules.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/05-styling/02-tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/05-styling/03-css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/05-styling/04-sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/05-styling/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/01-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/02-videos.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/03-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/04-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/05-scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/07-lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/08-analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/09-instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/10-open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/11-static-assets.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/12-third-party-libraries.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/13-memory-usage.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/06-optimizing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/01-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/02-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/03-environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/04-absolute-imports-and-module-aliases.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/05-mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/06-src-directory.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/11-draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/15-content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/07-configuring/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/08-testing/01-vitest.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/08-testing/02-jest.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/08-testing/03-playwright.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/08-testing/04-cypress.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/08-testing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/09-authentication/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/10-deploying/01-production-checklist.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/10-deploying/02-static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/10-deploying/03-multi-zones.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/10-deploying/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/01-codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/02-app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/03-version-14.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/04-from-vite.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/05-from-create-react-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/11-upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/01-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/01-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/01-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/01-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/01-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/01-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/app-icons.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/manifest.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/opengraph-image.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/robots.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/default.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/error.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/layout.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/page.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/route-segment-config.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/route.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/02-file-conventions/template.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/cookies.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/fetch.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/generate-image-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/generate-metadata.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/generate-sitemaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/generate-static-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/generate-viewport.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/image-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/next-request.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/next-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/not-found.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/permanentRedirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/redirect.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/revalidatePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/revalidateTag.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/unstable_cache.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/unstable_noStore.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-pathname.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-search-params.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-selected-layout-segment.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/use-selected-layout-segments.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/04-functions/userAgent.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/appDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/crossOrigin.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/incrementalCacheHandlerPath.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/instrumentationHook.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/logging.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/mdxRs.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/optimizePackageImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/partial-prerendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/serverActions.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/serverComponentsExternalPackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/staleTimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/turbo.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/typedRoutes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/05-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/06-cli/create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/06-cli/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/06-cli/next.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/07-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/02-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/02-app/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/01-pages-and-layouts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/02-dynamic-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/03-linking-and-navigating.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/04-redirecting.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/05-custom-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/06-custom-document.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/07-api-routes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/08-custom-error.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/10-internationalization.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/11-middleware.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/01-routing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/01-server-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/02-static-site-generation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/04-automatic-static-optimization.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/05-client-side-rendering.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/06-edge-and-nodejs-runtimes.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/02-rendering/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/01-get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/02-get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/03-forms-and-mutations.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/03-get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/04-incremental-static-regeneration.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/05-client-side.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/03-data-fetching/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/04-styling/01-css-modules.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/04-styling/02-tailwind-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/04-styling/03-css-in-js.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/04-styling/04-sass.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/04-styling/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/01-images.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/02-fonts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/03-scripts.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/05-static-assets.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/06-bundle-analyzer.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/07-analytics.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/08-lazy-loading.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/09-instrumentation.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/10-open-telemetry.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/11-third-party-libraries.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/05-optimizing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/01-typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/02-eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/03-environment-variables.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/04-absolute-imports-and-module-aliases.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/05-src-directory.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/06-mdx.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/07-amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/08-babel.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/09-post-css.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/10-custom-server.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/11-draft-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/12-error-handling.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/13-debugging.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/14-preview-mode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/15-content-security-policy.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/06-configuring/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/07-testing/01-vitest.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/07-testing/02-jest.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/07-testing/03-playwright.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/07-testing/04-cypress.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/07-testing/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/08-authentication/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/09-deploying/01-production-checklist.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/09-deploying/02-static-exports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/09-deploying/03-multi-zones.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/09-deploying/04-ci-build-caching.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/09-deploying/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/01-codemods.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/02-app-router-migration.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/03-from-vite.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/04-from-create-react-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/05-version-14.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/06-version-13.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/07-version-12.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/08-version-11.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/09-version-10.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/10-version-9.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/10-upgrading/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/01-building-your-application/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/font.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/head.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/image-legacy.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/image.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/link.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/01-components/script.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/get-initial-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/get-server-side-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/get-static-paths.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/get-static-props.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/next-request.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/next-response.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/use-amp.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/use-report-web-vitals.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/use-router.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/02-functions/userAgent.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/assetPrefix.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/basePath.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/compress.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/crossOrigin.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/devIndicators.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/distDir.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/env.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/eslint.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/exportPathMap.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/generateBuildId.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/generateEtags.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/headers.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/httpAgentOptions.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/images.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/instrumentationHook.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/onDemandEntries.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/optimizePackageImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/output.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/pageExtensions.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/poweredByHeader.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/productionBrowserSourceMaps.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/reactStrictMode.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/redirects.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/rewrites.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/runtime-configuration.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/trailingSlash.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/transpilePackages.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/turbo.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/typescript.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/urlImports.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/webVitalsAttribution.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/03-next-config-js/webpack.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/05-edge.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/06-cli/create-next-app.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/06-cli/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/06-cli/next.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/02-api-reference/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/03-pages/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/accessibility.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/fast-refresh.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/nextjs-compiler.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/supported-browsers.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/04-architecture/turbopack.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/05-community/01-contribution-guide.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/05-community/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/14/index.mdx create mode 100644 apps/docs/content/zh-hant/docs/index.mdx diff --git a/apps/docs/content/zh-hans/docs/01-app/01-getting-started/06-css.mdx b/apps/docs/content/zh-hans/docs/01-app/01-getting-started/06-css.mdx index 16664baa..9f483d77 100644 --- a/apps/docs/content/zh-hans/docs/01-app/01-getting-started/06-css.mdx +++ b/apps/docs/content/zh-hans/docs/01-app/01-getting-started/06-css.mdx @@ -1,12 +1,12 @@ --- -source-updated-at: 2025-05-19T22:31:51.000Z -translation-updated-at: 2025-05-19T23:06:25.929Z +source-updated-at: 2025-05-25T15:16:02.000Z +translation-updated-at: 2025-05-25T20:26:25.233Z title: 如何在应用中使用 CSS nav_title: CSS description: 了解在应用中添加 CSS 的不同方式,包括 CSS 模块 (CSS Modules)、全局 CSS (Global CSS)、Tailwind CSS 等。 related: - title: 下一步 - description: 进一步了解在应用中使用 CSS 的其他方式。 + title: 后续步骤 + description: 进一步了解在应用中使用 CSS 的其他替代方案。 links: - app/guides/tailwind-css - app/guides/sass @@ -24,13 +24,13 @@ Next.js 提供了多种在应用中使用 CSS 的方式,包括: ## CSS 模块 (CSS Modules) -CSS 模块 (CSS Modules) 通过生成唯一的类名来实现 CSS 的局部作用域。这允许你在不同文件中使用相同的类名而无需担心命名冲突。 +CSS 模块通过生成唯一的类名来实现 CSS 的局部作用域,这样您可以在不同文件中使用相同的类名而无需担心命名冲突。 -要开始使用 CSS 模块 (CSS Modules),创建一个扩展名为 `.module.css` 的文件,并将其导入到 `app` 目录下的任意组件中: +要开始使用 CSS 模块,请创建一个扩展名为 `.module.css` 的新文件,并将其导入到 `app` 目录中的任意组件: -```css filename="app/blog/styles.module.css" +```css filename="app/blog/blog.module.css" .blog { padding: 24px; } @@ -56,7 +56,7 @@ export default function Layout() { -要开始使用 CSS 模块 (CSS Modules),创建一个扩展名为 `.module.css` 的文件,并将其导入到 `pages` 目录下的任意组件中: +要开始使用 CSS 模块,请创建一个扩展名为 `.module.css` 的新文件,并将其导入到 `pages` 目录中的任意组件: ```css filename="/styles/blog.module.css" .blog { @@ -84,11 +84,11 @@ export default function Page() { ## 全局 CSS (Global CSS) -你可以使用全局 CSS (Global CSS) 在整个应用中应用样式。 +您可以使用全局 CSS 来为整个应用应用样式。 -创建一个 `app/global.css` 文件,并在根布局中导入它,以将样式应用到应用中的**每个路由**: +创建一个 `app/global.css` 文件并将其导入根布局 (root layout),这样样式将应用到应用中的**每个路由**: ```css filename="app/global.css" body { @@ -99,7 +99,7 @@ body { ``` ```tsx filename="app/layout.tsx" switcher -// 这些样式会应用到应用中的每个路由 +// 这些样式将应用到应用中的每个路由 import './global.css' export default function RootLayout({ @@ -116,7 +116,7 @@ export default function RootLayout({ ``` ```jsx filename="app/layout.js" switcher -// 这些样式会应用到应用中的每个路由 +// 这些样式将应用到应用中的每个路由 import './global.css' export default function RootLayout({ children }) { @@ -128,13 +128,13 @@ export default function RootLayout({ children }) { } ``` -> **须知:** 全局样式可以导入到 `app` 目录下的任何布局、页面或组件中。但由于 Next.js 使用 React 内置的样式表支持来与 Suspense 集成,目前这不会在路由切换时移除样式表,可能导致冲突。我们建议将全局样式用于**真正**全局的 CSS,而使用 [CSS 模块 (CSS Modules)](#css-modules) 来限定 CSS 作用域。 +> **须知:** 全局样式可以导入到 `app` 目录中的任何布局、页面或组件。但由于 Next.js 使用 React 内置的样式表支持来与 Suspense 集成,目前在不同路由之间导航时不会移除样式表,这可能导致冲突。我们建议将全局样式用于**真正**全局的 CSS,而对于局部作用域的 CSS 使用 [CSS 模块 (CSS Modules)](#css-modules)。 -在 `pages/_app.js` 文件中导入样式表,以将样式应用到应用中的**每个路由**: +将样式表导入 `pages/_app.js` 文件,这样样式将应用到应用中的**每个路由**: ```tsx filename="pages/_app.js" import '@/styles/global.css' @@ -144,11 +144,11 @@ export default function MyApp({ Component, pageProps }) { } ``` -由于样式表的全局性质,为避免冲突,你应该在 [`pages/_app.js`](/docs/pages/building-your-application/routing/custom-app) 中导入它们。 +由于样式表的全局性质,为避免冲突,您应该在 [`pages/_app.js`](/docs/pages/building-your-application/routing/custom-app) 中导入它们。 -## 外部样式表 (External stylesheets) +## 外部样式表 (External Stylesheets) @@ -188,13 +188,13 @@ export default function RootLayout({ children }) { -Next.js 允许你从 JavaScript 文件中导入 CSS 文件。这是因为 Next.js 扩展了 [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) 的概念,使其不仅限于 JavaScript。 +Next.js 允许您从 JavaScript 文件导入 CSS 文件。这是可能的,因为 Next.js 扩展了 [`import`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/import) 的概念,使其不仅限于 JavaScript。 ### 从 `node_modules` 导入样式 自 Next.js **9.5.4** 起,允许从 `node_modules` 导入 CSS 文件到应用中的任何位置。 -对于全局样式表,如 `bootstrap` 或 `nprogress`,你应该在 `pages/_app.js` 中导入文件。例如: +对于全局样式表,如 `bootstrap` 或 `nprogress`,您应该在 `pages/_app.js` 中导入文件。例如: ```jsx filename="pages/_app.js" import 'bootstrap/dist/css/bootstrap.css' @@ -204,7 +204,7 @@ export default function MyApp({ Component, pageProps }) { } ``` -对于第三方组件所需的 CSS,你可以在组件中导入。例如: +对于第三方组件所需的 CSS,您可以在组件中导入。例如: ```jsx filename="components/example-dialog.js" import { useState } from 'react' @@ -219,13 +219,13 @@ function ExampleDialog(props) { return (
- + -

Hello there. I am a dialog

+

你好,我是一个对话框

) @@ -236,7 +236,7 @@ function ExampleDialog(props) { ## 排序与合并 (Ordering and Merging) -Next.js 在生产构建时会通过自动分块(合并)样式表来优化 CSS。**CSS 的顺序**取决于**你在代码中导入样式的顺序**。 +Next.js 在生产构建时会通过自动分块(合并)样式表来优化 CSS。**CSS 的顺序**取决于**您在代码中导入样式的顺序**。 例如,`base-button.module.css` 会排在 `page.module.css` 之前,因为 `` 在 `page.module.css` 之前导入: @@ -280,15 +280,15 @@ export function BaseButton() { - 尽量将 CSS 导入限制在单个 JavaScript 或 TypeScript 入口文件中 - 在应用的根目录中导入全局样式和 Tailwind 样式表 -- 对于嵌套组件,使用 CSS 模块 (CSS Modules) 而非全局样式 -- 为 CSS 模块使用一致的命名约定,例如使用 `.module.css` 而非 `.tsx` +- 对于嵌套组件,使用 CSS 模块而非全局样式 +- 为 CSS 模块使用一致的命名约定。例如,使用 `.module.css` 而非 `.tsx` - 将共享样式提取到共享组件中以避免重复导入 - 关闭自动排序导入的 linter 或格式化工具,如 ESLint 的 [`sort-imports`](https://eslint.org/docs/latest/rules/sort-imports) -- 你可以在 `next.config.js` 中使用 [`cssChunking`](/docs/app/api-reference/config/next-config-js/cssChunking) 选项来控制 CSS 的分块方式 +- 您可以在 `next.config.js` 中使用 [`cssChunking`](/docs/app/api-reference/config/next-config-js/cssChunking) 选项来控制 CSS 的分块方式 ## 开发与生产环境 (Development vs Production) - 在开发环境 (`next dev`) 中,CSS 更新会通过 [快速刷新 (Fast Refresh)](/docs/architecture/fast-refresh) 即时应用 - 在生产环境 (`next build`) 中,所有 CSS 文件会自动合并为**多个经过压缩和代码拆分**的 `.css` 文件,确保为路由加载最少数量的 CSS -- 在生产环境中,即使禁用 JavaScript,CSS 仍会加载,但在开发环境中需要 JavaScript 以实现快速刷新 (Fast Refresh) +- 在生产环境中,即使禁用 JavaScript,CSS 仍会加载,但在开发环境中需要 JavaScript 来实现快速刷新 - CSS 顺序在开发环境中可能表现不同,请务必检查构建 (`next build`) 以验证最终的 CSS 顺序 \ No newline at end of file diff --git a/apps/docs/content/zh-hans/docs/01-app/03-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx b/apps/docs/content/zh-hans/docs/01-app/03-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx index 062afbcf..cce6b8a8 100644 --- a/apps/docs/content/zh-hans/docs/01-app/03-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx +++ b/apps/docs/content/zh-hans/docs/01-app/03-building-your-application/02-data-fetching/03-server-actions-and-mutations.mdx @@ -1,26 +1,26 @@ --- -source-updated-at: 2025-05-22T15:18:56.000Z -translation-updated-at: 2025-05-23T16:48:39.211Z -title: 服务端操作 (Server Actions) 与数据变更 (Mutations) +source-updated-at: 2025-05-25T15:16:02.000Z +translation-updated-at: 2025-05-25T20:30:03.863Z +title: 服务端操作与数据变更 nav_title: 服务端操作与数据变更 -description: 学习如何使用 Next.js 处理表单提交和数据变更。 +description: 了解如何使用 Next.js 处理表单提交和数据变更。 related: - description: 了解如何在 Next.js 中配置服务端操作 (Server Actions) + description: 了解如何在 Next.js 中配置服务端操作 links: - app/api-reference/config/next-config-js/serverActions --- -[服务端操作 (Server Actions)](https://react.dev/reference/rsc/server-actions) 是在服务端执行的**异步函数**。它们可以在服务端组件 (Server Components) 和客户端组件 (Client Components) 中被调用,用于处理 Next.js 应用中的表单提交和数据变更。 +[服务端操作 (Server Actions)](https://react.dev/reference/rsc/server-actions) 是在服务端执行的**异步函数**。它们可以在服务端和客户端组件中调用,用于处理 Next.js 应用中的表单提交和数据变更。 -> **🎥 观看视频:** 通过服务端操作学习数据变更 → [YouTube (10分钟)](https://youtu.be/dDpZfOQBMaU?si=cJZHlUu_jFhCzHUg) +> **🎥 观看视频:** 了解更多关于服务端操作的数据变更 → [YouTube (10分钟)](https://youtu.be/dDpZfOQBMaU?si=cJZHlUu_jFhCzHUg). ## 约定 -可以通过 React 的 [`"use server"`](https://react.dev/reference/react/use-server) 指令定义服务端操作。您可以将该指令放在 `async` 函数的顶部以标记该函数为服务端操作,或者放在单独文件的顶部以将该文件的所有导出标记为服务端操作。 +可以通过 React 的 [`"use server"`](https://react.dev/reference/react/use-server) 指令定义服务端操作。您可以将该指令放在 `async` 函数顶部以标记该函数为服务端操作,或者放在单独文件顶部以标记该文件所有导出为服务端操作。 ### 服务端组件 -服务端组件可以使用函数级别或模块级别的 `"use server"` 指令。要内联定义服务端操作,请在函数体顶部添加 `"use server"`: +服务端组件可以使用函数级或模块级的 `"use server"` 指令。要内联定义服务端操作,请在函数体顶部添加 `"use server"`: ```tsx filename="app/page.tsx" switcher export default function Page() { @@ -48,7 +48,7 @@ export default function Page() { ### 客户端组件 -要在[客户端组件](/docs/app/getting-started/updating-data#server-functions)中调用服务端操作,请创建一个新文件并在其顶部添加 `"use server"` 指令。文件中的所有导出函数都将被标记为可在服务端和客户端组件中重复使用的服务端函数: +要在[客户端组件](/docs/app/getting-started/updating-data#server-functions)中调用服务端函数,需创建新文件并在顶部添加 `"use server"` 指令。该文件内所有导出函数都将被标记为可在客户端和服务端组件中复用的服务端函数: ```tsx filename="app/actions.ts" switcher 'use server' @@ -84,7 +84,7 @@ export function Button() { ### 将操作作为属性传递 -您还可以将服务端操作作为属性传递给客户端组件: +您也可以将服务端操作作为属性传递给客户端组件: ```jsx @@ -110,29 +110,29 @@ export default function ClientComponent({ updateItemAction }) { } ``` -通常情况下,Next.js 的 TypeScript 插件会标记 `client-component.tsx` 中的 `updateItemAction`,因为函数通常无法跨客户端-服务端边界序列化。但是,名为 `action` 或以 `Action` 结尾的属性会被假定为接收服务端操作。这只是一个启发式规则,因为 TypeScript 插件实际上并不知道它接收的是服务端操作还是普通函数。运行时类型检查仍会确保您不会意外地将函数传递给客户端组件。 +通常,Next.js TypeScript 插件会标记 `client-component.tsx` 中的 `updateItemAction`,因为函数通常无法跨客户端-服务端边界序列化。但以 `action` 结尾或命名的属性会被假定为接收服务端操作。这只是启发式规则,因为 TypeScript 插件实际上无法判断接收的是服务端操作还是普通函数。运行时类型检查仍会确保您不会意外将函数传递给客户端组件。 -## 行为 +## 行为特性 -- 服务端操作可以通过 [`
` 元素](#forms)的 `action` 属性调用: - - 服务端组件默认支持渐进增强 (progressive enhancement),这意味着即使 JavaScript 尚未加载或已被禁用,表单仍会被提交。 - - 在客户端组件中,调用服务端操作的表单会在 JavaScript 未加载时排队提交,优先进行客户端水合 (hydration)。 - - 水合完成后,浏览器在表单提交时不会刷新页面。 -- 服务端操作不仅限于 ``,还可以从事件处理器、`useEffect`、第三方库和其他表单元素(如 ` + + +

你好,我是一個對話框

+
+ + ) +} +``` + + + +## 排序與合併 (Ordering and Merging) + +Next.js 在生產環境建置時會透過自動分塊(合併)樣式表來優化 CSS。**CSS 的順序**取決於**您在程式碼中導入樣式的順序**。 + +例如,`base-button.module.css` 會排在 `page.module.css` 之前,因為 `` 是在 `page.module.css` 之前導入的: + +```tsx filename="page.ts" switcher +import { BaseButton } from './base-button' +import styles from './page.module.css' + +export default function Page() { + return +} +``` + +```jsx filename="page.js" switcher +import { BaseButton } from './base-button' +import styles from './page.module.css' + +export default function Page() { + return +} +``` + +```tsx filename="base-button.tsx" switcher +import styles from './base-button.module.css' + +export function BaseButton() { + return + + ) +} +``` + +```jsx filename="app/ui/counter.tsx" highlight={1} switcher +'use client' + +import { useState } from 'react' + +export default function Counter() { + const [count, setCount] = useState(0) + + return ( +
+

{count} likes

+ +
+ ) +} +``` + +`"use client"` 用於宣告伺服器與客戶端模組圖 (樹) 之間的**邊界**。 + +一旦檔案標記了 `"use client"`,**其所有導入的子元件都會被視為客戶端套件的一部分**。這意味著您不需要為每個客戶端元件都添加此指令。 + +### 減少 JS 套件大小 + +為了減少客戶端 JavaScript 套件的大小,請將 `'use client'` 添加到特定的互動式元件,而不是將大部分 UI 標記為客戶端元件。 + +例如,`` 元件包含靜態元素如標誌和導航連結,但也包含一個互動式搜尋欄。`` 是互動式的且需要是客戶端元件,但版面配置的其餘部分可以保持為伺服器元件。 + +```tsx filename="app/ui/search.tsx" highlight={1} switcher +'use client' + +export default function Search() { + // ... +} +``` + +```jsx filename="app/ui/search.js" highlight={1} switcher +'use client' + +export default function Search() { + // ... +} +``` + +```tsx filename="app/layout.tsx" switcher +// 客戶端元件 +import Search from './search' +// 伺服器元件 +import Logo from './logo' + +// Layout 預設為伺服器元件 +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + +
{children}
+ + ) +} +``` + +```jsx filename="app/layout.js" switcher +// 客戶端元件 +import Search from './search' +// 伺服器元件 +import Logo from './logo' + +// Layout 預設為伺服器元件 +export default function Layout({ children }) { + return ( + <> + +
{children}
+ + ) +} +``` + +### 從伺服器元件傳遞資料至客戶端元件 + +您可以使用 props 將資料從伺服器元件傳遞至客戶端元件。 + +```tsx filename="app/[id]/page.tsx" highlight={1,7} switcher +import LikeButton from '@/app/ui/like-button' +import { getPost } from '@/lib/data' + +export default async function Page({ params }: { params: { id: string } }) { + const post = await getPost(params.id) + + return +} +``` + +```jsx filename="app/[id]/page.js" highlight={1,7} switcher +import LikeButton from '@/app/ui/like-button' +import { getPost } from '@/lib/data' + +export default async function Page({ params }) { + const post = await getPost(params.id) + + return +} +``` + +```tsx filename="app/ui/like-button.tsx" highlight={1} switcher +'use client' + +export default function LikeButton({ likes }: { likes: number }) { + // ... +} +``` + +```jsx filename="app/ui/like-button.js" highlight={1} switcher +'use client' + +export default function LikeButton({ likes }) { + // ... +} +``` + +或者,您可以使用 [`use` Hook](https://react.dev/reference/react/use) 從伺服器元件串流資料至客戶端元件。請參閱[範例](/docs/app/getting-started/fetching-data#streaming-data-with-the-use-hook)。 + +> **須知**:傳遞給客戶端元件的 props 需要能被 React [序列化 (serializable)](https://react.dev/reference/react/use-server#serializable-parameters-and-return-values)。 + +### 交錯使用伺服器與客戶端元件 + +您可以將伺服器元件作為 prop 傳遞給客戶端元件。這讓您可以在客戶端元件中嵌套伺服器渲染的 UI。 + +常見的模式是使用 `children` 在 `` 中建立一個_插槽 (slot)_。例如,一個在伺服器端獲取資料的 `` 元件,嵌套在使用客戶端狀態控制顯示的 `` 元件中。 + +```tsx filename="app/ui/modal.tsx" switcher +'use client' + +export default function Modal({ children }: { children: React.ReactNode }) { + return
{children}
+} +``` + +```jsx filename="app/ui/modal.js" switcher +'use client' + +export default function Modal({ children }) { + return
{children}
+} +``` + +然後,在父級伺服器元件 (例如 ``) 中,您可以將 `` 作為 `` 的子元件傳遞: + +```tsx filename="app/page.tsx" highlight={7} switcher +import Modal from './ui/modal' +import Cart from './ui/cart' + +export default function Page() { + return ( + + + + ) +} +``` + +```jsx filename="app/page.js" highlight={7} switcher +import Modal from './ui/modal' +import Cart from './ui/cart' + +export default function Page() { + return ( + + + + ) +} +``` + +在此模式中,所有伺服器元件 (包括作為 props 傳遞的元件) 都會在伺服器端預先渲染。產生的 RSC 負載將包含客戶端元件在元件樹中的渲染位置參考。 + +### 上下文提供者 (Context providers) + +[React 上下文 (context)](https://react.dev/learn/passing-data-deeply-with-context) 常用於共享全域狀態,例如當前主題。然而,React 上下文不支援在伺服器元件中使用。 + +要使用上下文,請建立一個接受 `children` 的客戶端元件: + +```tsx filename="app/theme-provider.tsx" switcher +'use client' + +import { createContext } from 'react' + +export const ThemeContext = createContext({}) + +export default function ThemeProvider({ + children, +}: { + children: React.ReactNode +}) { + return {children} +} +``` + +```jsx filename="app/theme-provider.js" switcher +'use client' + +import { createContext } from 'react' + +export const ThemeContext = createContext({}) + +export default function ThemeProvider({ children }) { + return {children} +} +``` + +然後,將其導入伺服器元件 (例如 `layout`): + +```tsx filename="app/layout.tsx" switcher +import ThemeProvider from './theme-provider' + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + + {children} + + + ) +} +``` + +```jsx filename="app/layout.js" switcher +import ThemeProvider from './theme-provider' + +export default function RootLayout({ children }) { + return ( + + + {children} + + + ) +} +``` + +現在,您的伺服器元件將能直接渲染提供者,而應用程式中的所有其他客戶端元件都能使用此上下文。 + +> **須知**:您應盡可能在樹的深層渲染提供者 — 注意 `ThemeProvider` 僅包裹 `{children}` 而非整個 `` 文件。這讓 Next.js 更容易優化伺服器元件的靜態部分。 + +### 第三方元件 + +當使用依賴客戶端功能的第三方元件時,您可以將其包裹在客戶端元件中以確保正常運作。 + +例如,`` 可從 `acme-carousel` 套件導入。此元件使用 `useState`,但尚未添加 `"use client"` 指令。 + +如果您在客戶端元件中使用 ``,它將如預期運作: + +```tsx filename="app/gallery.tsx" switcher +'use client' + +import { useState } from 'react' +import { Carousel } from 'acme-carousel' + +export default function Gallery() { + const [isOpen, setIsOpen] = useState(false) + + return ( +
+ + {/* 正常運作,因為 Carousel 在客戶端元件中使用 */} + {isOpen && } +
+ ) +} +``` + +```jsx filename="app/gallery.js" switcher +'use client' + +import { useState } from 'react' +import { Carousel } from 'acme-carousel' + +export default function Gallery() { + const [isOpen, setIsOpen] = useState(false) + + return ( +
+ + {/* 正常運作,因為 Carousel 在客戶端元件中使用 */} + {isOpen && } +
+ ) +} +``` + +然而,如果您嘗試直接在伺服器元件中使用它,將會出現錯誤。這是因為 Next.js 不知道 `` 使用了僅限客戶端的功能。 + +要解決此問題,您可以將依賴客戶端功能的第三方元件包裹在自訂的客戶端元件中: + +```tsx filename="app/carousel.tsx" switcher +'use client' + +import { Carousel } from 'acme-carousel' + +export default Carousel +``` + +```jsx filename="app/carousel.js" switcher +'use client' + +import { Carousel } from 'acme-carousel' + +export default Carousel +``` + +現在,您可以直接在伺服器元件中使用 ``: + +```tsx filename="app/page.tsx" switcher +import Carousel from './carousel' + +export default function Page() { + return ( +
+

View pictures

+ {/* 正常運作,因為 Carousel 是客戶端元件 */} + +
+ ) +} +``` + +```jsx filename="app/page.js" switcher +import Carousel from './carousel' + +export default function Page() { + return ( +
+

View pictures

+ {/* 正常運作,因為 Carousel 是客戶端元件 */} + +
+ ) +} +``` + +> **給函式庫作者的建議** +> +> 如果您正在建立元件函式庫,請為依賴客戶端功能的入口點添加 `"use client"` 指令。這讓使用者能直接將元件導入伺服器元件,而無需建立包裹元件。 +> +> 值得注意的是,某些打包工具可能會移除 `"use client"` 指令。您可以在 [React Wrap Balancer](https://github.com/shuding/react-wrap-balancer/blob/main/tsup.config.ts#L10-L13) 和 [Vercel Analytics](https://github.com/vercel/analytics/blob/main/packages/web/tsup.config.js#L26-L30) 儲存庫中找到如何配置 esbuild 以包含 `"use client"` 指令的範例。 + +### 防止環境污染 + +JavaScript 模組可以在伺服器元件和客戶端元件之間共享,這意味著有可能意外將僅限伺服器的程式碼導入客戶端。例如,考慮以下函式: + +```ts filename="lib/data.ts" switcher +export async function getData() { + const res = await fetch('https://external-service.com/data', { + headers: { + authorization: process.env.API_KEY, + }, + }) + + return res.json() +} +``` + +```js filename="lib/data.js" switcher +export async function getData() { + const res = await fetch('https://external-service.com/data', { + headers: { + authorization: process.env.API_KEY, + }, + }) + + return res.json() +} +``` + +此函式包含一個 `API_KEY`,絕不應該暴露給客戶端。 + +在 Next.js 中,只有以 `NEXT_PUBLIC_` 為前綴的環境變數會被包含在客戶端套件中。如果變數沒有前綴,Next.js 會將其替換為空字串。 + +因此,即使 `getData()` 可以被導入並在客戶端執行,它也不會如預期般運作。 + +為了防止在客戶端元件中意外使用,你可以使用 [`server-only` 套件](https://www.npmjs.com/package/server-only)。 + +```bash filename="Terminal" +npm install server-only +``` + +然後,將套件導入包含僅限伺服器程式碼的檔案中: + +```js filename="lib/data.js" +import 'server-only' + +export async function getData() { + const res = await fetch('https://external-service.com/data', { + headers: { + authorization: process.env.API_KEY, + }, + }) + + return res.json() +} +``` + +現在,如果你嘗試將此模組導入客戶端元件,將會在構建時出現錯誤。 + +> **小知識**:對應的 [`client-only` 套件](https://www.npmjs.com/package/client-only) 可用來標記包含僅限客戶端邏輯的模組,例如存取 `window` 物件的程式碼。 diff --git a/apps/docs/content/zh-hant/docs/01-app/01-getting-started/08-fetching-data.mdx b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/08-fetching-data.mdx new file mode 100644 index 00000000..2e44a88c --- /dev/null +++ b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/08-fetching-data.mdx @@ -0,0 +1,627 @@ +--- +source-updated-at: 2025-05-22T15:18:56.000Z +translation-updated-at: 2025-05-25T20:44:42.900Z +title: 如何獲取資料並串流 +nav_title: 資料獲取 +description: 開始在您的應用程式中獲取資料並串流內容。 +related: + title: API 參考 + description: 透過閱讀 API 參考文件,深入了解本頁提到的功能。 + links: + - app/api-reference/functions/fetch + - app/api-reference/file-conventions/loading + - app/api-reference/config/next-config-js/logging + - app/api-reference/config/next-config-js/taint +--- + +本頁將引導您了解如何在[伺服器與客戶端元件](/docs/app/getting-started/server-and-client-components)中獲取資料,以及如何串流依賴資料的元件。 + +## 獲取資料 + +### 伺服器元件 + +您可以在伺服器元件中使用以下方式獲取資料: + +1. [`fetch` API](#使用-fetch-api) +2. [ORM 或資料庫](#使用-orm-或資料庫) + +#### 使用 `fetch` API + +要使用 `fetch` API 獲取資料,請將您的元件轉換為非同步函式,並等待 `fetch` 呼叫。例如: + +```tsx filename="app/blog/page.tsx" switcher +export default async function Page() { + const data = await fetch('https://api.vercel.app/blog') + const posts = await data.json() + return ( +
    + {posts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +```jsx filename="app/blog/page.js" switcher +export default async function Page() { + const data = await fetch('https://api.vercel.app/blog') + const posts = await data.json() + return ( +
    + {posts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +> **小知識:** +> +> - `fetch` 回應預設不會被快取。然而,Next.js 會[預先渲染](/docs/app/getting-started/partial-prerendering#static-rendering)路由,且輸出會被快取以提升效能。如果您想選擇[動態渲染](/docs/app/getting-started/partial-prerendering#dynamic-rendering),請使用 `{ cache: 'no-store' }` 選項。詳見 [`fetch` API 參考](/docs/app/api-reference/functions/fetch)。 +> - 在開發期間,您可以記錄 `fetch` 呼叫以便更好地進行可見性和除錯。詳見 [`logging` API 參考](/docs/app/api-reference/config/next-config-js/logging)。 + +#### 使用 ORM 或資料庫 + +由於伺服器元件是在伺服器端渲染的,您可以安全地使用 ORM 或資料庫客戶端進行資料庫查詢。將您的元件轉換為非同步函式,並等待呼叫: + +```tsx filename="app/blog/page.tsx" switcher +import { db, posts } from '@/lib/db' + +export default async function Page() { + const allPosts = await db.select().from(posts) + return ( +
    + {allPosts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +```jsx filename="app/blog/page.js" switcher +import { db, posts } from '@/lib/db' + +export default async function Page() { + const allPosts = await db.select().from(posts) + return ( +
    + {allPosts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +### 客戶端元件 + +在客戶端元件中有兩種獲取資料的方式: + +1. 使用 React 的 [`use` hook](https://react.dev/reference/react/use) +2. 使用社群函式庫如 [SWR](https://swr.vercel.app/) 或 [React Query](https://tanstack.com/query/latest) + +#### 使用 `use` hook 串流資料 + +您可以使用 React 的 [`use` hook](https://react.dev/reference/react/use) 將資料從伺服器[串流](#串流)到客戶端。首先在伺服器元件中獲取資料,然後將 promise 作為 prop 傳遞給客戶端元件: + +```tsx filename="app/blog/page.tsx" switcher +import Posts from '@/app/ui/posts +import { Suspense } from 'react' + +export default function Page() { + // 不要等待資料獲取函式 + const posts = getPosts() + + return ( + 載入中...}> + + + ) +} +``` + +```jsx filename="app/blog/page.js" switcher +import Posts from '@/app/ui/posts +import { Suspense } from 'react' + +export default function Page() { + // 不要等待資料獲取函式 + const posts = getPosts() + + return ( + 載入中...}> + + + ) +} +``` + +然後,在您的客戶端元件中,使用 `use` hook 讀取 promise: + +```tsx filename="app/ui/posts.tsx" switcher +'use client' +import { use } from 'react' + +export default function Posts({ + posts, +}: { + posts: Promise<{ id: string; title: string }[]> +}) { + const allPosts = use(posts) + + return ( +
    + {allPosts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +```jsx filename="app/ui/posts.js" switcher +'use client' +import { use } from 'react' + +export default function Posts({ posts }) { + const posts = use(posts) + + return ( +
    + {posts.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +在上面的範例中,`` 元件被包裹在 [`` 邊界](https://react.dev/reference/react/Suspense)中。這意味著在 promise 解析期間會顯示 fallback。了解更多關於[串流](#串流)的資訊。 + +#### 社群函式庫 + +您可以使用社群函式庫如 [SWR](https://swr.vercel.app/) 或 [React Query](https://tanstack.com/query/latest) 在客戶端元件中獲取資料。這些函式庫有自己的快取、串流等功能語意。例如,使用 SWR: + +```tsx filename="app/blog/page.tsx" switcher +'use client' +import useSWR from 'swr' + +const fetcher = (url) => fetch(url).then((r) => r.json()) + +export default function BlogPage() { + const { data, error, isLoading } = useSWR( + 'https://api.vercel.app/blog', + fetcher + ) + + if (isLoading) return
載入中...
+ if (error) return
錯誤: {error.message}
+ + return ( +
    + {data.map((post: { id: string; title: string }) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +```jsx filename="app/blog/page.js" switcher +'use client' + +import useSWR from 'swr' + +const fetcher = (url) => fetch(url).then((r) => r.json()) + +export default function BlogPage() { + const { data, error, isLoading } = useSWR( + 'https://api.vercel.app/blog', + fetcher + ) + + if (isLoading) return
載入中...
+ if (error) return
錯誤: {error.message}
+ + return ( +
    + {data.map((post) => ( +
  • {post.title}
  • + ))} +
+ ) +} +``` + +## 串流 + +> **警告:** 以下內容假設您的應用程式已啟用 [`dynamicIO` 設定選項](/docs/app/api-reference/config/next-config-js/dynamicIO)。此標誌是在 Next.js 15 canary 中引入的。 + +在伺服器元件中使用 `async/await` 時,Next.js 會選擇[動態渲染](/docs/app/getting-started/partial-prerendering#dynamic-rendering)。這意味著資料將在每次使用者請求時在伺服器端獲取並渲染。如果有任何慢速資料請求,整個路由將被阻止渲染。 + +為了改善初始載入時間和使用者體驗,您可以使用串流將頁面的 HTML 分解為較小的區塊,並逐步將這些區塊從伺服器傳送到客戶端。 + +伺服器渲染與串流的工作原理 + +在您的應用程式中實現串流有兩種方式: + +1. 使用 [`loading.js` 檔案](#使用-loadingjs)包裹頁面 +2. 使用 [``](#使用-suspense) 包裹元件 + +### 使用 `loading.js` + +您可以在與頁面相同的資料夾中建立 `loading.js` 檔案,以便在獲取資料時串流**整個頁面**。例如,要串流 `app/blog/page.js`,請在 `app/blog` 資料夾中新增該檔案。 + +包含 loading.js 檔案的部落格資料夾結構 + +```tsx filename="app/blog/loading.tsx" switcher +export default function Loading() { + // 在此定義載入 UI + return
載入中...
+} +``` + +```jsx filename="app/blog/loading.js" switcher +export default function Loading() { + // 在此定義載入 UI + return
載入中...
+} +``` + +在導航時,使用者會立即看到版面配置和[載入狀態](#建立有意義的載入狀態),同時頁面正在渲染。一旦渲染完成,新內容將自動替換。 + +載入 UI + +在幕後,`loading.js` 將被嵌套在 `layout.js` 中,並自動將 `page.js` 檔案及其下方的任何子元件包裹在 `` 邊界中。 + +loading.js 概覽 + +這種方法適用於路由區段(版面配置和頁面),但對於更細粒度的串流,您可以使用 ``。 + +### 使用 `` + +`` 允許您更精細地控制頁面的哪些部分需要串流。例如,您可以立即顯示 `` 邊界之外的任何頁面內容,並在邊界內串流部落格文章列表。 + +```tsx filename="app/blog/page.tsx" switcher +import { Suspense } from 'react' +import BlogList from '@/components/BlogList' +import BlogListSkeleton from '@/components/BlogListSkeleton' + +export default function BlogPage() { + return ( +
+ {/* 此內容將立即發送到客戶端 */} +
+

歡迎來到部落格

+

閱讀以下最新文章。

+
+
+ {/* 任何包裹在 邊界中的內容將被串流 */} + }> + + +
+
+ ) +} +``` + +```jsx filename="app/blog/page.js" switcher +import { Suspense } from 'react' +import BlogList from '@/components/BlogList' +import BlogListSkeleton from '@/components/BlogListSkeleton' + +export default function BlogPage() { + return ( +
+ {/* 此內容將立即發送到客戶端 */} +
+

歡迎來到部落格

+

閱讀以下最新文章。

+
+
+ {/* 任何包裹在 邊界中的內容將被串流 */} + }> + + +
+
+ ) +} +``` + +### 建立有意義的載入狀態 + +即時載入狀態是在導航後立即顯示給使用者的 fallback UI。為了獲得最佳使用者體驗,我們建議設計有意義的載入狀態,幫助使用者理解應用程式正在回應。例如,您可以使用骨架和旋轉器,或未來畫面的一小部分但有意義的部分,如封面照片、標題等。 + +在開發期間,您可以使用 [React Devtools](https://react.dev/learn/react-developer-tools) 預覽和檢查元件的載入狀態。 + +## 範例 + +### 順序資料獲取 + +當樹中的嵌套元件各自獲取其資料且請求未被[去重複](/docs/app/deep-dive/caching#request-memoization)時,就會發生順序資料獲取,導致回應時間更長。 + +順序與平行資料獲取 + +在某些情況下,您可能需要這種模式,因為一個 fetch 依賴於另一個的結果。 + +例如,`` 元件只有在 `` 元件完成獲取資料後才會開始獲取資料,因為 `` 依賴於 `artistID` prop: + +```tsx filename="app/artist/[username]/page.tsx" switcher +export default async function Page({ + params, +}: { + params: Promise<{ username: string }> +}) { + const { username } = await params + // 獲取藝人資訊 + const artist = await getArtist(username) + + return ( + <> +

{artist.name}

+ {/* 在 Playlists 元件載入時顯示 fallback UI */} + 載入中...}> + {/* 將藝人 ID 傳遞給 Playlists 元件 */} + + + + ) +} + +async function Playlists({ artistID }: { artistID: string }) { + // 使用藝人 ID 獲取播放清單 + const playlists = await getArtistPlaylists(artistID) + + return ( +
    + {playlists.map((playlist) => ( +
  • {playlist.name}
  • + ))} +
+ ) +} +``` + +```jsx filename="app/artist/[username]/page.js" switcher +export default async function Page({ params }) { + const { username } = await params + // 獲取藝人資訊 + const artist = await getArtist(username) + + return ( + <> +

{artist.name}

+ {/* 在 Playlists 元件載入時顯示 fallback UI */} + 載入中...}> + {/* 將藝人 ID 傳遞給 Playlists 元件 */} + + + + ) +} + +async function Playlists({ artistID }) { + // 使用藝人 ID 獲取播放清單 + const playlists = await getArtistPlaylists(artistID) + + return ( +
    + {playlists.map((playlist) => ( +
  • {playlist.name}
  • + ))} +
+ ) +} +``` + +為了改善使用者體驗,您應該使用 [React ``](/docs/app/building-your-application/routing/loading-ui-and-streaming#streaming-with-suspense) 在獲取資料時顯示 `fallback`。這將啟用[串流](#串流)並防止整個路由被順序資料請求阻塞。 + +### 平行資料擷取 (Parallel data fetching) + +當路由中的資料請求被積極初始化並同時開始時,就會發生平行資料擷取。 + +預設情況下,[版面配置與頁面 (layouts and pages)](/docs/app/getting-started/layouts-and-pages) 是平行渲染的。因此每個區段都會盡快開始擷取資料。 + +然而,在_任何_元件中,如果將多個 `async`/`await` 請求放在彼此之後,它們仍可能是順序執行的。例如,`getAlbums` 將被阻擋直到 `getArtist` 解析完成: + +```tsx filename="app/artist/[username]/page.tsx" switcher +import { getArtist, getAlbums } from '@/app/lib/data' + +export default async function Page({ params }) { + // 這些請求將會是順序執行的 + const { username } = await params + const artist = await getArtist(username) + const albums = await getAlbums(username) + return
{artist.name}
+} +``` + +您可以透過將請求定義在使用資料的元件之外,並一起解析它們來平行初始化請求,例如使用 [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all): + +```tsx filename="app/artist/[username]/page.tsx" highlight={3,8,23} switcher +import Albums from './albums' + +async function getArtist(username: string) { + const res = await fetch(`https://api.example.com/artist/${username}`) + return res.json() +} + +async function getAlbums(username: string) { + const res = await fetch(`https://api.example.com/artist/${username}/albums`) + return res.json() +} + +export default async function Page({ + params, +}: { + params: Promise<{ username: string }> +}) { + const { username } = await params + const artistData = getArtist(username) + const albumsData = getAlbums(username) + + // 平行初始化兩個請求 + const [artist, albums] = await Promise.all([artistData, albumsData]) + + return ( + <> +

{artist.name}

+ + + ) +} +``` + +```jsx filename="app/artist/[username]/page.js" highlight={3,8,19} switcher +import Albums from './albums' + +async function getArtist(username) { + const res = await fetch(`https://api.example.com/artist/${username}`) + return res.json() +} + +async function getAlbums(username) { + const res = await fetch(`https://api.example.com/artist/${username}/albums`) + return res.json() +} + +export default async function Page({ params }) { + const { username } = await params + const artistData = getArtist(username) + const albumsData = getAlbums(username) + + // 平行初始化兩個請求 + const [artist, albums] = await Promise.all([artistData, albumsData]) + + return ( + <> +

{artist.name}

+ + + ) +} +``` + +> **須知事項:** 當使用 `Promise.all` 時,如果其中一個請求失敗,整個操作將會失敗。若要處理這種情況,您可以改用 [`Promise.allSettled`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) 方法。 + +### 預載資料 (Preloading data) + +您可以透過建立一個工具函式來預載資料,並在阻擋請求之前積極呼叫它。`` 會根據 `checkIsAvailable()` 函式的結果來條件式渲染。 + +您可以在 `checkIsAvailable()` 之前呼叫 `preload()` 來積極初始化 `` 的資料依賴。當 `` 被渲染時,其資料已經被擷取完成。 + +```tsx filename="app/item/[id]/page.tsx" switcher +import { getItem } from '@/lib/data' + +export default async function Page({ + params, +}: { + params: Promise<{ id: string }> +}) { + const { id } = await params + // 開始載入項目資料 + preload(id) + // 執行另一個非同步任務 + const isAvailable = await checkIsAvailable() + + return isAvailable ? : null +} + +export const preload = (id: string) => { + // void 會評估給定的表達式並回傳 undefined + // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/void + void getItem(id) +} +export async function Item({ id }: { id: string }) { + const result = await getItem(id) + // ... +} +``` + +```jsx filename="app/item/[id]/page.js" switcher +import { getItem } from '@/lib/data' + +export default async function Page({ params }) { + const { id } = await params + // 開始載入項目資料 + preload(id) + // 執行另一個非同步任務 + const isAvailable = await checkIsAvailable() + + return isAvailable ? : null +} + +export const preload = (id) => { + // void 會評估給定的表達式並回傳 undefined + // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/void + void getItem(id) +} +export async function Item({ id }) { + const result = await getItem(id) + // ... +``` + +此外,您可以使用 React 的 [`cache` 函式](https://react.dev/reference/react/cache) 和 [`server-only` 套件](https://www.npmjs.com/package/server-only) 來建立可重複使用的工具函式。這種方法允許您快取資料擷取函式,並確保它僅在伺服器端執行。 + +```ts filename="utils/get-item.ts" switcher +import { cache } from 'react' +import 'server-only' +import { getItem } from '@/lib/data' + +export const preload = (id: string) => { + void getItem(id) +} + +export const getItem = cache(async (id: string) => { + // ... +}) +``` + +```js filename="utils/get-item.js" switcher +import { cache } from 'react' +import 'server-only' +import { getItem } from '@/lib/data' + +export const preload = (id) => { + void getItem(id) +} + +export const getItem = cache(async (id) => { + // ... +}) +``` diff --git a/apps/docs/content/zh-hant/docs/01-app/01-getting-started/09-updating-data.mdx b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/09-updating-data.mdx new file mode 100644 index 00000000..eeca7107 --- /dev/null +++ b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/09-updating-data.mdx @@ -0,0 +1,352 @@ +--- +source-updated-at: 2025-05-22T15:18:56.000Z +translation-updated-at: 2025-05-25T20:42:38.738Z +title: 如何更新資料 +nav_title: 更新資料 +description: 學習如何在您的 Next.js 應用程式中更新資料。 +related: + title: API 參考 + description: 透過閱讀 API 參考文件,進一步了解本頁提到的功能。 + links: + - app/api-reference/functions/revalidatePath + - app/api-reference/functions/revalidateTag + - app/api-reference/functions/redirect +--- + +您可以使用 React 的 [伺服器函式 (Server Functions)](https://react.dev/reference/rsc/server-functions) 在 Next.js 中更新資料。本頁將介紹如何[建立](#creating-server-functions)和[呼叫](#invoking-server-functions)伺服器函式。 + +## 伺服器函式 + +伺服器函式是一種在伺服器端執行的非同步函式。由於它們是透過客戶端發送網路請求來呼叫的,因此本質上是非同步的。當作為 `action` 的一部分被呼叫時,它們也被稱為**伺服器動作 (Server Actions)**。 + +依照慣例,`action` 是一個傳遞給 `startTransition` 的非同步函式。在以下情況下,伺服器函式會自動被 `startTransition` 包裝: + +- 透過 `action` 屬性傳遞給 `` +- 透過 `formAction` 屬性傳遞給 ` +} +``` + +```jsx filename="app/ui/button.js" switcher +'use client' + +import { createPost } from '@/app/actions' + +export function Button() { + return +} +``` + +## 呼叫伺服器函式 + +主要有兩種方式可以呼叫伺服器函式: + +1. 在伺服器和客戶端元件中使用[表單](#forms) +2. 在客戶端元件中使用[事件處理器](#event-handlers) + +### 表單 + +React 擴展了 HTML [``](https://react.dev/reference/react-dom/components/form) 元素,允許透過 HTML `action` 屬性呼叫伺服器函式。 + +當在表單中呼叫時,函式會自動接收 [`FormData`](https://developer.mozilla.org/docs/Web/API/FormData/FormData) 物件。您可以使用原生的 [`FormData` 方法](https://developer.mozilla.org/en-US/docs/Web/API/FormData#instance_methods)來提取資料: + +```tsx filename="app/ui/form.tsx" switcher +import { createPost } from '@/app/actions' + +export function Form() { + return ( + + + + + + ) +} +``` + +```jsx filename="app/ui/form.js" switcher +import { createPost } from '@/app/actions' + +export function Form() { + return ( +
+ + + +
+ ) +} +``` + +```ts filename="app/actions.ts" switcher +'use server' + +export async function createPost(formData: FormData) { + const title = formData.get('title') + const content = formData.get('content') + + // 更新資料 + // 重新驗證快取 +} +``` + +```js filename="app/actions.js" switcher +'use server' + +export async function createPost(formData) { + const title = formData.get('title') + const content = formData.get('content') + + // 更新資料 + // 重新驗證快取 +} +``` + +> **小知識:** 當傳遞給 `action` 屬性時,伺服器函式也被稱為 _伺服器動作_。 + +### 事件處理器 + +您可以在客戶端元件中使用 `onClick` 等事件處理器來呼叫伺服器函式。 + +```tsx filename="app/like-button.tsx" switcher +'use client' + +import { incrementLike } from './actions' +import { useState } from 'react' + +export default function LikeButton({ initialLikes }: { initialLikes: number }) { + const [likes, setLikes] = useState(initialLikes) + + return ( + <> +

總讚數: {likes}

+ + + ) +} +``` + +```jsx filename="app/like-button.js" switcher +'use client' + +import { incrementLike } from './actions' +import { useState } from 'react' + +export default function LikeButton({ initialLikes }) { + const [likes, setLikes] = useState(initialLikes) + + return ( + <> +

總讚數: {likes}

+ + + ) +} +``` + +## 範例 + +### 顯示處理中狀態 + +在執行伺服器函式時,您可以使用 React 的 [`useActionState`](https://react.dev/reference/react/useActionState) 鉤子來顯示載入指示器。該鉤子會回傳一個 `pending` 布林值: + +```tsx filename="app/ui/button.tsx" switcher +'use client' + +import { useActionState } from 'react' +import { createPost } from '@/app/actions' +import { LoadingSpinner } from '@/app/ui/loading-spinner' + +export function Button() { + const [state, action, pending] = useActionState(createPost, false) + + return ( + + ) +} +``` + +```jsx filename="app/ui/button.js" switcher +'use client' + +import { useActionState } from 'react' +import { createPost } from '@/app/actions' +import { LoadingSpinner } from '@/app/ui/loading-spinner' + +export function Button() { + const [state, action, pending] = useActionState(createPost, false) + + return ( + + ) +} +``` + +### 重新驗證快取 + +執行更新後,您可以在伺服器函式中呼叫 [`revalidatePath`](/docs/app/api-reference/functions/revalidatePath) 或 [`revalidateTag`](/docs/app/api-reference/functions/revalidateTag) 來重新驗證 Next.js 快取並顯示更新後的資料: + +```ts filename="app/lib/actions.ts" switcher +import { revalidatePath } from 'next/cache' + +export async function createPost(formData: FormData) { + 'use server' + // 更新資料 + // ... + + revalidatePath('/posts') +} +``` + +```js filename="app/actions.js" switcher +import { revalidatePath } from 'next/cache' + +export async function createPost(formData) { + 'use server' + // 更新資料 + // ... + revalidatePath('/posts') +} +``` + +### 重新導向 + +您可能希望在執行更新後將使用者重新導向到其他頁面。可以在伺服器函式中呼叫 [`redirect`](/docs/app/api-reference/functions/redirect) 來實現: + +```ts filename="app/lib/actions.ts" switcher +'use server' + +import { redirect } from 'next/navigation' + +export async function createPost(formData: FormData) { + // 更新資料 + // ... + + redirect('/posts') +} +``` + +```js filename="app/actions.js" switcher +'use server' + +import { redirect } from 'next/navigation' + +export async function createPost(formData) { + // 更新資料 + // ... + + redirect('/posts') +} +``` \ No newline at end of file diff --git a/apps/docs/content/zh-hant/docs/01-app/01-getting-started/10-error-handling.mdx b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/10-error-handling.mdx new file mode 100644 index 00000000..36b9e70e --- /dev/null +++ b/apps/docs/content/zh-hant/docs/01-app/01-getting-started/10-error-handling.mdx @@ -0,0 +1,317 @@ +--- +source-updated-at: 2025-05-22T15:18:56.000Z +translation-updated-at: 2025-05-25T20:42:33.470Z +title: 錯誤處理方法 +nav_title: 錯誤處理 +description: 了解如何顯示預期錯誤並處理未捕獲的例外情況。 +related: + title: API 參考 + description: 透過閱讀 API 參考文件深入了解本頁提到的功能。 + links: + - app/api-reference/functions/redirect + - app/api-reference/file-conventions/error + - app/api-reference/functions/not-found + - app/api-reference/file-conventions/not-found +--- + +錯誤可分為兩類:[預期錯誤](#handling-expected-errors) 與 [未捕獲例外](#handling-uncaught-exceptions)。本頁將引導您如何在 Next.js 應用程式中處理這些錯誤。 + +## 處理預期錯誤 + +預期錯誤是指在應用程式正常運作期間可能發生的錯誤,例如來自[伺服器端表單驗證](/docs/app/building-your-application/data-fetching/server-actions-and-mutations#server-side-form-validation)或失敗的請求。這些錯誤應明確處理並返回給客戶端。 + +### 伺服器函式 + +您可以使用 [`useActionState`](https://react.dev/reference/react/useActionState) 鉤子來處理[伺服器函式](https://react.dev/reference/rsc/server-functions)中的預期錯誤。 + +對於這類錯誤,請避免使用 `try`/`catch` 區塊和拋出錯誤。相反地,應將預期錯誤建模為返回值。 + +```ts filename="app/actions.ts" switcher +'use server' + +export async function createPost(prevState: any, formData: FormData) { + const title = formData.get('title') + const content = formData.get('content') + + const res = await fetch('https://api.vercel.app/posts', { + method: 'POST', + body: { title, content }, + }) + const json = await res.json() + + if (!res.ok) { + return { message: 'Failed to create post' } + } +} +``` + +```js filename="app/actions.js" switcher +'use server' + +export async function createPost(prevState, formData) { + const title = formData.get('title') + const content = formData.get('content') + + const res = await fetch('https://api.vercel.app/posts', { + method: 'POST', + body: { title, content }, + }) + const json = await res.json() + + if (!res.ok) { + return { message: 'Failed to create post' } + } +} +``` + +您可以將動作傳遞給 `useActionState` 鉤子,並使用返回的 `state` 來顯示錯誤訊息。 + +```tsx filename="app/ui/form.tsx" highlight={11,19} switcher +'use client' + +import { useActionState } from 'react' +import { createPost } from '@/app/actions' + +const initialState = { + message: '', +} + +export function Form() { + const [state, formAction, pending] = useActionState(createPost, initialState) + + return ( +
+ + + +