nextra@3.0.0
版本发布时间: 2024-09-28 13:39:32
shuding/nextra最新发布版本:nextra@3.0.1(2024-09-28 22:24:57)
Major Changes
-
e7e8e84: show react components, variable interpolation and latex in toc
-
7188278: - insert
frontMatter
as export node via custom remark plugin- remove
frontMatter.mdxOptions
support
- remove
-
023d37b: add
"type": "module"
tonextra
package -
50a52fd: - ❌ remove
_app.mdx
, use_app.{js,jsx}
or_app.{ts,tsx}
for TypeScript projects instead- ❌ remove Nextra middleware
nextra/locales
- ❌ remove
parseFileName
fromnextra/utils
- ❌ remove
nextra/filter-route-locale
- ❌ remove
resolvePageMap
andpageMapCache
fromnextra/page-map
- ❌ remove
__nextraPageOptions.pageNextRoute
- ❌ remove
pageOpts.route
andpageOpts.newNextLinkBehavior
- ❌ remove
LoaderOptions.defaultLocale
- ❌ remove
__nextra_internal__.context[route].themeConfig
- ✅ add
nextra/fetch-filepaths-from-github
- save
pageMap
to.next/static/chunks/nextra-page-map-{locale}.mjs
- save
fileMap
to.next/static/chunks/nextra-file-map.mjs
- ❌ remove Nextra middleware
-
c2ad837: update to MDX3
-
148278c: rename tailwind prefix
nx-
to_
to reduce bundle size -
919fe97: set
"peerDependencies.next": ">=13"
-
47b125d: fix global style conflicts for
<a>
/<button>
/<summary>
/<input>
/[tabindex]:not([tabindex='-1']
-
ba30c6c: use render props for className with
selected
,disabled
andhover
state for<Tab>
-
d7d8a3e: new styles for code blocks aka in next.js
-
2872606: remove
image
prop from<Card>
component, image will be showed based on truthinesschildren
prop nowset
icon
as optional prop -
63ca28b: Remove support of "_meta.json", use "_meta.{js,jsx,ts,tsx}" instead.
-
ad4823d: add zod validation for nextraConfig
-
ab07609: remove
locale
anddefaultLocale
fromnormalizePages
-
2f3be33: - set
"engines.node": ">=18"
- remove
Tab
export, useTabs.Tab
instead - remove
Card
export, useCards.Card
instead - disallow import md/mdx files that are outside the working directory, use symlinks instead
- remove
-
66cce1d: BREAKING bundle to ESM only
⚠️⚠️⚠️ use
next.config.mjs
ornext.config.js
with"type": "module"
-
b9f88e3: - remove
use-internals.ts
- remove
layout.tsx
, move directly tosetup-page.tsx
- remove
kind: 'Meta' | 'Folder' | 'MdxPage'
to keep page map smaller
- remove
-
128e195: fix React warning, remove PageOpts.toc, use
toc
prop fromcomponents.wrapper
-
576cb6f: - rename
nextraConfig.flexsearch
tonextraConfig.search
-
1f3e7cd: - remove
__nextraPageOptions.hot
- remove
__nextraPageOptions.pageOptsChecksum
- remove
__nextra_internal__.refreshListeners
(no longer needed since we insert toc as esm node in remark plugin) - remove
hashFnv32a
- remove
-
198dbcc: use toc with JSX elements for remote content
-
191e6c4: - use
shikiji
instead ofshiki
- rename
useSSG
touseData
- rename
-
c7f03e5: rename
pageOpts.headings
totoc
Minor Changes
-
0fe55db: add
import { useRouter } from 'nextra/hooks'
for fetchinglocale
anddefaultLocale
-
6ec3241: Add Terraform/Move icon https://github.com/shuding/nextra/pull/2811 https://github.com/shuding/nextra/pull/2808
-
c7f03e5: should not add virtual
_meta
file if missing -
3644e1c: add
remark-smartypants
-
5a63701: add icons for following languages:
- GraphQL (
graphql
) - C++ (
c++
,cpp
) - C# (
csharp
,c#
,cs
) - Python (
python
,py
)
allow disallow mobile word wrap button in code blocks with
word-wrap=false
meta data setting - GraphQL (
-
60ec68c: improvements for remarkStaticImage:
- import same image only once
- support importing images by markdown image definitions
-
a52a869: add
frontmatter.sidebarTitle
support for setting page label in sidebar via frontmatter -
6ec3241: Make the
<Tab>
component be crawlable and indexable by search engines by default -
f71e660: change to shiki again
-
6070b02: rename
frontmatter.sidebar_label
tofrontmatter.sidebarTitle
-
4e55c06: add support for
_meta.{js,jsx,ts,tsx}
with JSX support -
8bce16d: replace
transformPageOpts
nextra option bytransformPageMap
-
3043826: add shikiji twoslash
Demo feature: https://nextra-v2-na3obnhub-shuding1.vercel.app/docs/guide/twoslash-support
-
6070b02: move
removeLinks
function fromnextra-theme-docs
tonextra/remove-links
-
440ff42: add MathJax support
Patch Changes
-
d1e3e9a: handle case when meta object was added in
transformPageMap
-
73239c4: To ensure consistent horizontal padding, set the default language as plaintext for code blocks. This prevents any loss of formatting for code blocks without a specified language.
-
2b9b95b: migrate to
@headlessui/react
v2 -
2a3e3e7: Fix first list item in
<FileTree>
not within permitted parent elements -
a3b67ae:
_meta
should returnexport const getStaticProps = () => ({ notFound: true })
for static exports, instead of page without contain -
1a36469: add
frontMatter.sidebarTitle
only iffrontMatter.title
is empty -
799174f: fixed creating
pageMap
items for folders with dotsremove requirement of passing
filePaths
with.md
/.mdx
extensions forcreateCatchAllMeta
function -
98f439c: export
evaluate
function for remote content -
cb24790: fix broken
export default
statement in mdx files -
982862f: Support for
h2
andh4
Markdown headings with the Steps component. -
a8c2196: use dynamic import for loading
mermaid
-
0b5cc9d: make nextra compatible with windows
-
fe5061b: fix for remote docs
-
1a634cd: remove explicit
ZodError
assertion -
ad108ff: use
overflow-x-auto
insteadoverflow-x-scroll
for<Table>
-
4f0f6b2: Omit
...{:type}
inline code annotations from search index #2922 -
1f3e7cd: fix
pageProps
for NextraLayout -
90c129e: children in Card component is required only if the image prop is true
-
150184b: attach heading anchor
id
attribute to heading (like Pagefind do) and fix heading anchor styles whentheme.typesetting: 'article'
is set -
c74ae90: Fix TypeError: _jsx is not a function for remote content on development environment
-
7615b62: fix
useRouter
innextra/hooks
, useasPath
insteadroute
because locale can be dynamic/[locale]
-
7bb18e3: Add a generic for
themeConfig
inNextraThemeLayoutProps
to improve type inference. -
8efbb45: remove
nextra/data
export, moveuseData
tonextra/hooks
,RemoteContent
tonextra/components
-
6f4c83a: fix unclickable links in TOC
allow passing
recmaPlugins
inmdxOptions
-
d8a406b: add
"sideEffects": false
for better tree-shaking -
9f55bd1: update rehype-pretty-code/shikiji to latest
-
ccaf3d4: Add the
autoImportThemeStyle
option to the Nextra configuration. This allows users to import the official Nextra theme CSS into a specific cascade layer. -
2630461: fix
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
on dev environment whenfrontMatter.searchable: false
-
217f708: update next-themes
fix wrong numbering for nested
<Steps>
-
57bc0e2: fix reload of nextra layout on route change, reported by sound.xyz
-
ca51306: Enhance focus ring style consistency.
-
f662237: avoid focus-visible style being cut off by overflow-hidden
-
3c6193d: Remove unnecessary
sortPages
fromserver/utils.ts
-
363b85f: add
flex-shrink: 0
for indent inFileTree
for<Ident>
and svg icons in<Folder>
and<File>
-
fef635e: ignore loading pageMap for dynamic locale
/[locale]
-
237c345: Make React 18 as minimal requirement
-
7faa096: fix visible hidden pages on mobile which set up with
display: 'hidden'
-
9099c35: remove
nextra/mdx-plugins
, addnextra/remark-plugins
-
98f439c: add rust icon
-
a95e745: Fix the line highlighting background-color does not extend to the full width of the code block when a scrollbar appears with line numbers.
-
80e11e0: move
resolvePageMap
tonextra/page-map-dynamic