From e4cfb83e05265eaf528afee4eac7265016bd9394 Mon Sep 17 00:00:00 2001 From: Dimitri POSTOLOV Date: Fri, 2 Sep 2022 20:08:08 +0300 Subject: [PATCH] define page title in sidebar from `frontMatter.title` if page is not specified in `_meta.json` (#755) * define page title in sidebar from `frontMatter.title` if page is not specified in `_meta.json` * fix typecheck * Update packages/nextra-theme-blog/src/utils/parent.ts * remove sortDate * `addPage` no longer need accept `frontMatter` (#789) * update snapshots --- .changeset/angry-keys-matter.md | 5 + .changeset/eighty-otters-build.md | 6 + .../__test__/__fixture__/pageMap.ts | 21 +- .../__test__/collect.spec.ts | 237 +++++------ .../nextra-theme-blog/__test__/parent.spec.ts | 1 + .../nextra-theme-blog/src/utils/collect.ts | 10 +- .../nextra-theme-blog/src/utils/parent.ts | 15 +- .../nextra-theme-blog/src/utils/traverse.ts | 2 +- .../__test__/__fixture__/pageMap.ts | 306 ++++++++------ .../__snapshots__/normalize-page.spec.ts.snap | 379 ++++++++++++++++++ .../__test__/normalize-page.spec.ts | 32 +- packages/nextra-theme-docs/package.json | 3 +- packages/nextra-theme-docs/src/env.d.ts | 9 - .../src/utils/normalize-pages.ts | 22 +- .../__snapshots__/context.test.ts.snap | 347 +++++++++++++++- .../__snapshots__/page-map.test.ts.snap | 190 +++++++-- packages/nextra/package.json | 2 +- packages/nextra/src/content-dump.ts | 4 +- packages/nextra/src/context.ts | 11 +- packages/nextra/src/filter-route-locale.ts | 19 +- packages/nextra/src/loader.ts | 4 +- packages/nextra/src/page-map.ts | 6 +- packages/nextra/src/plugin.ts | 123 ++++-- packages/nextra/src/types.ts | 6 +- pnpm-lock.yaml | 41 +- 25 files changed, 1381 insertions(+), 420 deletions(-) create mode 100644 .changeset/angry-keys-matter.md create mode 100644 .changeset/eighty-otters-build.md diff --git a/.changeset/angry-keys-matter.md b/.changeset/angry-keys-matter.md new file mode 100644 index 0000000000..0678a9e57d --- /dev/null +++ b/.changeset/angry-keys-matter.md @@ -0,0 +1,5 @@ +--- +'nextra': patch +--- + +`addPage` no longer need accept `frontMatter` diff --git a/.changeset/eighty-otters-build.md b/.changeset/eighty-otters-build.md new file mode 100644 index 0000000000..7212bef9d1 --- /dev/null +++ b/.changeset/eighty-otters-build.md @@ -0,0 +1,6 @@ +--- +'nextra': patch +'nextra-theme-docs': patch +--- + +define page title in sidebar from `frontMatter.title` if page is not specified in `_meta.json` diff --git a/packages/nextra-theme-blog/__test__/__fixture__/pageMap.ts b/packages/nextra-theme-blog/__test__/__fixture__/pageMap.ts index 1fae0758e8..e6bc03ed99 100644 --- a/packages/nextra-theme-blog/__test__/__fixture__/pageMap.ts +++ b/packages/nextra-theme-blog/__test__/__fixture__/pageMap.ts @@ -1,4 +1,5 @@ -import { BlogPageOpts } from '../../src/types' +import { BlogPageOpts } from '../../src' + export const indexOpts: BlogPageOpts = { filePath: 'index.mdx', route: '/', @@ -9,6 +10,7 @@ export const indexOpts: BlogPageOpts = { }, pageMap: [ { + kind: 'MdxPage', name: 'index', route: '/', locale: '', @@ -19,9 +21,11 @@ export const indexOpts: BlogPageOpts = { } }, { + kind: 'Folder', name: 'posts', children: [ { + kind: 'MdxPage', name: 'aaron-swartz-a-programmable-web', route: '/posts/aaron-swartz-a-programmable-web', locale: '', @@ -35,6 +39,7 @@ export const indexOpts: BlogPageOpts = { } }, { + kind: 'MdxPage', name: 'index', route: '/posts', locale: '', @@ -48,9 +53,11 @@ export const indexOpts: BlogPageOpts = { route: '/posts' }, { + kind: 'Folder', name: 'tags', children: [ { + kind: 'MdxPage', name: '[tag]', route: '/tags/[tag]', locale: '', @@ -112,6 +119,7 @@ export const postsOpts: BlogPageOpts = { }, pageMap: [ { + kind: 'MdxPage', name: 'index', route: '/', locale: '', @@ -122,9 +130,11 @@ export const postsOpts: BlogPageOpts = { } }, { + kind: 'Folder', name: 'posts', children: [ { + kind: 'MdxPage', name: 'aaron-swartz-a-programmable-web', route: '/posts/aaron-swartz-a-programmable-web', locale: '', @@ -138,6 +148,7 @@ export const postsOpts: BlogPageOpts = { } }, { + kind: 'MdxPage', name: 'index', route: '/posts', locale: '', @@ -151,9 +162,11 @@ export const postsOpts: BlogPageOpts = { route: '/posts' }, { + kind: 'Folder', name: 'tags', children: [ { + kind: 'MdxPage', name: '[tag]', route: '/tags/[tag]', locale: '', @@ -218,6 +231,7 @@ export const articleOpts: BlogPageOpts = { }, pageMap: [ { + kind: 'MdxPage', name: 'index', route: '/', locale: '', @@ -228,9 +242,11 @@ export const articleOpts: BlogPageOpts = { } }, { + kind: 'Folder', name: 'posts', children: [ { + kind: 'MdxPage', name: 'aaron-swartz-a-programmable-web', route: '/posts/aaron-swartz-a-programmable-web', locale: '', @@ -244,6 +260,7 @@ export const articleOpts: BlogPageOpts = { } }, { + kind: 'MdxPage', name: 'index', route: '/posts', locale: '', @@ -257,9 +274,11 @@ export const articleOpts: BlogPageOpts = { route: '/posts' }, { + kind: 'Folder', name: 'tags', children: [ { + kind: 'MdxPage', name: '[tag]', route: '/tags/[tag]', locale: '', diff --git a/packages/nextra-theme-blog/__test__/collect.spec.ts b/packages/nextra-theme-blog/__test__/collect.spec.ts index d6c4a411ab..e47b9c8803 100644 --- a/packages/nextra-theme-blog/__test__/collect.spec.ts +++ b/packages/nextra-theme-blog/__test__/collect.spec.ts @@ -11,136 +11,145 @@ describe('collect', () => { it('page', () => { expect(collectPostsAndNavs({ opts: indexOpts, config })) .toMatchInlineSnapshot(` - { - "navPages": [ - { - "active": false, - "frontMatter": { - "date": "2020-01-03T00:00:00.000Z", - "title": "Random Thoughts", - "type": "posts", + { + "navPages": [ + { + "active": false, + "frontMatter": { + "date": "2020-01-03T00:00:00.000Z", + "title": "Random Thoughts", + "type": "posts", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/posts", }, - "locale": "", - "name": "index", - "route": "/posts", - }, - { - "active": true, - "frontMatter": { - "date": "2020-01-01T00:00:00.000Z", - "title": "About", - "type": "page", + { + "active": true, + "frontMatter": { + "date": "2020-01-01T00:00:00.000Z", + "title": "About", + "type": "page", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/", }, - "locale": "", - "name": "index", - "route": "/", - }, - ], - "posts": [ - { - "frontMatter": { - "author": "Shu", - "date": "2016/5/21", - "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", - "tag": "web development", - "title": "Notes on A Programmable Web by Aaron Swartz", + ], + "posts": [ + { + "frontMatter": { + "author": "Shu", + "date": "2016/5/21", + "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", + "tag": "web development", + "title": "Notes on A Programmable Web by Aaron Swartz", + }, + "kind": "MdxPage", + "locale": "", + "name": "aaron-swartz-a-programmable-web", + "route": "/posts/aaron-swartz-a-programmable-web", }, - "locale": "", - "name": "aaron-swartz-a-programmable-web", - "route": "/posts/aaron-swartz-a-programmable-web", - }, - ], - } - `) + ], + } + `) }) it('posts', () => { expect(collectPostsAndNavs({ opts: postsOpts, config })) .toMatchInlineSnapshot(` - { - "navPages": [ - { - "active": true, - "frontMatter": { - "date": "2020-01-03T00:00:00.000Z", - "title": "Random Thoughts", - "type": "posts", + { + "navPages": [ + { + "active": true, + "frontMatter": { + "date": "2020-01-03T00:00:00.000Z", + "title": "Random Thoughts", + "type": "posts", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/posts", }, - "locale": "", - "name": "index", - "route": "/posts", - }, - { - "active": false, - "frontMatter": { - "date": "2020-01-01T00:00:00.000Z", - "title": "About", - "type": "page", + { + "active": false, + "frontMatter": { + "date": "2020-01-01T00:00:00.000Z", + "title": "About", + "type": "page", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/", }, - "locale": "", - "name": "index", - "route": "/", - }, - ], - "posts": [ - { - "frontMatter": { - "author": "Shu", - "date": "2016/5/21", - "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", - "tag": "web development", - "title": "Notes on A Programmable Web by Aaron Swartz", + ], + "posts": [ + { + "frontMatter": { + "author": "Shu", + "date": "2016/5/21", + "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", + "tag": "web development", + "title": "Notes on A Programmable Web by Aaron Swartz", + }, + "kind": "MdxPage", + "locale": "", + "name": "aaron-swartz-a-programmable-web", + "route": "/posts/aaron-swartz-a-programmable-web", }, - "locale": "", - "name": "aaron-swartz-a-programmable-web", - "route": "/posts/aaron-swartz-a-programmable-web", - }, - ], - } - `) + ], + } + `) }) it('article', () => { expect(collectPostsAndNavs({ opts: articleOpts, config })) .toMatchInlineSnapshot(` - { - "navPages": [ - { - "active": false, - "frontMatter": { - "date": "2020-01-03T00:00:00.000Z", - "title": "Random Thoughts", - "type": "posts", + { + "navPages": [ + { + "active": false, + "frontMatter": { + "date": "2020-01-03T00:00:00.000Z", + "title": "Random Thoughts", + "type": "posts", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/posts", }, - "locale": "", - "name": "index", - "route": "/posts", - }, - { - "active": false, - "frontMatter": { - "date": "2020-01-01T00:00:00.000Z", - "title": "About", - "type": "page", + { + "active": false, + "frontMatter": { + "date": "2020-01-01T00:00:00.000Z", + "title": "About", + "type": "page", + }, + "kind": "MdxPage", + "locale": "", + "name": "index", + "route": "/", }, - "locale": "", - "name": "index", - "route": "/", - }, - ], - "posts": [ - { - "frontMatter": { - "author": "Shu", - "date": "2016/5/21", - "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", - "tag": "web development", - "title": "Notes on A Programmable Web by Aaron Swartz", + ], + "posts": [ + { + "frontMatter": { + "author": "Shu", + "date": "2016/5/21", + "description": "At the time when I was getting into web development, I had the chance to read one of the most inspiring book about the web, Aaron Swartz's A Programmable Web. And it completely changed my mind.", + "tag": "web development", + "title": "Notes on A Programmable Web by Aaron Swartz", + }, + "kind": "MdxPage", + "locale": "", + "name": "aaron-swartz-a-programmable-web", + "route": "/posts/aaron-swartz-a-programmable-web", }, - "locale": "", - "name": "aaron-swartz-a-programmable-web", - "route": "/posts/aaron-swartz-a-programmable-web", - }, - ], - } - `) + ], + } + `) }) }) diff --git a/packages/nextra-theme-blog/__test__/parent.spec.ts b/packages/nextra-theme-blog/__test__/parent.spec.ts index 2befd19fa6..fbae0c9032 100644 --- a/packages/nextra-theme-blog/__test__/parent.spec.ts +++ b/packages/nextra-theme-blog/__test__/parent.spec.ts @@ -13,6 +13,7 @@ describe('parent', () => { "title": "Random Thoughts", "type": "posts", }, + "kind": "MdxPage", "locale": "", "name": "index", "route": "/posts", diff --git a/packages/nextra-theme-blog/src/utils/collect.ts b/packages/nextra-theme-blog/src/utils/collect.ts index 125920cf98..947c0ed9bd 100644 --- a/packages/nextra-theme-blog/src/utils/collect.ts +++ b/packages/nextra-theme-blog/src/utils/collect.ts @@ -8,9 +8,13 @@ const isNav = (page: PageMapItem): page is MdxFile => { return type && ['page', 'posts'].includes(type) } const isPost = (page: PageMapItem): page is MdxFile => { - if ('children' in page && page.children) return false - if (page.name.startsWith('_')) return false - const type = 'frontMatter' in page && page.frontMatter?.type + if ( + page.kind === 'Folder' || + page.kind === 'Meta' || + page.name.startsWith('_') + ) + return false + const type = page.frontMatter?.type return !type || type === 'post' } diff --git a/packages/nextra-theme-blog/src/utils/parent.ts b/packages/nextra-theme-blog/src/utils/parent.ts index dc3987090a..502523f74b 100644 --- a/packages/nextra-theme-blog/src/utils/parent.ts +++ b/packages/nextra-theme-blog/src/utils/parent.ts @@ -1,10 +1,11 @@ import { MdxFile } from 'nextra' import { LayoutProps } from '../types' import traverse from './traverse' +import { Folder } from 'nextra' export const getParent = ({ opts }: LayoutProps) => { let back: string | null = null - const parentPages: MdxFile[] = [] + const parentPages: (MdxFile | Folder)[] = [] const { route } = opts traverse(opts.pageMap, page => { @@ -19,14 +20,16 @@ export const getParent = ({ opts }: LayoutProps) => { const parentPage = parentPages .reverse() - .find(page => page.frontMatter && page.frontMatter.type === 'posts') + .find( + page => + 'frontMatter' in page && + page.frontMatter && + page.frontMatter.type === 'posts' + ) if (parentPage) { back = parentPage.route } - return { - parentPage, - back - } + return { parentPage, back } } diff --git a/packages/nextra-theme-blog/src/utils/traverse.ts b/packages/nextra-theme-blog/src/utils/traverse.ts index c90f8d2bab..b9ba9894f5 100644 --- a/packages/nextra-theme-blog/src/utils/traverse.ts +++ b/packages/nextra-theme-blog/src/utils/traverse.ts @@ -12,7 +12,7 @@ export default function traverse( } for (const item of pageMap) { - if ('children' in item && item.children) { + if (item.kind === 'Folder') { const matched = traverse(item.children, matcher) if (matched) { return matched diff --git a/packages/nextra-theme-docs/__test__/__fixture__/pageMap.ts b/packages/nextra-theme-docs/__test__/__fixture__/pageMap.ts index aee529b325..c5a6d7eb21 100644 --- a/packages/nextra-theme-docs/__test__/__fixture__/pageMap.ts +++ b/packages/nextra-theme-docs/__test__/__fixture__/pageMap.ts @@ -1,50 +1,54 @@ -export const cnPageMap: any[] = [ +import { PageMapItem } from 'nextra' + +export const cnPageMap: PageMapItem[] = [ { + kind: 'Folder', name: 'blog', children: [ { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'SWR 1.0 の発表' }, locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Представляем SWR 1.0' }, locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'SWR 1.0 发布' }, locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'swr-v1', route: '/blog/swr-v1', frontMatter: { @@ -59,19 +63,22 @@ export const cnPageMap: any[] = [ route: '/blog' }, { + kind: 'Folder', name: 'docs', children: [ { + kind: 'Folder', name: 'advanced', children: [ { + kind: 'MdxPage', name: 'cache', route: '/docs/advanced/cache', locale: 'zh-CN' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Cache', performance: 'Performance', 'react-native': 'React Native' @@ -79,8 +86,8 @@ export const cnPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Cache', performance: 'Rendimiento', 'react-native': 'React Native' @@ -88,8 +95,8 @@ export const cnPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'キャッシュ', performance: 'パフォーマンス', 'react-native': 'React Native' @@ -97,8 +104,8 @@ export const cnPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: '캐시', performance: '성능', 'react-native': 'React Native' @@ -106,8 +113,8 @@ export const cnPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Кеш', performance: 'Производительность', 'react-native': 'React Native' @@ -115,8 +122,8 @@ export const cnPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: '缓存', performance: '性能', 'react-native': 'React Native' @@ -124,11 +131,13 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'performance', route: '/docs/advanced/performance', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'react-native', route: '/docs/advanced/react-native', locale: 'zh-CN' @@ -137,43 +146,50 @@ export const cnPageMap: any[] = [ route: '/docs/advanced' }, { + kind: 'MdxPage', name: 'arguments', route: '/docs/arguments', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'change-log', route: '/docs/change-log', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'conditional-fetching', route: '/docs/conditional-fetching', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'data-fetching', route: '/docs/data-fetching', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'error-handling', route: '/docs/error-handling', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'getting-started', route: '/docs/getting-started', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'global-configuration', route: '/docs/global-configuration', locale: 'zh-CN' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Getting Started', options: 'Options', 'global-configuration': 'Global Configuration', @@ -195,8 +211,8 @@ export const cnPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Comienza', options: 'Opciones', 'global-configuration': 'Configuración Global', @@ -218,8 +234,8 @@ export const cnPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'はじめに', options: 'オプション', 'global-configuration': 'グローバルな設定', @@ -241,8 +257,8 @@ export const cnPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': '시작하기', options: '옵션', 'global-configuration': '전역 설정', @@ -264,8 +280,8 @@ export const cnPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Начало работы', options: 'Опции', 'global-configuration': 'Глобальная конфигурация', @@ -287,8 +303,8 @@ export const cnPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': '入门', options: '选项', 'global-configuration': '全局配置', @@ -310,46 +326,55 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'middleware', route: '/docs/middleware', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'mutation', route: '/docs/mutation', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'options', route: '/docs/options', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'pagination', route: '/docs/pagination', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'prefetching', route: '/docs/prefetching', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'revalidation', route: '/docs/revalidation', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'suspense', route: '/docs/suspense', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'with-nextjs', route: '/docs/with-nextjs', locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'typescript', route: '/docs/typescript', locale: 'en-US' @@ -358,9 +383,11 @@ export const cnPageMap: any[] = [ route: '/docs' }, { + kind: 'Folder', name: 'examples', children: [ { + kind: 'MdxPage', name: 'auth', route: '/examples/auth', frontMatter: { @@ -370,6 +397,7 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'basic', route: '/examples/basic', frontMatter: { @@ -379,6 +407,7 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'error-handling', route: '/examples/error-handling', frontMatter: { @@ -388,6 +417,7 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'infinite-loading', route: '/examples/infinite-loading', frontMatter: { @@ -397,8 +427,8 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Basic Usage', auth: 'Authentication', 'infinite-loading': 'Infinite Loading', @@ -408,8 +438,8 @@ export const cnPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Uso Básico', auth: 'Autenticación', 'infinite-loading': 'Carga Infinita', @@ -419,8 +449,8 @@ export const cnPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '基本的な使用法', auth: '認証', 'infinite-loading': '無限ローディング', @@ -430,8 +460,8 @@ export const cnPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '기본 사용법', auth: '인증', 'infinite-loading': '인피니트 로딩', @@ -441,8 +471,8 @@ export const cnPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Основное использование', auth: 'Аутентификация', 'infinite-loading': 'Бесконечная загрузка', @@ -452,8 +482,8 @@ export const cnPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '基本用法', auth: '身份验证', 'infinite-loading': '无限加载', @@ -463,6 +493,7 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'ssr', route: '/examples/ssr', frontMatter: { @@ -475,6 +506,7 @@ export const cnPageMap: any[] = [ route: '/examples' }, { + kind: 'MdxPage', name: 'index', route: '/', frontMatter: { @@ -483,8 +515,8 @@ export const cnPageMap: any[] = [ locale: 'zh-CN' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Introduction', type: 'nav', @@ -506,8 +538,8 @@ export const cnPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Introducción', type: 'nav', @@ -529,8 +561,8 @@ export const cnPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '前書き', type: 'nav', @@ -552,8 +584,8 @@ export const cnPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '소개', type: 'nav', @@ -575,8 +607,8 @@ export const cnPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Введение', type: 'nav', @@ -598,8 +630,8 @@ export const cnPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '简介', type: 'nav', @@ -622,53 +654,55 @@ export const cnPageMap: any[] = [ } ] -export const usPageMap: any[] = [ +export const usPageMap: PageMapItem[] = [ { + kind: 'Folder', name: 'blog', children: [ { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'SWR 1.0 の発表' }, locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Announcing SWR 1.0' }, locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'Представляем SWR 1.0' }, locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'swr-v1': 'SWR 1.0 发布' }, locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'swr-v1', route: '/blog/swr-v1', frontMatter: { @@ -683,19 +717,22 @@ export const usPageMap: any[] = [ route: '/blog' }, { + kind: 'Folder', name: 'docs', children: [ { + kind: 'Folder', name: 'advanced', children: [ { + kind: 'MdxPage', name: 'cache', route: '/docs/advanced/cache', locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Cache', performance: 'Performance', 'react-native': 'React Native' @@ -703,8 +740,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Cache', performance: 'Rendimiento', 'react-native': 'React Native' @@ -712,8 +749,8 @@ export const usPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'キャッシュ', performance: 'パフォーマンス', 'react-native': 'React Native' @@ -721,8 +758,8 @@ export const usPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: '캐시', performance: '성능', 'react-native': 'React Native' @@ -730,8 +767,8 @@ export const usPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: 'Кеш', performance: 'Производительность', 'react-native': 'React Native' @@ -739,8 +776,8 @@ export const usPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { cache: '缓存', performance: '性能', 'react-native': 'React Native' @@ -748,11 +785,13 @@ export const usPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'performance', route: '/docs/advanced/performance', locale: 'en-US' }, { + kind: 'MdxPage', name: 'react-native', route: '/docs/advanced/react-native', locale: 'en-US' @@ -761,43 +800,50 @@ export const usPageMap: any[] = [ route: '/docs/advanced' }, { + kind: 'MdxPage', name: 'arguments', route: '/docs/arguments', locale: 'en-US' }, { + kind: 'MdxPage', name: 'change-log', route: '/docs/change-log', locale: 'en-US' }, { + kind: 'MdxPage', name: 'conditional-fetching', route: '/docs/conditional-fetching', locale: 'en-US' }, { + kind: 'MdxPage', name: 'data-fetching', route: '/docs/data-fetching', locale: 'en-US' }, { + kind: 'MdxPage', name: 'error-handling', route: '/docs/error-handling', locale: 'en-US' }, { + kind: 'MdxPage', name: 'getting-started', route: '/docs/getting-started', locale: 'en-US' }, { + kind: 'MdxPage', name: 'global-configuration', route: '/docs/global-configuration', locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Getting Started', options: 'Options', 'global-configuration': 'Global Configuration', @@ -819,8 +865,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Comienza', options: 'Opciones', 'global-configuration': 'Configuración Global', @@ -842,8 +888,8 @@ export const usPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'はじめに', options: 'オプション', 'global-configuration': 'グローバルな設定', @@ -865,8 +911,8 @@ export const usPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': '시작하기', options: '옵션', 'global-configuration': '전역 설정', @@ -888,8 +934,8 @@ export const usPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': 'Начало работы', options: 'Опции', 'global-configuration': 'Глобальная конфигурация', @@ -911,8 +957,8 @@ export const usPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { 'getting-started': '入门', options: '选项', 'global-configuration': '全局配置', @@ -934,46 +980,55 @@ export const usPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'middleware', route: '/docs/middleware', locale: 'en-US' }, { + kind: 'MdxPage', name: 'mutation', route: '/docs/mutation', locale: 'en-US' }, { + kind: 'MdxPage', name: 'options', route: '/docs/options', locale: 'en-US' }, { + kind: 'MdxPage', name: 'pagination', route: '/docs/pagination', locale: 'en-US' }, { + kind: 'MdxPage', name: 'prefetching', route: '/docs/prefetching', locale: 'en-US' }, { + kind: 'MdxPage', name: 'revalidation', route: '/docs/revalidation', locale: 'en-US' }, { + kind: 'MdxPage', name: 'suspense', route: '/docs/suspense', locale: 'en-US' }, { + kind: 'MdxPage', name: 'typescript', route: '/docs/typescript', locale: 'en-US' }, { + kind: 'MdxPage', name: 'with-nextjs', route: '/docs/with-nextjs', locale: 'en-US' @@ -982,9 +1037,11 @@ export const usPageMap: any[] = [ route: '/docs' }, { + kind: 'Folder', name: 'examples', children: [ { + kind: 'MdxPage', name: 'auth', route: '/examples/auth', frontMatter: { @@ -994,6 +1051,7 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { + kind: 'MdxPage', name: 'basic', route: '/examples/basic', frontMatter: { @@ -1003,6 +1061,7 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { + kind: 'MdxPage', name: 'error-handling', route: '/examples/error-handling', frontMatter: { @@ -1012,6 +1071,7 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { + kind: 'MdxPage', name: 'infinite-loading', route: '/examples/infinite-loading', frontMatter: { @@ -1021,8 +1081,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Basic Usage', auth: 'Authentication', 'infinite-loading': 'Infinite Loading', @@ -1032,8 +1092,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Uso Básico', auth: 'Autenticación', 'infinite-loading': 'Carga Infinita', @@ -1043,8 +1103,8 @@ export const usPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '基本的な使用法', auth: '認証', 'infinite-loading': '無限ローディング', @@ -1054,8 +1114,8 @@ export const usPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '기본 사용법', auth: '인증', 'infinite-loading': '인피니트 로딩', @@ -1065,8 +1125,8 @@ export const usPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: 'Основное использование', auth: 'Аутентификация', 'infinite-loading': 'Бесконечная загрузка', @@ -1076,8 +1136,8 @@ export const usPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { basic: '基本用法', auth: '身份验证', 'infinite-loading': '无限加载', @@ -1087,6 +1147,7 @@ export const usPageMap: any[] = [ locale: 'zh-CN' }, { + kind: 'MdxPage', name: 'ssr', route: '/examples/ssr', frontMatter: { @@ -1099,6 +1160,7 @@ export const usPageMap: any[] = [ route: '/examples' }, { + kind: 'MdxPage', name: 'index', route: '/', frontMatter: { @@ -1107,8 +1169,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Introduction', type: 'nav', @@ -1130,8 +1192,8 @@ export const usPageMap: any[] = [ locale: 'en-US' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Introducción', type: 'nav', @@ -1153,8 +1215,8 @@ export const usPageMap: any[] = [ locale: 'es-ES' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '前書き', type: 'nav', @@ -1176,8 +1238,8 @@ export const usPageMap: any[] = [ locale: 'ja' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '소개', type: 'nav', @@ -1199,8 +1261,8 @@ export const usPageMap: any[] = [ locale: 'ko' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: 'Введение', type: 'nav', @@ -1222,8 +1284,8 @@ export const usPageMap: any[] = [ locale: 'ru' }, { - name: '_meta.json', - meta: { + kind: 'Meta', + data: { index: { title: '简介', type: 'nav', diff --git a/packages/nextra-theme-docs/__test__/__snapshots__/normalize-page.spec.ts.snap b/packages/nextra-theme-docs/__test__/__snapshots__/normalize-page.spec.ts.snap index d6e506ad0b..bca48d7ff3 100644 --- a/packages/nextra-theme-docs/__test__/__snapshots__/normalize-page.spec.ts.snap +++ b/packages/nextra-theme-docs/__test__/__snapshots__/normalize-page.spec.ts.snap @@ -18,12 +18,14 @@ exports[`normalize-page > /404 page 1`] = ` "activeType": undefined, "directories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -32,12 +34,14 @@ exports[`normalize-page > /404 page 1`] = ` ], "docsDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -46,12 +50,14 @@ exports[`normalize-page > /404 page 1`] = ` ], "flatDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -60,12 +66,14 @@ exports[`normalize-page > /404 page 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -81,6 +89,7 @@ exports[`normalize-page > /500 page 1`] = ` "activeIndex": 0, "activePath": [ { + "kind": "MdxPage", "name": "500", "route": "/500", "theme": { @@ -104,12 +113,14 @@ exports[`normalize-page > /500 page 1`] = ` "activeType": "page", "directories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -118,12 +129,14 @@ exports[`normalize-page > /500 page 1`] = ` ], "docsDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -132,12 +145,14 @@ exports[`normalize-page > /500 page 1`] = ` ], "flatDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -146,12 +161,14 @@ exports[`normalize-page > /500 page 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "name": "index", "route": "/", "title": "Introduction", "type": "doc", }, { + "kind": "MdxPage", "name": "get-started", "route": "/get-started", "title": "Get Started", @@ -169,6 +186,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -176,6 +194,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -183,6 +202,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -190,6 +210,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -197,6 +218,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -204,6 +226,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -211,6 +234,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -218,6 +242,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -225,6 +250,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -232,6 +258,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -239,6 +266,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -246,6 +274,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -253,6 +282,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -260,6 +290,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -267,6 +298,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -276,6 +308,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -283,6 +316,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -290,6 +324,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -297,12 +332,14 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "Advanced", "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -310,12 +347,14 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "Docs", "type": "nav", }, { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -339,6 +378,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -346,6 +386,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -353,6 +394,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -360,6 +402,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -367,6 +410,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -374,6 +418,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -381,6 +426,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -388,6 +434,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -395,6 +442,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -402,6 +450,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -409,6 +458,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -416,6 +466,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -423,6 +474,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -430,6 +482,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -437,6 +490,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -446,6 +500,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -453,6 +508,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -460,6 +516,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -467,12 +524,14 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "Advanced", "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -480,6 +539,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "Docs", @@ -492,6 +552,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -503,6 +564,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -514,6 +576,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -525,6 +588,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -536,6 +600,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -543,6 +608,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", "title": "Examples", @@ -555,6 +621,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -562,6 +629,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", "title": "Blog", @@ -571,6 +639,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "docsDirectories": [], "flatDirectories": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -578,6 +647,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -585,6 +655,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -592,6 +663,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -599,6 +671,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -606,6 +679,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -613,6 +687,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -620,6 +695,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -627,6 +703,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -634,6 +711,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -641,6 +719,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -648,6 +727,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -655,6 +735,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -662,6 +743,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -669,6 +751,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -676,6 +759,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -683,6 +767,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -690,6 +775,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -697,6 +783,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -708,6 +795,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -719,6 +807,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -730,6 +819,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -741,6 +831,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -752,6 +843,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -763,6 +855,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -772,6 +865,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -779,6 +873,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -786,6 +881,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -793,6 +889,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -800,6 +897,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -807,6 +905,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -814,6 +913,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -821,6 +921,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -828,6 +929,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -835,6 +937,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -842,6 +945,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -849,6 +953,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -856,6 +961,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -863,6 +969,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -870,6 +977,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -877,6 +985,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -884,6 +993,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -891,6 +1001,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -898,6 +1009,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -909,6 +1021,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -920,6 +1033,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -931,6 +1045,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -942,6 +1057,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -953,6 +1069,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -964,6 +1081,7 @@ exports[`normalize-page > en-US getting-started 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -984,6 +1102,7 @@ exports[`normalize-page > en-US home 1`] = ` "title": "React Hooks for Data Fetching", }, "hidden": true, + "kind": "MdxPage", "locale": "en-US", "name": "index", "route": "/", @@ -1007,6 +1126,7 @@ exports[`normalize-page > en-US home 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -1014,6 +1134,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -1021,6 +1142,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -1028,6 +1150,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -1035,6 +1158,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -1042,6 +1166,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -1049,6 +1174,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -1056,6 +1182,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -1063,6 +1190,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -1070,6 +1198,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -1077,6 +1206,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -1084,6 +1214,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -1091,6 +1222,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -1098,6 +1230,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -1105,6 +1238,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -1114,6 +1248,7 @@ exports[`normalize-page > en-US home 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -1121,6 +1256,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -1128,6 +1264,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -1135,12 +1272,14 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "Advanced", "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -1148,6 +1287,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "Docs", @@ -1160,6 +1300,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -1171,6 +1312,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -1182,6 +1324,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -1193,6 +1336,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -1204,6 +1348,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -1211,6 +1356,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", "title": "Examples", @@ -1223,6 +1369,7 @@ exports[`normalize-page > en-US home 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -1230,6 +1377,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", "title": "Blog", @@ -1239,6 +1387,7 @@ exports[`normalize-page > en-US home 1`] = ` "docsDirectories": [], "flatDirectories": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -1246,6 +1395,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -1253,6 +1403,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -1260,6 +1411,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -1267,6 +1419,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -1274,6 +1427,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -1281,6 +1435,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -1288,6 +1443,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -1295,6 +1451,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -1302,6 +1459,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -1309,6 +1467,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -1316,6 +1475,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -1323,6 +1483,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -1330,6 +1491,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -1337,6 +1499,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -1344,6 +1507,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -1351,6 +1515,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -1358,6 +1523,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -1365,6 +1531,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -1376,6 +1543,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -1387,6 +1555,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -1398,6 +1567,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -1409,6 +1579,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -1420,6 +1591,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -1431,6 +1603,7 @@ exports[`normalize-page > en-US home 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -1440,6 +1613,7 @@ exports[`normalize-page > en-US home 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", @@ -1447,6 +1621,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", @@ -1454,6 +1629,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", @@ -1461,6 +1637,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", @@ -1468,6 +1645,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", @@ -1475,6 +1653,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", @@ -1482,6 +1661,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -1489,6 +1669,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", @@ -1496,6 +1677,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", @@ -1503,6 +1685,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", @@ -1510,6 +1693,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", @@ -1517,6 +1701,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -1524,6 +1709,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -1531,6 +1717,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", @@ -1538,6 +1725,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", @@ -1545,6 +1733,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", @@ -1552,6 +1741,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", @@ -1559,6 +1749,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", @@ -1566,6 +1757,7 @@ exports[`normalize-page > en-US home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", @@ -1577,6 +1769,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -1588,6 +1781,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -1599,6 +1793,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -1610,6 +1805,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", @@ -1621,6 +1817,7 @@ exports[`normalize-page > en-US home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -1632,6 +1829,7 @@ exports[`normalize-page > en-US home 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", @@ -1650,6 +1848,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -1657,6 +1856,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -1664,6 +1864,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -1671,6 +1872,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -1678,6 +1880,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -1685,6 +1888,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -1692,6 +1896,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -1699,6 +1904,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -1706,6 +1912,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -1713,6 +1920,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -1720,6 +1928,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -1727,6 +1936,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -1734,6 +1944,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -1741,6 +1952,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -1748,6 +1960,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -1757,6 +1970,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -1764,6 +1978,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -1771,6 +1986,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -1778,12 +1994,14 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "高级", "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -1791,12 +2009,14 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "文档", "type": "nav", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -1820,6 +2040,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -1827,6 +2048,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -1834,6 +2056,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -1841,6 +2064,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -1848,6 +2072,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -1855,6 +2080,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -1862,6 +2088,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -1869,6 +2096,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -1876,6 +2104,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -1883,6 +2112,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -1890,6 +2120,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -1897,6 +2128,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -1904,6 +2136,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -1911,6 +2144,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -1918,6 +2152,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -1927,6 +2162,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -1934,6 +2170,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -1941,6 +2178,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -1948,12 +2186,14 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "高级", "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -1961,6 +2201,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "文档", @@ -1973,6 +2214,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -1984,6 +2226,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -1995,6 +2238,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -2006,6 +2250,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -2017,6 +2262,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -2024,6 +2270,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", "title": "示例", @@ -2036,6 +2283,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", @@ -2043,6 +2291,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", "title": "博客", @@ -2052,6 +2301,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "docsDirectories": [], "flatDirectories": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -2059,6 +2309,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -2066,6 +2317,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -2073,6 +2325,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -2080,6 +2333,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -2087,6 +2341,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -2094,6 +2349,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -2101,6 +2357,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -2108,6 +2365,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -2115,6 +2373,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -2122,6 +2381,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -2129,6 +2389,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -2136,6 +2397,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -2143,6 +2405,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -2150,6 +2413,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -2157,6 +2421,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -2164,6 +2429,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -2171,6 +2437,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -2178,6 +2445,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -2189,6 +2457,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -2200,6 +2469,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -2211,6 +2481,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -2222,6 +2493,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -2233,6 +2505,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -2244,6 +2517,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", @@ -2253,6 +2527,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -2260,6 +2535,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -2267,6 +2543,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -2274,6 +2551,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -2281,6 +2559,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -2288,6 +2567,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -2295,6 +2575,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -2302,6 +2583,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -2309,6 +2591,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -2316,6 +2599,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -2323,6 +2607,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -2330,6 +2615,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -2337,6 +2623,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -2344,6 +2631,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -2351,6 +2639,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -2358,6 +2647,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -2365,6 +2655,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -2372,6 +2663,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -2379,6 +2671,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -2390,6 +2683,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -2401,6 +2695,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -2412,6 +2707,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -2423,6 +2719,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -2434,6 +2731,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -2445,6 +2743,7 @@ exports[`normalize-page > zh-CN getting-started 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", @@ -2465,6 +2764,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "title": "用于数据请求的 React Hooks 库", }, "hidden": true, + "kind": "MdxPage", "locale": "zh-CN", "name": "index", "route": "/", @@ -2488,6 +2788,7 @@ exports[`normalize-page > zh-CN home 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -2495,6 +2796,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -2502,6 +2804,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -2509,6 +2812,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -2516,6 +2820,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -2523,6 +2828,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -2530,6 +2836,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -2537,6 +2844,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -2544,6 +2852,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -2551,6 +2860,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -2558,6 +2868,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -2565,6 +2876,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -2572,6 +2884,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -2579,6 +2892,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -2586,6 +2900,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -2595,6 +2910,7 @@ exports[`normalize-page > zh-CN home 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -2602,6 +2918,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -2609,6 +2926,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -2616,12 +2934,14 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", "title": "高级", "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -2629,6 +2949,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", "title": "文档", @@ -2641,6 +2962,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -2652,6 +2974,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -2663,6 +2986,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -2674,6 +2998,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -2685,6 +3010,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -2692,6 +3018,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", "title": "示例", @@ -2704,6 +3031,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", @@ -2711,6 +3039,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", "title": "博客", @@ -2720,6 +3049,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "docsDirectories": [], "flatDirectories": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -2727,6 +3057,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -2734,6 +3065,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -2741,6 +3073,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -2748,6 +3081,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -2755,6 +3089,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -2762,6 +3097,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -2769,6 +3105,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -2776,6 +3113,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -2783,6 +3121,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -2790,6 +3129,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -2797,6 +3137,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -2804,6 +3145,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -2811,6 +3153,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -2818,6 +3161,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -2825,6 +3169,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -2832,6 +3177,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -2839,6 +3185,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -2846,6 +3193,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -2857,6 +3205,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -2868,6 +3217,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -2879,6 +3229,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -2890,6 +3241,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -2901,6 +3253,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -2912,6 +3265,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", @@ -2921,6 +3275,7 @@ exports[`normalize-page > zh-CN home 1`] = ` ], "flatDocsDirectories": [ { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", @@ -2928,6 +3283,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", @@ -2935,6 +3291,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", @@ -2942,6 +3299,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", @@ -2949,6 +3307,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", @@ -2956,6 +3315,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", @@ -2963,6 +3323,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", @@ -2970,6 +3331,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", @@ -2977,6 +3339,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", @@ -2984,6 +3347,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", @@ -2991,6 +3355,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", @@ -2998,6 +3363,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", @@ -3005,6 +3371,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", @@ -3012,6 +3379,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", @@ -3019,6 +3387,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", @@ -3026,6 +3395,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", @@ -3033,6 +3403,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", @@ -3040,6 +3411,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", @@ -3047,6 +3419,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "type": "doc", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", @@ -3058,6 +3431,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -3069,6 +3443,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -3080,6 +3455,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -3091,6 +3467,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -3102,6 +3479,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", @@ -3113,6 +3491,7 @@ exports[`normalize-page > zh-CN home 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", diff --git a/packages/nextra-theme-docs/__test__/normalize-page.spec.ts b/packages/nextra-theme-docs/__test__/normalize-page.spec.ts index f8d96553ff..d7cadfd7d6 100644 --- a/packages/nextra-theme-docs/__test__/normalize-page.spec.ts +++ b/packages/nextra-theme-docs/__test__/normalize-page.spec.ts @@ -50,15 +50,14 @@ describe('normalize-page', () => { }) it('/404 page', () => { - const data = { + const result = normalizePages({ list: [ - { name: '404', route: '/404' }, - { name: 'get-started', route: '/get-started' }, - { name: 'index', route: '/' }, + { kind: 'MdxPage', name: '404', route: '/404' }, + { kind: 'MdxPage', name: 'get-started', route: '/get-started' }, + { kind: 'MdxPage', name: 'index', route: '/' }, { - name: '_meta.json', - route: '', - meta: { + kind: 'Meta', + data: { '404': { type: 'page', theme: { @@ -77,21 +76,19 @@ describe('normalize-page', () => { locale: 'en-US', defaultLocale: 'en-US', route: '/500ddd' - } - const result = normalizePages(data) + }) expect(result).toMatchSnapshot() }) it('/500 page', () => { - const data = { + const result = normalizePages({ list: [ - { name: '500', route: '/500', }, - { name: 'get-started', route: '/get-started' }, - { name: 'index', route: '/' }, + { kind: 'MdxPage',name: '500', route: '/500' }, + { kind: 'MdxPage',name: 'get-started', route: '/get-started' }, + { kind: 'MdxPage',name: 'index', route: '/' }, { - name: '_meta.json', - route: '', - meta: { + kind: 'Meta', + data: { '500': { type: 'page', theme: { @@ -110,8 +107,7 @@ describe('normalize-page', () => { locale: 'en-US', defaultLocale: 'en-US', route: '/500' - } - const result = normalizePages(data) + }) expect(result).toMatchSnapshot() }) }) diff --git a/packages/nextra-theme-docs/package.json b/packages/nextra-theme-docs/package.json index 85517239fd..ec1a61a422 100644 --- a/packages/nextra-theme-docs/package.json +++ b/packages/nextra-theme-docs/package.json @@ -53,8 +53,7 @@ "match-sorter": "^6.3.1", "next-themes": "^0.2.0-beta.2", "parse-git-url": "^1.0.1", - "scroll-into-view-if-needed": "^2.2.29", - "title": "^3.5.1" + "scroll-into-view-if-needed": "^2.2.29" }, "peerDependencies": { "next": ">=9.5.3", diff --git a/packages/nextra-theme-docs/src/env.d.ts b/packages/nextra-theme-docs/src/env.d.ts index da3e88972e..9f016e4490 100644 --- a/packages/nextra-theme-docs/src/env.d.ts +++ b/packages/nextra-theme-docs/src/env.d.ts @@ -1,12 +1,3 @@ -declare module 'title' { - export default function title( - title: string, - special?: { - special: string[] - } - ) -} - declare module globalThis { import { Context } from './types' var __nextra_pageContext__: { diff --git a/packages/nextra-theme-docs/src/utils/normalize-pages.ts b/packages/nextra-theme-docs/src/utils/normalize-pages.ts index 7faa6a91fe..51cc5c85cd 100644 --- a/packages/nextra-theme-docs/src/utils/normalize-pages.ts +++ b/packages/nextra-theme-docs/src/utils/normalize-pages.ts @@ -1,8 +1,7 @@ import { PageMapItem } from 'nextra' -import getTitle from 'title' -import { DEFAULT_PAGE_THEME, META_FILENAME } from '../constants' +import { DEFAULT_PAGE_THEME } from '../constants' import { PageTheme } from '../types' -import { MdxFile, MetaJsonFile } from 'nextra/src/types' +import { Folder, MdxFile } from 'nextra/src/types' function extendMeta( meta: string | Record = {}, @@ -88,16 +87,14 @@ export function normalizePages({ }) { let _meta: Record | undefined for (let item of list) { - if (item.name === META_FILENAME) { - item = item as MetaJsonFile - + if (item.kind === 'Meta') { if (item.locale === locale) { - _meta = item.meta + _meta = item.data break } // fallback if (!_meta) { - _meta = item.meta + _meta = item.data } } } @@ -139,9 +136,9 @@ export function normalizePages({ // Normalize items based on files and _meta.json. const items = list .filter( - a => + (a): a is MdxFile | Folder => // not meta - a.name !== META_FILENAME && + a.kind !== 'Meta' && // not hidden routes !a.name.startsWith('_') && // locale matches, or fallback to default locale @@ -206,7 +203,7 @@ export function normalizePages({ // Get the item's meta information. const extendedMeta = extendMeta(meta[a.name], fallbackMeta) - const { title, hidden, type = 'doc' } = extendedMeta + const { hidden, type = 'doc' } = extendedMeta const extendedPageThemeContext = { ...pageThemeContext, ...extendedMeta.theme @@ -225,11 +222,12 @@ export function normalizePages({ underCurrentDocsRoot: underCurrentDocsRoot || isCurrentDocsTree, pageThemeContext: extendedPageThemeContext }) + const title = extendedMeta.title || (type !== 'separator' && a.name) const getItem = (): Item => ({ ...a, type, - title: title || (type === 'separator' ? undefined : getTitle(a.name)), + ...(title && { title }), ...(hidden && { hidden }), ...(normalizedChildren && { children: [] }) }) diff --git a/packages/nextra/__test__/__snapshots__/context.test.ts.snap b/packages/nextra/__test__/__snapshots__/context.test.ts.snap index b6c44b7fbc..40e9f2a9aa 100644 --- a/packages/nextra/__test__/__snapshots__/context.test.ts.snap +++ b/packages/nextra/__test__/__snapshots__/context.test.ts.snap @@ -3,6 +3,7 @@ exports[`context > getAllPages() > should work 1`] = ` [ { + "kind": "MdxPage", "meta": { "theme": { "timestamp": false, @@ -13,6 +14,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/404", }, { + "kind": "MdxPage", "meta": { "theme": { "layout": "full", @@ -28,6 +30,7 @@ exports[`context > getAllPages() > should work 1`] = ` "searchable": false, "title": "React Hooks for Data Fetching", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "hidden": true, @@ -41,6 +44,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "title": "Biblioteca React Hooks para la obtención de datos", }, + "kind": "MdxPage", "locale": "es-ES", "meta": { "hidden": true, @@ -54,6 +58,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "title": "データ取得のための React Hooks ライブラリ", }, + "kind": "MdxPage", "locale": "ja", "meta": { "hidden": true, @@ -67,6 +72,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "title": "데이터 가져오기를 위한 React Hooks", }, + "kind": "MdxPage", "locale": "ko", "meta": { "hidden": true, @@ -80,6 +86,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "title": "React хуки для получения данных", }, + "kind": "MdxPage", "locale": "ru", "meta": { "hidden": true, @@ -93,6 +100,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "title": "用于数据请求的 React Hooks 库", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "hidden": true, @@ -105,6 +113,7 @@ exports[`context > getAllPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Getting Started", @@ -113,6 +122,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Getting Started", @@ -121,6 +131,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Getting Started", @@ -129,6 +140,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Getting Started", @@ -137,6 +149,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Getting Started", @@ -145,6 +158,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Getting Started", @@ -153,6 +167,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Options", @@ -161,6 +176,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Options", @@ -169,6 +185,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Options", @@ -177,6 +194,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Options", @@ -185,6 +203,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Options", @@ -193,6 +212,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Options", @@ -201,6 +221,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Global Configuration", @@ -209,6 +230,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Global Configuration", @@ -217,6 +239,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Global Configuration", @@ -225,6 +248,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Global Configuration", @@ -233,6 +257,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Global Configuration", @@ -241,6 +266,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Global Configuration", @@ -249,6 +275,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Data Fetching", @@ -257,6 +284,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Data Fetching", @@ -265,6 +293,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Data Fetching", @@ -273,6 +302,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Data Fetching", @@ -281,6 +311,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Data Fetching", @@ -289,6 +320,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Data Fetching", @@ -297,6 +329,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "hidden": true, @@ -306,6 +339,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "hidden": true, @@ -315,6 +349,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "hidden": true, @@ -324,6 +359,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "hidden": true, @@ -333,6 +369,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "hidden": true, @@ -342,6 +379,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "hidden": true, @@ -351,6 +389,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Auto Revalidation", @@ -359,6 +398,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Auto Revalidation", @@ -367,6 +407,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Auto Revalidation", @@ -375,6 +416,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Auto Revalidation", @@ -383,6 +425,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Auto Revalidation", @@ -391,6 +434,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Auto Revalidation", @@ -399,6 +443,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Conditional Data Fetching", @@ -407,6 +452,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Conditional Data Fetching", @@ -415,6 +461,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Conditional Data Fetching", @@ -423,6 +470,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Conditional Data Fetching", @@ -431,6 +479,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Conditional Data Fetching", @@ -439,6 +488,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Conditional Data Fetching", @@ -447,6 +497,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Arguments", @@ -455,6 +506,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Arguments", @@ -463,6 +515,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Arguments", @@ -471,6 +524,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Arguments", @@ -479,6 +533,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Arguments", @@ -487,6 +542,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Arguments", @@ -495,6 +551,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Mutation", @@ -503,6 +560,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Mutation", @@ -511,6 +569,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Mutation", @@ -519,6 +578,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Mutation", @@ -527,6 +587,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Mutation", @@ -535,6 +596,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Mutation", @@ -543,6 +605,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Pagination", @@ -551,6 +614,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Pagination", @@ -559,6 +623,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Pagination", @@ -567,6 +632,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Pagination", @@ -575,6 +641,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Pagination", @@ -583,6 +650,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Pagination", @@ -591,6 +659,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Prefetching", @@ -599,6 +668,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Prefetching", @@ -607,6 +677,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Prefetching", @@ -615,6 +686,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Prefetching", @@ -623,6 +695,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Prefetching", @@ -631,6 +704,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Prefetching", @@ -639,6 +713,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Next.js SSG and SSR", @@ -647,6 +722,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Next.js SSG and SSR", @@ -655,6 +731,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Next.js SSG and SSR", @@ -663,6 +740,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Next.js SSG and SSR", @@ -671,6 +749,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Next.js SSG and SSR", @@ -679,6 +758,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Next.js SSG and SSR", @@ -687,6 +767,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "TypeScript :)", @@ -695,6 +776,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/typescript", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Suspense", @@ -703,6 +785,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Suspense", @@ -711,6 +794,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Suspense", @@ -719,6 +803,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Suspense", @@ -727,6 +812,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Suspense", @@ -735,6 +821,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Suspense", @@ -743,6 +830,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Middleware", @@ -751,6 +839,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Middleware", @@ -759,6 +848,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Middleware", @@ -767,6 +857,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Middleware", @@ -775,6 +866,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Middleware", @@ -785,6 +877,7 @@ exports[`context > getAllPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Cache", @@ -793,6 +886,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Cache", @@ -801,6 +895,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Cache", @@ -809,6 +904,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Cache", @@ -817,6 +913,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Cache", @@ -825,6 +922,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Performance", @@ -833,6 +931,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Performance", @@ -841,6 +940,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Performance", @@ -849,6 +949,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Performance", @@ -857,6 +958,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Performance", @@ -865,6 +967,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Performance", @@ -873,6 +976,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "React Native", @@ -881,6 +985,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "React Native", @@ -889,6 +994,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "React Native", @@ -897,6 +1003,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "React Native", @@ -905,6 +1012,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "React Native", @@ -913,6 +1021,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Markdown import", @@ -923,12 +1032,16 @@ exports[`context > getAllPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", - "meta": undefined, + "meta": { + "title": "loooooooooooooooooooong-title", + }, "name": "loooooooooooooooooooong-title", "route": "/docs/advanced/more/loooooooooooooooooooong-title", }, ], + "kind": "Folder", "meta": { "title": "More: A Super Super Super Super Long Directory", }, @@ -936,6 +1049,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/more", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Filenames with dots", @@ -944,6 +1058,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Filenames with dots", @@ -952,6 +1067,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Filenames with dots", @@ -960,6 +1076,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Filenames with dots", @@ -968,6 +1085,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Filenames with dots", @@ -976,6 +1094,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Filenames with dots", @@ -984,6 +1103,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Code highlighting", @@ -992,6 +1112,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced/code-highlighting", }, ], + "kind": "Folder", "meta": { "title": "Advanced", }, @@ -999,6 +1120,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Advanced", @@ -1007,6 +1129,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -1018,6 +1141,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "theme": { @@ -1029,6 +1153,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "theme": { @@ -1040,6 +1165,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "theme": { @@ -1051,6 +1177,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "theme": { @@ -1062,6 +1189,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "theme": { @@ -1073,6 +1201,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Scroll With Dynamic Height", @@ -1081,6 +1210,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Scroll With Dynamic Height", @@ -1089,6 +1219,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Scroll With Dynamic Height", @@ -1097,6 +1228,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Scroll With Dynamic Height", @@ -1105,6 +1237,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Scroll With Dynamic Height", @@ -1113,6 +1246,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Scroll With Dynamic Height", @@ -1121,6 +1255,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "404/500 Custom Error Pages", @@ -1129,6 +1264,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/404-500", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -1140,12 +1276,16 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/docs/raw-layout", }, { + "kind": "MdxPage", "locale": "en-US", - "meta": undefined, + "meta": { + "title": "code-block-without-language", + }, "name": "code-block-without-language", "route": "/docs/code-block-without-language", }, ], + "kind": "Folder", "meta": { "theme": { "toc": true, @@ -1159,6 +1299,7 @@ exports[`context > getAllPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "👥 Team", @@ -1167,6 +1308,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/about/team", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "🧩 Acknowledgement", @@ -1175,6 +1317,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/about/acknowledgement", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "hidden": true, @@ -1188,6 +1331,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/about/a-page", }, ], + "kind": "Folder", "meta": { "items": { "a-page": { @@ -1218,6 +1362,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Basic Usage", @@ -1230,6 +1375,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Uso Básico", }, + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Basic Usage", @@ -1242,6 +1388,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "基本的な使用法", }, + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Basic Usage", @@ -1254,6 +1401,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "기본 사용법", }, + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Basic Usage", @@ -1266,6 +1414,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Основное использование", }, + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Basic Usage", @@ -1278,6 +1427,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Basic Usage", @@ -1290,6 +1440,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Authentication", @@ -1302,6 +1453,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Autenticación", }, + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Authentication", @@ -1314,6 +1466,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "認証", }, + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Authentication", @@ -1326,6 +1479,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "인증", }, + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Authentication", @@ -1338,6 +1492,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Аутентификация", }, + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Authentication", @@ -1350,6 +1505,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Authentication", @@ -1362,6 +1518,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Infinite Loading", @@ -1374,6 +1531,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Carga Infinita", }, + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Infinite Loading", @@ -1386,6 +1544,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "無限ローディング", }, + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Infinite Loading", @@ -1398,6 +1557,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "인피니트 로딩", }, + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Infinite Loading", @@ -1410,6 +1570,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Бесконечная загрузка", }, + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Infinite Loading", @@ -1422,6 +1583,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Infinite Loading", @@ -1434,6 +1596,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Error Handling", @@ -1446,6 +1609,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Manejo De Errores", }, + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Error Handling", @@ -1458,6 +1622,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "エラーハンドリング", }, + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Error Handling", @@ -1470,6 +1635,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "에러 처리", }, + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Error Handling", @@ -1482,6 +1648,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Обработка ошибок", }, + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Error Handling", @@ -1494,6 +1661,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Error Handling", @@ -1506,6 +1674,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Next.js SSR", @@ -1518,6 +1687,7 @@ exports[`context > getAllPages() > should work 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Next.js SSR", @@ -1526,6 +1696,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/examples/ssr", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -1537,6 +1708,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/examples/full", }, ], + "kind": "Folder", "meta": { "theme": { "layout": "full", @@ -1554,6 +1726,7 @@ exports[`context > getAllPages() > should work 1`] = ` "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -1569,6 +1742,7 @@ exports[`context > getAllPages() > should work 1`] = ` "description": "ほぼ二年前、みんなが愛する小さなデータフェッチ React ライブラリである SWR をオープンソースにしました。そして本日、私たちは大きな節目を迎えました: SWR の 1.0 バージョンです。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "ja", "meta": { "theme": { @@ -1584,6 +1758,7 @@ exports[`context > getAllPages() > should work 1`] = ` "description": "Почти 2 года назад мы сделали SWR — крошечную React библиотеку с открытым исходным кодом для выборки данных, которую люди полюбили. Сегодня мы приближаемся к еще одной вехе: версии 1.0 SWR!", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "ru", "meta": { "theme": { @@ -1599,6 +1774,7 @@ exports[`context > getAllPages() > should work 1`] = ` "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "meta": { "theme": { @@ -1610,6 +1786,7 @@ exports[`context > getAllPages() > should work 1`] = ` "route": "/blog/swr-v1", }, ], + "kind": "Folder", "meta": { "theme": { "breadcrumb": false, @@ -1628,6 +1805,7 @@ exports[`context > getAllPages() > should work 1`] = ` "frontMatter": { "searchable": false, }, + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -1649,6 +1827,7 @@ exports[`context > getAllPages() > should work 1`] = ` exports[`context > getCurrentLevelPages() > should work 1`] = ` [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Getting Started", @@ -1657,6 +1836,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Getting Started", @@ -1665,6 +1845,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Getting Started", @@ -1673,6 +1854,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Getting Started", @@ -1681,6 +1863,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Getting Started", @@ -1689,6 +1872,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Getting Started", @@ -1697,6 +1881,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Options", @@ -1705,6 +1890,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Options", @@ -1713,6 +1899,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Options", @@ -1721,6 +1908,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Options", @@ -1729,6 +1917,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Options", @@ -1737,6 +1926,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Options", @@ -1745,6 +1935,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Global Configuration", @@ -1753,6 +1944,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Global Configuration", @@ -1761,6 +1953,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Global Configuration", @@ -1769,6 +1962,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Global Configuration", @@ -1777,6 +1971,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Global Configuration", @@ -1785,6 +1980,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Global Configuration", @@ -1793,6 +1989,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Data Fetching", @@ -1801,6 +1998,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Data Fetching", @@ -1809,6 +2007,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Data Fetching", @@ -1817,6 +2016,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Data Fetching", @@ -1825,6 +2025,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Data Fetching", @@ -1833,6 +2034,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Data Fetching", @@ -1841,6 +2043,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "hidden": true, @@ -1850,6 +2053,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "hidden": true, @@ -1859,6 +2063,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "hidden": true, @@ -1868,6 +2073,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "hidden": true, @@ -1877,6 +2083,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "hidden": true, @@ -1886,6 +2093,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "hidden": true, @@ -1895,6 +2103,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Auto Revalidation", @@ -1903,6 +2112,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Auto Revalidation", @@ -1911,6 +2121,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Auto Revalidation", @@ -1919,6 +2130,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Auto Revalidation", @@ -1927,6 +2139,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Auto Revalidation", @@ -1935,6 +2148,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Auto Revalidation", @@ -1943,6 +2157,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Conditional Data Fetching", @@ -1951,6 +2166,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Conditional Data Fetching", @@ -1959,6 +2175,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Conditional Data Fetching", @@ -1967,6 +2184,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Conditional Data Fetching", @@ -1975,6 +2193,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Conditional Data Fetching", @@ -1983,6 +2202,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Conditional Data Fetching", @@ -1991,6 +2211,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Arguments", @@ -1999,6 +2220,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Arguments", @@ -2007,6 +2229,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Arguments", @@ -2015,6 +2238,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Arguments", @@ -2023,6 +2247,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Arguments", @@ -2031,6 +2256,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Arguments", @@ -2039,6 +2265,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Mutation", @@ -2047,6 +2274,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Mutation", @@ -2055,6 +2283,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Mutation", @@ -2063,6 +2292,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Mutation", @@ -2071,6 +2301,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Mutation", @@ -2079,6 +2310,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Mutation", @@ -2087,6 +2319,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Pagination", @@ -2095,6 +2328,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Pagination", @@ -2103,6 +2337,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Pagination", @@ -2111,6 +2346,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Pagination", @@ -2119,6 +2355,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Pagination", @@ -2127,6 +2364,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Pagination", @@ -2135,6 +2373,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Prefetching", @@ -2143,6 +2382,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Prefetching", @@ -2151,6 +2391,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Prefetching", @@ -2159,6 +2400,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Prefetching", @@ -2167,6 +2409,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Prefetching", @@ -2175,6 +2418,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Prefetching", @@ -2183,6 +2427,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Next.js SSG and SSR", @@ -2191,6 +2436,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Next.js SSG and SSR", @@ -2199,6 +2445,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Next.js SSG and SSR", @@ -2207,6 +2454,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Next.js SSG and SSR", @@ -2215,6 +2463,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Next.js SSG and SSR", @@ -2223,6 +2472,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Next.js SSG and SSR", @@ -2231,6 +2481,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "TypeScript :)", @@ -2239,6 +2490,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/typescript", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Suspense", @@ -2247,6 +2499,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Suspense", @@ -2255,6 +2508,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Suspense", @@ -2263,6 +2517,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Suspense", @@ -2271,6 +2526,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Suspense", @@ -2279,6 +2535,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Suspense", @@ -2287,6 +2544,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Middleware", @@ -2295,6 +2553,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Middleware", @@ -2303,6 +2562,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Middleware", @@ -2311,6 +2571,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Middleware", @@ -2319,6 +2580,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Middleware", @@ -2329,6 +2591,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Cache", @@ -2337,6 +2600,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Cache", @@ -2345,6 +2609,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Cache", @@ -2353,6 +2618,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Cache", @@ -2361,6 +2627,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Cache", @@ -2369,6 +2636,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Performance", @@ -2377,6 +2645,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Performance", @@ -2385,6 +2654,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Performance", @@ -2393,6 +2663,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Performance", @@ -2401,6 +2672,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Performance", @@ -2409,6 +2681,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Performance", @@ -2417,6 +2690,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "React Native", @@ -2425,6 +2699,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "React Native", @@ -2433,6 +2708,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "React Native", @@ -2441,6 +2717,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "React Native", @@ -2449,6 +2726,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "React Native", @@ -2457,6 +2735,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Markdown import", @@ -2467,12 +2746,16 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", - "meta": undefined, + "meta": { + "title": "loooooooooooooooooooong-title", + }, "name": "loooooooooooooooooooong-title", "route": "/docs/advanced/more/loooooooooooooooooooong-title", }, ], + "kind": "Folder", "meta": { "title": "More: A Super Super Super Super Long Directory", }, @@ -2480,6 +2763,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/more", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Filenames with dots", @@ -2488,6 +2772,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Filenames with dots", @@ -2496,6 +2781,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Filenames with dots", @@ -2504,6 +2790,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Filenames with dots", @@ -2512,6 +2799,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Filenames with dots", @@ -2520,6 +2808,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Filenames with dots", @@ -2528,6 +2817,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Code highlighting", @@ -2536,6 +2826,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced/code-highlighting", }, ], + "kind": "Folder", "meta": { "title": "Advanced", }, @@ -2543,6 +2834,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Advanced", @@ -2551,6 +2843,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -2562,6 +2855,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "theme": { @@ -2573,6 +2867,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "theme": { @@ -2584,6 +2879,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "theme": { @@ -2595,6 +2891,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "theme": { @@ -2606,6 +2903,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "theme": { @@ -2617,6 +2915,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Scroll With Dynamic Height", @@ -2625,6 +2924,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Scroll With Dynamic Height", @@ -2633,6 +2933,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Scroll With Dynamic Height", @@ -2641,6 +2942,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Scroll With Dynamic Height", @@ -2649,6 +2951,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Scroll With Dynamic Height", @@ -2657,6 +2960,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Scroll With Dynamic Height", @@ -2665,6 +2969,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "404/500 Custom Error Pages", @@ -2673,6 +2978,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/404-500", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "theme": { @@ -2684,8 +2990,11 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` "route": "/docs/raw-layout", }, { + "kind": "MdxPage", "locale": "en-US", - "meta": undefined, + "meta": { + "title": "code-block-without-language", + }, "name": "code-block-without-language", "route": "/docs/code-block-without-language", }, @@ -2695,6 +3004,7 @@ exports[`context > getCurrentLevelPages() > should work 1`] = ` exports[`context > getPagesUnderRoute() > should work 1`] = ` [ { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Cache", @@ -2703,6 +3013,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Cache", @@ -2711,6 +3022,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Cache", @@ -2719,6 +3031,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Cache", @@ -2727,6 +3040,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Cache", @@ -2735,6 +3049,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Performance", @@ -2743,6 +3058,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Performance", @@ -2751,6 +3067,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Performance", @@ -2759,6 +3076,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Performance", @@ -2767,6 +3085,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Performance", @@ -2775,6 +3094,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Performance", @@ -2783,6 +3103,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "React Native", @@ -2791,6 +3112,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "React Native", @@ -2799,6 +3121,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "React Native", @@ -2807,6 +3130,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "React Native", @@ -2815,6 +3139,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "React Native", @@ -2823,6 +3148,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Markdown import", @@ -2833,12 +3159,16 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", - "meta": undefined, + "meta": { + "title": "loooooooooooooooooooong-title", + }, "name": "loooooooooooooooooooong-title", "route": "/docs/advanced/more/loooooooooooooooooooong-title", }, ], + "kind": "Folder", "meta": { "title": "More: A Super Super Super Super Long Directory", }, @@ -2846,6 +3176,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/more", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Filenames with dots", @@ -2854,6 +3185,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "es-ES", "meta": { "title": "Filenames with dots", @@ -2862,6 +3194,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ja", "meta": { "title": "Filenames with dots", @@ -2870,6 +3203,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ko", "meta": { "title": "Filenames with dots", @@ -2878,6 +3212,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "ru", "meta": { "title": "Filenames with dots", @@ -2886,6 +3221,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "zh-CN", "meta": { "title": "Filenames with dots", @@ -2894,6 +3230,7 @@ exports[`context > getPagesUnderRoute() > should work 1`] = ` "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "en-US", "meta": { "title": "Code highlighting", diff --git a/packages/nextra/__test__/__snapshots__/page-map.test.ts.snap b/packages/nextra/__test__/__snapshots__/page-map.test.ts.snap index eaef8c303a..692e8ccb2f 100644 --- a/packages/nextra/__test__/__snapshots__/page-map.test.ts.snap +++ b/packages/nextra/__test__/__snapshots__/page-map.test.ts.snap @@ -4,16 +4,17 @@ exports[`Page Process > pageMap en-US 1`] = ` [ [ { + "kind": "MdxPage", "name": "404", "route": "/404", }, { + "kind": "MdxPage", "name": "500", "route": "/500", }, { - "locale": "en-US", - "meta": { + "data": { "404": { "theme": { "timestamp": false, @@ -84,13 +85,13 @@ exports[`Page Process > pageMap en-US 1`] = ` "type": "page", }, }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { "children": [ { - "locale": "en-US", - "meta": { + "data": { "a-page": { "hidden": true, "theme": { @@ -102,32 +103,36 @@ exports[`Page Process > pageMap en-US 1`] = ` "acknowledgement": "🧩 Acknowledgement", "team": "👥 Team", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { + "kind": "MdxPage", "locale": "en-US", "name": "a-page", "route": "/about/a-page", }, { + "kind": "MdxPage", "locale": "en-US", "name": "acknowledgement", "route": "/about/acknowledgement", }, { + "kind": "MdxPage", "locale": "en-US", "name": "team", "route": "/about/team", }, ], + "kind": "Folder", "name": "about", "route": "/about", }, { "children": [ { - "locale": "en-US", - "meta": { + "data": { "swr-v1": { "theme": { "breadcrumb": true, @@ -135,18 +140,21 @@ exports[`Page Process > pageMap en-US 1`] = ` "title": "Announcing SWR 1.0", }, }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { "frontMatter": { "description": "Almost 2 years ago we open sourced SWR, the tiny data-fetching React library that people love. Today we are reaching another milestone: the 1.0 version of SWR.", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "en-US", "name": "swr-v1", "route": "/blog/swr-v1", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", }, @@ -154,6 +162,7 @@ exports[`Page Process > pageMap en-US 1`] = ` "frontMatter": { "searchable": false, }, + "kind": "MdxPage", "locale": "en-US", "name": "blog", "route": "/blog", @@ -161,13 +170,13 @@ exports[`Page Process > pageMap en-US 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "404-500", "route": "/docs/404-500", }, { - "locale": "en-US", - "meta": { + "data": { "--- hey": { "title": "Getting Started", "type": "separator", @@ -187,6 +196,7 @@ exports[`Page Process > pageMap en-US 1`] = ` }, "title": "Change Log", }, + "code-block-without-language": "code-block-without-language", "conditional-fetching": "Conditional Data Fetching", "data-fetching": "Data Fetching", "error-handling": { @@ -218,13 +228,13 @@ exports[`Page Process > pageMap en-US 1`] = ` "typescript": "TypeScript :)", "with-nextjs": "Next.js SSG and SSR", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { "children": [ { - "locale": "en-US", - "meta": { + "data": { "*": { "theme": { "footer": false, @@ -242,24 +252,29 @@ exports[`Page Process > pageMap en-US 1`] = ` "performance": "Performance", "react-native": "React Native", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { + "kind": "MdxPage", "locale": "en-US", "name": "cache", "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "en-US", "name": "code-highlighting", "route": "/docs/advanced/code-highlighting", }, { + "kind": "MdxPage", "locale": "en-US", "name": "file-name.with.DOTS", "route": "/docs/advanced/file-name.with.DOTS", }, { + "kind": "MdxPage", "locale": "en-US", "name": "markdown-import", "route": "/docs/advanced/markdown-import", @@ -267,137 +282,169 @@ exports[`Page Process > pageMap en-US 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "loooooooooooooooooooong-title", "route": "/docs/advanced/more/loooooooooooooooooooong-title", }, + { + "data": { + "loooooooooooooooooooong-title": "loooooooooooooooooooong-title", + }, + "kind": "Meta", + "locale": "en-US", + }, ], + "kind": "Folder", "name": "more", "route": "/docs/advanced/more", }, { + "kind": "MdxPage", "locale": "en-US", "name": "performance", "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "en-US", "name": "react-native", "route": "/docs/advanced/react-native", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "name": "advanced", "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "name": "arguments", "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "en-US", "name": "change-log", "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "en-US", "name": "code-block-without-language", "route": "/docs/code-block-without-language", }, { + "kind": "MdxPage", "locale": "en-US", "name": "conditional-fetching", "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "name": "data-fetching", "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "en-US", "name": "getting-started", "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "en-US", "name": "global-configuration", "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "en-US", "name": "middleware", "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "en-US", "name": "mutation", "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "en-US", "name": "options", "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "en-US", "name": "pagination", "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "en-US", "name": "prefetching", "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "en-US", "name": "raw-layout", "route": "/docs/raw-layout", }, { + "kind": "MdxPage", "locale": "en-US", "name": "revalidation", "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "en-US", "name": "scroll-with-dynamic-height", "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "en-US", "name": "suspense", "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", }, { + "kind": "MdxPage", "locale": "en-US", "name": "with-nextjs", "route": "/docs/with-nextjs", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", }, { "children": [ { - "locale": "en-US", - "meta": { + "data": { "auth": "Authentication", "basic": "Basic Usage", "error-handling": "Error Handling", @@ -410,13 +457,15 @@ exports[`Page Process > pageMap en-US 1`] = ` "infinite-loading": "Infinite Loading", "ssr": "Next.js SSR", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { "frontMatter": { "full": true, "title": "Authentication", }, + "kind": "MdxPage", "locale": "en-US", "name": "auth", "route": "/examples/auth", @@ -426,6 +475,7 @@ exports[`Page Process > pageMap en-US 1`] = ` "full": true, "title": "Basic Usage", }, + "kind": "MdxPage", "locale": "en-US", "name": "basic", "route": "/examples/basic", @@ -435,11 +485,13 @@ exports[`Page Process > pageMap en-US 1`] = ` "full": true, "title": "Error Handling", }, + "kind": "MdxPage", "locale": "en-US", "name": "error-handling", "route": "/examples/error-handling", }, { + "kind": "MdxPage", "locale": "en-US", "name": "full", "route": "/examples/full", @@ -449,6 +501,7 @@ exports[`Page Process > pageMap en-US 1`] = ` "full": true, "title": "Infinite Loading", }, + "kind": "MdxPage", "locale": "en-US", "name": "infinite-loading", "route": "/examples/infinite-loading", @@ -458,11 +511,13 @@ exports[`Page Process > pageMap en-US 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", }, @@ -471,10 +526,18 @@ exports[`Page Process > pageMap en-US 1`] = ` "searchable": false, "title": "React Hooks for Data Fetching", }, + "kind": "MdxPage", "locale": "en-US", "name": "index", "route": "/", }, + { + "data": { + "404": "404", + "500": "500", + }, + "kind": "Meta", + }, ], "/docs/data-fetching", "Data Fetching", @@ -485,8 +548,7 @@ exports[`Page Process > pageMap zh-CN 1`] = ` [ [ { - "locale": "zh-CN", - "meta": { + "data": { "blog": { "title": "博客", "type": "page", @@ -505,13 +567,13 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "type": "page", }, }, - "name": "_meta.json", + "kind": "Meta", + "locale": "zh-CN", }, { "children": [ { - "locale": "en-US", - "meta": { + "data": { "a-page": { "hidden": true, "theme": { @@ -523,54 +585,60 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "acknowledgement": "🧩 Acknowledgement", "team": "👥 Team", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "en-US", }, { + "kind": "MdxPage", "locale": "en-US", "name": "a-page", "route": "/about/a-page", }, { + "kind": "MdxPage", "locale": "en-US", "name": "acknowledgement", "route": "/about/acknowledgement", }, { + "kind": "MdxPage", "locale": "en-US", "name": "team", "route": "/about/team", }, ], + "kind": "Folder", "name": "about", "route": "/about", }, { "children": [ { - "locale": "zh-CN", - "meta": { + "data": { "swr-v1": "SWR 1.0 发布", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "zh-CN", }, { "frontMatter": { "description": "大约两年前,我们开源了 SWR,大家喜爱的小型数据请求 React 库。今天,我们迎来了另一个里程碑:SWR 1.0 版本发布。", "image": "https://assets.vercel.com/image/upload/v1630059453/swr/v1.png", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "swr-v1", "route": "/blog/swr-v1", }, ], + "kind": "Folder", "name": "blog", "route": "/blog", }, { "children": [ { - "locale": "zh-CN", - "meta": { + "data": { "advanced": "高级", "arguments": "传入参数", "change-log": "更新日志", @@ -590,26 +658,29 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "typescript": "Typescript", "with-nextjs": "Next.js SSG 和 SSR", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "zh-CN", }, { "children": [ { - "locale": "zh-CN", - "meta": { + "data": { "cache": "缓存", "file-name.with.DOTS": "带点的文件名", "performance": "性能", "react-native": "React Native", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "zh-CN", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "cache", "route": "/docs/advanced/cache", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "file-name.with.DOTS", "route": "/docs/advanced/file-name.with.DOTS", @@ -617,165 +688,202 @@ exports[`Page Process > pageMap zh-CN 1`] = ` { "children": [ { + "kind": "MdxPage", "locale": "en-US", "name": "loooooooooooooooooooong-title", "route": "/docs/advanced/more/loooooooooooooooooooong-title", }, + { + "data": { + "loooooooooooooooooooong-title": "loooooooooooooooooooong-title", + }, + "kind": "Meta", + "locale": "en-US", + }, ], + "kind": "Folder", "name": "more", "route": "/docs/advanced/more", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "performance", "route": "/docs/advanced/performance", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "react-native", "route": "/docs/advanced/react-native", }, { + "kind": "MdxPage", "locale": "en-US", "name": "code-highlighting", "route": "/docs/advanced/code-highlighting", }, { + "kind": "MdxPage", "locale": "en-US", "name": "markdown-import", "route": "/docs/advanced/markdown-import", }, ], + "kind": "Folder", "name": "advanced", "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "arguments", "route": "/docs/arguments", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "change-log", "route": "/docs/change-log", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "conditional-fetching", "route": "/docs/conditional-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "data-fetching", "route": "/docs/data-fetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/docs/error-handling", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "getting-started", "route": "/docs/getting-started", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "global-configuration", "route": "/docs/global-configuration", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "middleware", "route": "/docs/middleware", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "mutation", "route": "/docs/mutation", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "options", "route": "/docs/options", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "pagination", "route": "/docs/pagination", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "prefetching", "route": "/docs/prefetching", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "revalidation", "route": "/docs/revalidation", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "scroll-with-dynamic-height", "route": "/docs/scroll-with-dynamic-height", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "suspense", "route": "/docs/suspense", }, { + "kind": "MdxPage", "locale": "zh-CN", "name": "with-nextjs", "route": "/docs/with-nextjs", }, { + "kind": "MdxPage", "locale": "en-US", "name": "404-500", "route": "/docs/404-500", }, { + "kind": "MdxPage", "locale": "en-US", "name": "advanced", "route": "/docs/advanced", }, { + "kind": "MdxPage", "locale": "en-US", "name": "code-block-without-language", "route": "/docs/code-block-without-language", }, { + "kind": "MdxPage", "locale": "en-US", "name": "raw-layout", "route": "/docs/raw-layout", }, { + "kind": "MdxPage", "locale": "en-US", "name": "typescript", "route": "/docs/typescript", }, ], + "kind": "Folder", "name": "docs", "route": "/docs", }, { "children": [ { - "locale": "zh-CN", - "meta": { + "data": { "auth": "身份验证", "basic": "基本用法", "error-handling": "错误处理", "infinite-loading": "无限加载", "ssr": "Next.js SSR", }, - "name": "_meta.json", + "kind": "Meta", + "locale": "zh-CN", }, { "frontMatter": { "full": true, "title": "身份验证", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "auth", "route": "/examples/auth", @@ -785,6 +893,7 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "full": true, "title": "基本用法", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "basic", "route": "/examples/basic", @@ -794,6 +903,7 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "full": true, "title": "错误处理", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "error-handling", "route": "/examples/error-handling", @@ -803,11 +913,13 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "full": true, "title": "无限加载", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "infinite-loading", "route": "/examples/infinite-loading", }, { + "kind": "MdxPage", "locale": "en-US", "name": "full", "route": "/examples/full", @@ -817,11 +929,13 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "full": true, "title": "Next.js SSR", }, + "kind": "MdxPage", "locale": "en-US", "name": "ssr", "route": "/examples/ssr", }, ], + "kind": "Folder", "name": "examples", "route": "/examples", }, @@ -829,15 +943,18 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "frontMatter": { "title": "用于数据请求的 React Hooks 库", }, + "kind": "MdxPage", "locale": "zh-CN", "name": "index", "route": "/", }, { + "kind": "MdxPage", "name": "404", "route": "/404", }, { + "kind": "MdxPage", "name": "500", "route": "/500", }, @@ -845,6 +962,7 @@ exports[`Page Process > pageMap zh-CN 1`] = ` "frontMatter": { "searchable": false, }, + "kind": "MdxPage", "locale": "en-US", "name": "blog", "route": "/blog", diff --git a/packages/nextra/package.json b/packages/nextra/package.json index 6858eec789..2c61024659 100644 --- a/packages/nextra/package.json +++ b/packages/nextra/package.json @@ -76,7 +76,7 @@ "format": "prettier --write ." }, "dependencies": { - "@mdx-js/mdx": "^2.1.2", + "@mdx-js/mdx": "^2.1.3", "@napi-rs/simple-git": "^0.1.8", "github-slugger": "^1.4.0", "graceful-fs": "^4.2.10", diff --git a/packages/nextra/src/content-dump.ts b/packages/nextra/src/content-dump.ts index 4b76b4eb18..cd0a9cf40c 100644 --- a/packages/nextra/src/content-dump.ts +++ b/packages/nextra/src/content-dump.ts @@ -42,20 +42,18 @@ export function addPage({ locale, route, title, - frontMatter, structurizedData }: { locale: string route: string title: string - frontMatter: FrontMatter structurizedData: any }): void { const dataFilename = `nextra-data-${locale}.json` asset[locale] ||= initFromCache(dataFilename) asset[locale][route] = { - title: title || frontMatter.title, + title, data: structurizedData } diff --git a/packages/nextra/src/context.ts b/packages/nextra/src/context.ts index 06285a6575..bc1f1c222b 100644 --- a/packages/nextra/src/context.ts +++ b/packages/nextra/src/context.ts @@ -1,4 +1,3 @@ -import { META_FILENAME } from './constants' import { normalizeMeta } from './utils' import { MetaJsonFile, PageMapItem, Page } from './types' @@ -24,18 +23,18 @@ function filter( } { let activeLevelPages: Page[] = [] const items: Page[] = [] - const meta = - pageMap.find((item): item is MetaJsonFile => item.name === META_FILENAME) - ?.meta || {} + const meta = pageMap.find( + (item): item is MetaJsonFile => item.kind === 'Meta' + )!.data for (const item of pageMap) { - if (item.name === META_FILENAME) continue + if (item.kind === 'Meta') continue const page = { ...item, meta: normalizeMeta(meta[item.name]) } as Page - if ('children' in page && page.children) { + if (page.kind === 'Folder') { const filtered = filter(page.children, activeLevel) page.children = filtered.items if (filtered.activeLevelPages.length) { diff --git a/packages/nextra/src/filter-route-locale.ts b/packages/nextra/src/filter-route-locale.ts index 2aa86ca28d..7b06c99387 100644 --- a/packages/nextra/src/filter-route-locale.ts +++ b/packages/nextra/src/filter-route-locale.ts @@ -1,5 +1,6 @@ -import type { MdxFile, MetaJsonFile, PageMapItem } from './types' +import { PageMapItem } from './types' import { truthy } from './utils' +import { META_FILENAME } from './constants' export default function filterRouteLocale( pageMap: PageMapItem[], @@ -14,30 +15,26 @@ export default function filterRouteLocale( const fallbackPages: Record = Object.create(null) for (let page of pageMap) { - if ('children' in page && page.children) { + if (page.kind === 'Folder') { filteredPageMap.push({ ...page, children: filterRouteLocale(page.children, locale, defaultLocale) }) continue } - page = page as MdxFile | MetaJsonFile const localDoesMatch = (!page.locale && isDefaultLocale) || page.locale === locale - + const name = page.kind === 'Meta' ? META_FILENAME : page.name if (localDoesMatch) { - fallbackPages[page.name] = null + fallbackPages[name] = null filteredPageMap.push(page) } else if ( - fallbackPages[page.name] !== null && + fallbackPages[name] !== null && (!page.locale || page.locale === defaultLocale) ) { - fallbackPages[page.name] = page + fallbackPages[name] = page } } - return [ - ...filteredPageMap, - ...Object.values(fallbackPages).filter(truthy) - ] + return [...filteredPageMap, ...Object.values(fallbackPages).filter(truthy)] } diff --git a/packages/nextra/src/loader.ts b/packages/nextra/src/loader.ts index ddee40c0a1..55110726c9 100644 --- a/packages/nextra/src/loader.ts +++ b/packages/nextra/src/loader.ts @@ -17,7 +17,6 @@ import { DEFAULT_LOCALE, OFFICIAL_THEMES, MARKDOWN_EXTENSION_REGEX, - META_FILENAME, CWD } from './constants' @@ -101,7 +100,7 @@ async function loader( const { locale } = parseFileName(mdxPath) for (const [filePath, file] of Object.entries(fileMap)) { - if (file.name === META_FILENAME && (!locale || file.locale === locale)) { + if (file.kind === 'Meta' && (!locale || file.locale === locale)) { context.addDependency(filePath) } } @@ -152,7 +151,6 @@ export default MDXContent`.trimStart() locale: locale || DEFAULT_LOCALE, route, title, - frontMatter, structurizedData }) } diff --git a/packages/nextra/src/page-map.ts b/packages/nextra/src/page-map.ts index 0f753808ca..7ec51251bf 100644 --- a/packages/nextra/src/page-map.ts +++ b/packages/nextra/src/page-map.ts @@ -30,15 +30,13 @@ export function getPageMap({ : META_FILENAME const pageMeta = - fileMap[`${metaPath}/${metaFilename}` as MetaJsonPath]?.meta?.[ - pageItem.name - ] + fileMap[`${metaPath}/${metaFilename}` as MetaJsonPath].data[pageItem.name] return { pageMap: locale ? filterRouteLocale(pageMap, locale, defaultLocale) : pageMap, - title: normalizeMeta(pageMeta)?.title || pageItem.name, + title: normalizeMeta(pageMeta).title, route: pageItem.route } } diff --git a/packages/nextra/src/plugin.ts b/packages/nextra/src/plugin.ts index 1344c4c49f..7048253216 100644 --- a/packages/nextra/src/plugin.ts +++ b/packages/nextra/src/plugin.ts @@ -5,7 +5,8 @@ import { MetaJsonPath, PageMapItem, Folder, - MdxFile + MdxFile, + MetaJsonFile } from './types' import fs from 'graceful-fs' import { promisify } from 'util' @@ -31,6 +32,7 @@ export const collectMdx = async ( const content = await readFile(filePath, 'utf8') const { data } = grayMatter(content) return { + kind: 'MdxPage', name, route, ...(locale && { locale }), @@ -45,54 +47,89 @@ export async function collectFiles( ): Promise<{ items: PageMapItem[]; fileMap: FileMap }> { const files = await readdir(dir, { withFileTypes: true }) - const items = await Promise.all( - files.map(async f => { - const filePath = path.resolve(dir, f.name) - const { name, locale, ext } = parseFileName(filePath) - const fileRoute = slash(path.join(route, name.replace(/^index$/, ''))) - - if (f.isDirectory()) { - if (fileRoute === '/api') return - const { items } = await collectFiles(filePath, fileRoute, fileMap) - if (!items.length) return - return { - name: f.name, - route: fileRoute, - children: items - } - } - - if (MARKDOWN_EXTENSION_REGEX.test(ext)) { - const fp = filePath as MdxPath - fileMap[fp] = await collectMdx(fp, fileRoute) - return fileMap[fp] + const promises = files.map(async f => { + const filePath = path.resolve(dir, f.name) + const { name, locale, ext } = parseFileName(filePath) + const fileRoute = slash(path.join(route, name.replace(/^index$/, ''))) + + if (f.isDirectory()) { + if (fileRoute === '/api') return + const { items } = await collectFiles(filePath, fileRoute, fileMap) + if (!items.length) return + return { + kind: 'Folder', + name: f.name, + route: fileRoute, + children: items } - const fileName = name + ext - - if (fileName === META_FILENAME) { - const fp = filePath as MetaJsonPath - const content = await readFile(fp, 'utf8') - fileMap[fp] = { - name: META_FILENAME, - ...(locale && { locale }), - meta: parseJsonFile(content, fp) - } - return fileMap[fp] + } + + if (MARKDOWN_EXTENSION_REGEX.test(ext)) { + const fp = filePath as MdxPath + fileMap[fp] = await collectMdx(fp, fileRoute) + return fileMap[fp] + } + const fileName = name + ext + + if (fileName === META_FILENAME) { + const fp = filePath as MetaJsonPath + const content = await readFile(fp, 'utf8') + fileMap[fp] = { + kind: 'Meta', + ...(locale && { locale }), + data: parseJsonFile(content, fp) } + return fileMap[fp] + } - if (fileName === 'meta.json') { - console.warn( - `[nextra] "meta.json" was renamed to "_meta.json". Rename the following file:`, - path.relative(CWD, filePath) - ) - } - }) + if (fileName === 'meta.json') { + console.warn( + '[nextra] "meta.json" was renamed to "_meta.json". Rename the following file:', + path.relative(CWD, filePath) + ) + } + }) + + const items = (await Promise.all(promises)).filter(truthy) + + const mdxPages = items.filter( + (item): item is MdxFile => item.kind === 'MdxPage' ) + const locales = mdxPages.map(item => item.locale) - return { - items: items.filter(truthy), - fileMap + for (const locale of locales) { + const metaIndex = items.findIndex( + item => item.kind === 'Meta' && item.locale === locale + ) + const defaultMeta: [string, string][] = mdxPages + .filter(item => item.locale === locale) + .map(item => [item.name, item.frontMatter?.title || item.name]) + const metaFilename = locale + ? META_FILENAME.replace('.', `.${locale}.`) + : META_FILENAME + const metaPath = path.join(dir, metaFilename) as MetaJsonPath + + if (metaIndex === -1) { + fileMap[metaPath] = { + kind: 'Meta', + ...(locale && { locale }), + data: Object.fromEntries(defaultMeta) + } + items.push(fileMap[metaPath]) + } else { + const { data, ...metaFile } = items[metaIndex] as MetaJsonFile + fileMap[metaPath] = { + ...metaFile, + data: { + ...data, + ...Object.fromEntries(defaultMeta.filter(([key]) => !(key in data))) + } + } + items[metaIndex] = fileMap[metaPath] + } } + + return { items, fileMap } } export class PageMapCache { diff --git a/packages/nextra/src/types.ts b/packages/nextra/src/types.ts index e2e1f67484..e930d20373 100644 --- a/packages/nextra/src/types.ts +++ b/packages/nextra/src/types.ts @@ -18,15 +18,16 @@ export interface LoaderOptions extends NextraConfig { } export interface Folder { + kind: 'Folder' name: string route: string children: FileType[] } export type MetaJsonFile = { - name: MetaFilename + kind: 'Meta' locale?: string - meta: { + data: { [fileName: string]: Meta } } @@ -35,6 +36,7 @@ export type FrontMatter = GrayMatterFile['data'] export type Meta = string | Record export type MdxFile = { + kind: 'MdxPage' name: string route: string locale?: string diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad1fbe3bcf..bb8513d4ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,7 +125,7 @@ importers: packages/nextra: specifiers: - '@mdx-js/mdx': ^2.1.2 + '@mdx-js/mdx': ^2.1.3 '@napi-rs/simple-git': ^0.1.8 '@types/github-slugger': ^1.3.0 '@types/graceful-fs': ^4.1.5 @@ -147,7 +147,7 @@ importers: slash: ^3.0.0 vitest: ^0.21.0 dependencies: - '@mdx-js/mdx': 2.1.2 + '@mdx-js/mdx': 2.1.3 '@napi-rs/simple-git': 0.1.8 github-slugger: 1.4.0 graceful-fs: 4.2.10 @@ -250,7 +250,6 @@ importers: react-dom: ^18.2.0 scroll-into-view-if-needed: ^2.2.29 tailwindcss: ^3.1.8 - title: ^3.5.1 vitest: ^0.21.0 dependencies: '@headlessui/react': 1.6.6_biqbaboplfbrettd7655fr4n2y @@ -265,7 +264,6 @@ importers: next-themes: 0.2.0_vyccxgqxcnj5vudpssiumaxlme parse-git-url: 1.0.1 scroll-into-view-if-needed: 2.2.29 - title: 3.5.1 devDependencies: '@tailwindcss/nesting': 0.0.0-insiders.565cd3e_postcss@8.4.14 '@tailwindcss/typography': 0.5.4_tailwindcss@3.1.8 @@ -614,14 +612,14 @@ packages: read-yaml-file: 1.1.0 dev: true - /@mdx-js/mdx/2.1.2: - resolution: {integrity: sha512-ASN1GUH0gXsgJ2UD/Td7FzJo1SwFkkQ5V1i9at5o/ROra7brkyMcBsotsOWJWRzmXZaLw2uXWn4aN8B3PMNFMA==} + /@mdx-js/mdx/2.1.3: + resolution: {integrity: sha512-ahbb47HJIJ4xnifaL06tDJiSyLEy1EhFAStO7RZIm3GTa7yGW3NGhZaj+GUCveFgl5oI54pY4BgiLmYm97y+zg==} dependencies: - '@types/estree-jsx': 0.0.1 + '@types/estree-jsx': 1.0.0 '@types/mdx': 2.0.2 - astring: 1.8.3 estree-util-build-jsx: 2.2.0 estree-util-is-identifier-name: 2.0.1 + estree-util-to-js: 1.1.0 estree-walker: 3.0.1 hast-util-to-estree: 2.1.0 markdown-extensions: 1.1.1 @@ -1006,12 +1004,6 @@ packages: '@types/json-schema': 7.0.11 dev: true - /@types/estree-jsx/0.0.1: - resolution: {integrity: sha512-gcLAYiMfQklDCPjQegGn0TBAn9it05ISEsEhlKQUddIk7o2XDokOcTN7HBO8tznM0D9dGezvHEfRZBfZf6me0A==} - dependencies: - '@types/estree': 1.0.0 - dev: false - /@types/estree-jsx/1.0.0: resolution: {integrity: sha512-3qvGd0z8F2ENTGr/GG1yViqfiKmRfrXVx5sJyHGFu3z7m5g5utCQtGp/g29JnjflhtQJBv1WDQukHiT58xPcYQ==} dependencies: @@ -2656,6 +2648,14 @@ packages: resolution: {integrity: sha512-rxZj1GkQhY4x1j/CSnybK9cGuMFQYFPLq0iNyopqf14aOVLFtMv7Esika+ObJWPWiOHuMOAHz3YkWoLYYRnzWQ==} dev: false + /estree-util-to-js/1.1.0: + resolution: {integrity: sha512-490lbfCcpLk+ofK6HCgqDfYs4KAfq6QVvDw3+Bm1YoKRgiOjKiKYGAVQE1uwh7zVxBgWhqp4FDtp5SqunpUk1A==} + dependencies: + '@types/estree-jsx': 1.0.0 + astring: 1.8.3 + source-map: 0.7.4 + dev: false + /estree-util-value-to-estree/1.3.0: resolution: {integrity: sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw==} engines: {node: '>=12.0.0'} @@ -5433,6 +5433,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /source-map/0.7.4: + resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} + engines: {node: '>= 8'} + dev: false + /source-map/0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} @@ -6576,7 +6581,7 @@ packages: resolution: {directory: packages/nextra-theme-blog, type: directory} id: file:packages/nextra-theme-blog name: nextra-theme-blog - version: 2.0.0-beta.21 + version: 2.0.0-beta.24 peerDependencies: next: '>=9.5.3' react: '>=16.13.1' @@ -6597,7 +6602,7 @@ packages: resolution: {directory: packages/nextra-theme-docs, type: directory} id: file:packages/nextra-theme-docs name: nextra-theme-docs - version: 2.0.0-beta.21 + version: 2.0.0-beta.24 peerDependencies: next: '>=9.5.3' react: '>=16.13.1' @@ -6626,13 +6631,13 @@ packages: resolution: {directory: packages/nextra, type: directory} id: file:packages/nextra name: nextra - version: 2.0.0-beta.21 + version: 2.0.0-beta.24 peerDependencies: next: '>=9.5.3' react: '>=16.13.1' react-dom: '>=16.13.1' dependencies: - '@mdx-js/mdx': 2.1.2 + '@mdx-js/mdx': 2.1.3 '@napi-rs/simple-git': 0.1.8 github-slugger: 1.4.0 graceful-fs: 4.2.10