Since 2.0.0, version numbers of the Nextra core and official themes (blog, docs) will be matched precisely. This release includes:
nextra@2.0.0-beta.2
nextra-theme-blog@2.0.0-beta.2
nextra-theme-docs@2.0.0-beta.2
You can upgrade with yarn add nextra@beta
or npm install nextra@beta
.
Breaking Changes
MDX v2
Nextra 2 will use MDX 2, please check the corresponding migrating guide and blog post if you are interested.
Next.js 12
Since MDX v2 is ESM-only, Nextra 2 requires at least Next.js 12 for its native ESM support.
Highlighting Lines
Before v2, you can use the highlight=1,3-5
syntax to highlight specific lines in a pre
code block:
```js highlight=1,3-5
import useSWR from 'swr'
export default function Page() {
// ...
}
```
In v2, you need to wrap it with ""
to make it a valid JSX prop:
```js highlight="1,3-5"
import useSWR from 'swr'
export default function Page() {
// ...
}
```
(The following is generated automatically and includes all PRs since this is the first release created on GitHub)
What's Changed
- Convert Windows backslash path to slash path by @sinchang in #11
- I18n by @shuding in #19
- dev(nextra): Add watch command by @davesnx in #38
- fix(loader): JSON parse throwing if isn't valid by @davesnx in #37
- Edit in Github link support for any random repository directories by @davesnx in #43
- Add Prettier config by @pacocoursey in #44
- Fix local example build on core by @pacocoursey in #45
- Decrease anchor links font size by @pacocoursey in #46
- Add postcss for Tailwind watch mode by @shuding in #47
- Ignore files with empty basename, like .DS_Store etc by @fanweixiao in #62
- Fix/css display property by @gr-qft in #55
- Add Bleed component by @shuding in #68
- Accept mdx options by @rot1024 in #76
- fix: og protocol peropty in meta by @huozhi in #79
- Change the logo wrapper from inline to block by @thien-do in #88
- Option for disabling the default font by @shuding in #89
- Fix error with React 17, i18n routes and SSG/SSR by @shuding in #96
- Fix search focusing by @madmanwithabike in #98
- Update Callout component to correctly support emojis by @shuding in #106
- Make external links safe by default. by @leerob in #111
- build stork index only when stork:true by @navin-moorthy in #120
- Allow menus collapsed by default by @benoror in #122
- minor accessibility issues ul-li by @marcosrjjunior in #138
- Fix
test.en.mdx
file typo errors, add search result list circular key handle support by @AmagiDDmxh in #146 - Support Cusdis in nextra-theme-blog by @djyde in #143
- feat: get current year dynamically by @surjithctly in #156
- Fixed fresh loading from URLs containing header tags by @nguyenvukhang in #167
- Support static next/image out of the box by @shuding in #177
- Fix GFM support and upgrade MDX loader by @shuding in #184
- Better Callouts by @shuding in #185
- Prefix stork options with
unstable_
by @shuding in #186 - Add
unstable_faviconGlyph
option to the docs theme by @shuding in #187 - Support highlighting a range of code lines by @shuding in #189
- Normalize option names by @shuding in #190
- Update loader.js by @olmesm in #180
- Support page types by @shuding in #191
- Improvements to search and mobile layout by @shuding in #192
- Improve navbar and sidebar for the docs theme by @shuding in #193
- add titleSuffix config to blog theme by @thien-do in #201
- Fixing routes so they work in Windows by @dzearing in #215
- Add option to change the Git icon in the top right corner by @maltejur in #224
- Add
rel="noreferrer"
to all links withtarget="_blank"
by @maltejur in #232 - feat: provide title fallback by @geekplux in #237
- Stripe-like search input by @jaredpalmer in #245
- Improve nav bar by @jaredpalmer in #246
- fix for MDXProvider/TOC, and bump mdx version to 2.0.0-rc2 by @ChinW in #251
- Fix sidebar for
trailingSlash: true
by @maltejur in #236 - Feature: dark mode for nextra-theme-blog by @geekplux in #242
- feat: custom head according to meta or frontMatter of post by @geekplux in #240
New Contributors
- @sinchang made their first contribution in #11
- @davesnx made their first contribution in #38
- @fanweixiao made their first contribution in #62
- @gr-qft made their first contribution in #55
- @rot1024 made their first contribution in #76
- @huozhi made their first contribution in #79
- @thien-do made their first contribution in #88
- @madmanwithabike made their first contribution in #98
- @leerob made their first contribution in #111
- @navin-moorthy made their first contribution in #120
- @benoror made their first contribution in #122
- @marcosrjjunior made their first contribution in #138
- @AmagiDDmxh made their first contribution in #146
- @djyde made their first contribution in #143
- @nguyenvukhang made their first contribution in #167
- @olmesm made their first contribution in #180
- @dzearing made their first contribution in #215
- @jaredpalmer made their first contribution in #245
- @ChinW made their first contribution in #251
Full Changelog: https://github.com/shuding/nextra/commits/v2.0.0-beta.2