diff --git a/.gitignore b/.gitignore
index 346b276368..f9136cb436 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.DS_Store
.next/
+.tsup/
node_modules/
*.log
dist/
diff --git a/README.md b/README.md
index c8c520172d..587c65afd9 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,9 @@ the watch mode for both nextra and the theme in separated terminals.
diff --git a/docs/pages/_meta.ts b/docs/pages/_meta.ts
index bafe054055..a6f350cde4 100644
--- a/docs/pages/_meta.ts
+++ b/docs/pages/_meta.ts
@@ -11,21 +11,6 @@ export default {
type: 'page',
title: 'Documentation'
},
- showcase: {
- type: 'page',
- title: 'Showcase',
- theme: {
- typesetting: 'article',
- layout: 'full'
- }
- },
- about: {
- type: 'page',
- title: 'About',
- theme: {
- typesetting: 'article'
- }
- },
version: {
type: 'menu',
title: 'Version',
@@ -37,7 +22,31 @@ export default {
}
}
},
- '404': {
+ about: {
+ type: 'page',
+ title: 'About',
+ theme: {
+ typesetting: 'article'
+ }
+ },
+ showcase: {
+ type: 'page',
+ title: 'Showcase',
+ theme: {
+ typesetting: 'article',
+ layout: 'full',
+ timestamp: false
+ }
+ },
+ sponsors: {
+ type: 'page',
+ title: 'Sponsors',
+ theme: {
+ typesetting: 'article',
+ timestamp: false
+ }
+ },
+ 404: {
type: 'page',
theme: {
timestamp: false,
diff --git a/docs/pages/about.mdx b/docs/pages/about.mdx
index a7598f4734..f5837372af 100644
--- a/docs/pages/about.mdx
+++ b/docs/pages/about.mdx
@@ -1,20 +1,31 @@
-import { Cards } from 'nextra/components'
-
# About Nextra
Nextra was initially created by [Vercel](https://vercel.com) members
[Shu Ding](https://twitter.com/shuding_) and
[Paco Coursey](https://twitter.com/pacocoursey) in 2020. Since 2021,
[Yixuan Xu](https://twitter.com/yixuanxu94) contributed tremendously to the
-project. In 2022, [Dimitri Postolov](https://twitter.com/dimaMachina_) from
+project.
+
+In 2022, [Dimitri Postolov](https://twitter.com/dimaMachina_) from
[The Guild](https://the-guild.dev) joined the core team to help with the
-development of 2.0.
+development of Nextra 2.
+
+In 2024 Nextra 3 was released, current primary maintainer
+[Dimitri Postolov](https://twitter.com/dimaMachina_) fully developed it, and
+[Oscar Xie](https://github.com/87xie)
+[actively contributed](https://github.com/shuding/nextra/pulls?q=sort%3Aupdated-desc+is%3Apr+author%3A87xie+is%3Aclosed+created%3A%3C2024-10-03)
+to this release.
+
+In 2024 Nextra 4 prerelease with [App Router](https://nextjs.org/docs/app)
+support was released, [Dimitri Postolov](https://twitter.com/dimaMachina_) fully
+developed it too. Currently, it's under development and
+[we are receiving feedback](https://github.com/shuding/nextra/issues/2600#issuecomment-2385107206).
## Team
-Currently, the project is maintained by [Shu Ding](https://twitter.com/shuding_)
-and [Dimitri Postolov](https://twitter.com/dimaMachina_). You can check out the
-full list of contributors on
+Currently, the project is maintained by
+[Dimitri Postolov](https://twitter.com/dimaMachina_). You can check out the full
+list of contributors on
[GitHub](https://github.com/shuding/nextra/graphs/contributors).
## Credits
@@ -49,16 +60,3 @@ product.
## License
The Nextra project and themes are licensed under the MIT license.
-
-## Sponsors
-
-
-
- <>>
-
-
diff --git a/docs/pages/docs/guide/organize-files.mdx b/docs/pages/docs/guide/organize-files.mdx
index 423cb20287..8dbccdded5 100644
--- a/docs/pages/docs/guide/organize-files.mdx
+++ b/docs/pages/docs/guide/organize-files.mdx
@@ -77,12 +77,55 @@ page:
-
- It's also possible to use the `.jsx`, `.ts`, `.tsx` extensions for `_meta`
- files (e.g. `_meta.ts`)
-
+### Allowed Extensions
-For example, you can put this in your `pages/_meta.js` file:
+It's possible to use the `.jsx`, `.ts` and `.tsx` extensions for `_meta` files
+as well (e.g. `_meta.ts`).
+
+### Sorting Pages Alphabetically
+
+You can use ESLint's built-in `sort-keys` rule, append
+`/* eslint sort-keys: error */` comment at the top of your `_meta` file, and you
+will receive ESLint's errors about incorrect order.
+
+### Usage with `next-sitemap`
+
+If you are using
+[next-sitemap](https://github.com/iamvishnusankar/next-sitemap), you will
+probably need to add `exclude: ['*/_meta']{:js}` to your
+`next-sitemap.config.js` file, as it is
+[tricky to exclude `_meta` files from the build](https://github.com/vercel/next.js/issues/8974#issuecomment-542525837).
+
+### Allowed Keys Values
+
+The type of your `_meta` keys should be always `string` and not `number` since
+[numbers are always ordered first](https://dev.to/frehner/the-order-of-js-object-keys-458d)
+for JavaScript objects.
+
+Following:
+
+```js filename="pages/_meta.js"
+export default {
+ foo: '',
+ 1992_10_21: '',
+ 1: ''
+}
+```
+
+Will be converted to:
+
+{/* prettier-ignore */}
+```js filename="pages/_meta.js"
+export default {
+ '1': '',
+ '19921021': '',
+ foo: ''
+}
+```
+
+## Example
+
+Put this in your `pages/_meta.js` file:
```js filename="pages/_meta.js"
export default {
@@ -108,18 +151,6 @@ export default {
}
```
-
- You can use ESLint's built-in rule sort keys with a `/* eslint sort-keys:
- error */` comment to sort your sidebar items alphabetically.
-
-
-
- If you are using
- [next-sitemap](https://github.com/iamvishnusankar/next-sitemap), you will
- probably need to add `exclude: ['*/_meta']` to your `next-sitemap.config.js`
- file, as it is tricky to exclude `_meta` files from the build.
-
-
The extra configurations are passed to the **theme** as additional information.
Check the corresponding pages for more information:
diff --git a/docs/pages/docs/index.mdx b/docs/pages/docs/index.mdx
index 76155a75cf..084319667a 100644
--- a/docs/pages/docs/index.mdx
+++ b/docs/pages/docs/index.mdx
@@ -11,15 +11,10 @@ import { Cards } from 'nextra/components'
To start using Nextra, you need to select a theme first:
-
+
<>>
-
+
<>>
diff --git a/docs/pages/showcase.mdx b/docs/pages/showcase.mdx
index c71267a8c4..eefbeb70e0 100644
--- a/docs/pages/showcase.mdx
+++ b/docs/pages/showcase.mdx
@@ -4,199 +4,178 @@ title: Showcase
import { Cards } from 'nextra/components'
-{Showcase }
+
+ {'Showcase'}
+
-{Open
-source projects powered by Nextra
}
+
+ {'Open source projects powered by Nextra'}
+
-
+
+ <>>
+
+
+ <>>
+
+
+ <>>
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
<>>
-
-
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
- <>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>

>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
<>>
-
-
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
-
+
+
<>>
-
+
-export const ShowcaseCard = Object.assign(
+export const Card = /* @__PURE__ */ Object.assign(
// Copy card component and add default props
Cards.Card.bind(),
{
- displayName: 'ShowcaseCard',
+ displayName: 'Card',
defaultProps: {
- image: true,
arrow: true,
- target: '_blank'
+ target: '_blank',
+ rel: 'noreferrer'
}
}
)
diff --git a/docs/pages/showcase/react-flow.jpg b/docs/pages/showcase/react-flow.jpg
new file mode 100644
index 0000000000..c085ea5227
Binary files /dev/null and b/docs/pages/showcase/react-flow.jpg differ
diff --git a/docs/pages/showcase/svelte-flow.jpg b/docs/pages/showcase/svelte-flow.jpg
new file mode 100644
index 0000000000..42d88a98a2
Binary files /dev/null and b/docs/pages/showcase/svelte-flow.jpg differ
diff --git a/docs/pages/showcase/xyflow.jpg b/docs/pages/showcase/xyflow.jpg
new file mode 100644
index 0000000000..f145289660
Binary files /dev/null and b/docs/pages/showcase/xyflow.jpg differ
diff --git a/docs/pages/sponsors.mdx b/docs/pages/sponsors.mdx
new file mode 100644
index 0000000000..817b684812
--- /dev/null
+++ b/docs/pages/sponsors.mdx
@@ -0,0 +1,38 @@
+import { Button, Cards } from 'nextra/components'
+import { Card } from './showcase.mdx'
+
+
+ {'Sponsors'}
+
+
+
+ {'Your sponsorship means a lot to open source projects, including Nextra'}
+
+
+
+ {'Support Nextra'}
+
+
+{/* Organization Sponsors */}
+
+
+
+ <>>
+
+
+ <>>
+
+
diff --git a/examples/blog/pages/posts/callout.mdx b/examples/blog/pages/posts/callout.mdx
index 96ec1c95bd..f8d303eb7b 100644
--- a/examples/blog/pages/posts/callout.mdx
+++ b/examples/blog/pages/posts/callout.mdx
@@ -108,15 +108,10 @@ Contents for step 2.
## Cards
-
+
<>>
-
+
<>>
diff --git a/examples/swr-site/pages/es/docs/getting-started.mdx b/examples/swr-site/pages/es/docs/getting-started.mdx
index d71cfdb2c7..0e37603c94 100644
--- a/examples/swr-site/pages/es/docs/getting-started.mdx
+++ b/examples/swr-site/pages/es/docs/getting-started.mdx
@@ -1,4 +1,4 @@
-import { Callout } from 'nextra/components'
+import { Callout, Steps } from 'nextra/components'
# Comienza
@@ -17,18 +17,22 @@ import { Callout } from 'nextra/components'
## Instalación
-Dentro del directorio de su proyecto React, ejecute lo siguiente:
+
+
+### Dentro del directorio de su proyecto React, ejecute lo siguiente:
```bash
yarn add swr
```
-O con npm
+### O con npm
```bash
npm install swr
```
+
+
## Inicio rápido
Para APIs RESTFul normales con datos JSON, primero necesita crear una función
diff --git a/packages/nextra-theme-blog/CHANGELOG.md b/packages/nextra-theme-blog/CHANGELOG.md
index 95925d7410..74f1579457 100644
--- a/packages/nextra-theme-blog/CHANGELOG.md
+++ b/packages/nextra-theme-blog/CHANGELOG.md
@@ -1,5 +1,17 @@
# nextra-theme-blog
+## 3.0.3
+
+### Patch Changes
+
+- 9d93caf: RTL support for the `` component.
+- 5fbce2f: Added golang logo for code blocks.
+- Updated dependencies [82fc267]
+- Updated dependencies [edc6c29]
+- Updated dependencies [9d93caf]
+- Updated dependencies [5fbce2f]
+ - nextra@3.0.3
+
## 3.0.2
### Patch Changes
diff --git a/packages/nextra-theme-blog/package.json b/packages/nextra-theme-blog/package.json
index 6513df464f..d76f1ca0d0 100644
--- a/packages/nextra-theme-blog/package.json
+++ b/packages/nextra-theme-blog/package.json
@@ -1,6 +1,6 @@
{
"name": "nextra-theme-blog",
- "version": "3.0.2",
+ "version": "3.0.3",
"description": "A Nextra theme for blogs.",
"repository": "https://github.com/shuding/nextra",
"author": "Shu Ding ",
diff --git a/packages/nextra-theme-blog/postcss.config.js b/packages/nextra-theme-blog/postcss.config.js
index c077b74bd5..f71b5a9e00 100644
--- a/packages/nextra-theme-blog/postcss.config.js
+++ b/packages/nextra-theme-blog/postcss.config.js
@@ -5,7 +5,7 @@ module.exports = {
'tailwindcss/nesting': {},
tailwindcss: {},
'postcss-lightningcss': {
- browsers: '>= .25%'
+ browsers: '>= .25% and not dead'
}
}
}
diff --git a/packages/nextra-theme-docs/CHANGELOG.md b/packages/nextra-theme-docs/CHANGELOG.md
index fbd8330d71..a4a1ea34d4 100644
--- a/packages/nextra-theme-docs/CHANGELOG.md
+++ b/packages/nextra-theme-docs/CHANGELOG.md
@@ -1,5 +1,17 @@
# nextra-theme-docs
+## 3.0.3
+
+### Patch Changes
+
+- 9d93caf: RTL support for the `` component.
+- 5fbce2f: Added golang logo for code blocks.
+- Updated dependencies [82fc267]
+- Updated dependencies [edc6c29]
+- Updated dependencies [9d93caf]
+- Updated dependencies [5fbce2f]
+ - nextra@3.0.3
+
## 3.0.2
### Patch Changes
diff --git a/packages/nextra-theme-docs/package.json b/packages/nextra-theme-docs/package.json
index b27c2fa4b6..9a719ff705 100644
--- a/packages/nextra-theme-docs/package.json
+++ b/packages/nextra-theme-docs/package.json
@@ -1,6 +1,6 @@
{
"name": "nextra-theme-docs",
- "version": "3.0.2",
+ "version": "3.0.3",
"description": "A Nextra theme for documentation sites.",
"repository": "https://github.com/shuding/nextra",
"author": "Shu Ding ",
diff --git a/packages/nextra-theme-docs/postcss.config.js b/packages/nextra-theme-docs/postcss.config.js
index c077b74bd5..f71b5a9e00 100644
--- a/packages/nextra-theme-docs/postcss.config.js
+++ b/packages/nextra-theme-docs/postcss.config.js
@@ -5,7 +5,7 @@ module.exports = {
'tailwindcss/nesting': {},
tailwindcss: {},
'postcss-lightningcss': {
- browsers: '>= .25%'
+ browsers: '>= .25% and not dead'
}
}
}
diff --git a/packages/nextra-theme-docs/src/mdx-components.tsx b/packages/nextra-theme-docs/src/mdx-components.tsx
index d9d4586299..6552e921e4 100644
--- a/packages/nextra-theme-docs/src/mdx-components.tsx
+++ b/packages/nextra-theme-docs/src/mdx-components.tsx
@@ -75,7 +75,8 @@ const createHeading = (
h4: '_mt-8 _text-xl',
h5: '_mt-8 _text-lg',
h6: '_mt-8 _text-base'
- }[Tag]
+ }[Tag],
+ className
)
}
{...props}
diff --git a/packages/nextra/CHANGELOG.md b/packages/nextra/CHANGELOG.md
index a88fba0e1f..53ad38b375 100644
--- a/packages/nextra/CHANGELOG.md
+++ b/packages/nextra/CHANGELOG.md
@@ -1,5 +1,15 @@
# nextra
+## 3.0.3
+
+### Patch Changes
+
+- 82fc267: remove
+ `Critical dependency: the request of a dependency is an expression` warnings
+- edc6c29: remove `truthy()` helper function
+- 9d93caf: RTL support for the `` component.
+- 5fbce2f: Added golang logo for code blocks.
+
## 3.0.2
### Patch Changes
diff --git a/packages/nextra/package.json b/packages/nextra/package.json
index 68110fbebf..7bbce5c62b 100644
--- a/packages/nextra/package.json
+++ b/packages/nextra/package.json
@@ -1,6 +1,6 @@
{
"name": "nextra",
- "version": "3.0.2",
+ "version": "3.0.3",
"type": "module",
"description": "Next.js and MDX based site generator.",
"repository": "https://github.com/shuding/nextra",
diff --git a/packages/nextra/src/client/components/pre.tsx b/packages/nextra/src/client/components/pre.tsx
index a8b77327a6..99bfeeebb8 100644
--- a/packages/nextra/src/client/components/pre.tsx
+++ b/packages/nextra/src/client/components/pre.tsx
@@ -52,7 +52,7 @@ export function Pre({
'_border-b-0'
)}
>
- {Icon && }
+ {Icon && }
{filename}
{copyButton}
diff --git a/packages/nextra/src/client/components/steps.tsx b/packages/nextra/src/client/components/steps.tsx
index 3d0244298e..675b880474 100644
--- a/packages/nextra/src/client/components/steps.tsx
+++ b/packages/nextra/src/client/components/steps.tsx
@@ -12,7 +12,7 @@ export function Steps({
return (
+
+
+
+
+
+
diff --git a/packages/nextra/src/client/icons/index.ts b/packages/nextra/src/client/icons/index.ts
index d16f060d55..099ff5ecad 100644
--- a/packages/nextra/src/client/icons/index.ts
+++ b/packages/nextra/src/client/icons/index.ts
@@ -5,6 +5,7 @@ export { ReactComponent as DiscordIcon } from './discord.svg'
export { ReactComponent as ExpandIcon } from './expand.svg'
export { ReactComponent as GitHubIcon } from './github.svg'
export { ReactComponent as GlobeIcon } from './globe.svg'
+export { ReactComponent as GoIcon } from './go.svg'
export { ReactComponent as InformationCircleIcon } from './information-circle.svg'
export { ReactComponent as MenuIcon } from './menu.svg'
export { ReactComponent as MoonIcon } from './moon.svg'
diff --git a/packages/nextra/src/server/compile.ts b/packages/nextra/src/server/compile.ts
index 7825079f6f..95408e5c66 100644
--- a/packages/nextra/src/server/compile.ts
+++ b/packages/nextra/src/server/compile.ts
@@ -51,7 +51,7 @@ import {
remarkStaticImage,
remarkStructurize
} from './remark-plugins/index.js'
-import { logger, truthy } from './utils.js'
+import { logger } from './utils.js'
const cachedCompilerForFormat: Record<
Exclude
,
@@ -252,7 +252,7 @@ export async function compileMdx(
}
] satisfies Pluggable,
remarkSmartypants
- ].filter(truthy),
+ ].filter(v => !!v),
rehypePlugins: [
...(rehypePlugins || []),
format === 'md' && [
@@ -295,7 +295,7 @@ export async function compileMdx(
rehypeAttachCodeMeta
]),
[rehypeExtractTocContent, { isRemoteContent }]
- ].filter(truthy),
+ ].filter(v => !!v),
recmaPlugins: [
(() => (ast: Program, file) => {
const mdxContentIndex = ast.body.findIndex(node => {
@@ -347,7 +347,7 @@ export async function compileMdx(
}) satisfies Plugin<[], Program>,
isRemoteContent ? recmaRewriteFunctionBody : recmaRewriteJsx,
...(recmaPlugins || [])
- ].filter(truthy)
+ ].filter(v => !!v)
})
}
}
diff --git a/packages/nextra/src/server/index.ts b/packages/nextra/src/server/index.ts
index e7005dded5..a29c814474 100644
--- a/packages/nextra/src/server/index.ts
+++ b/packages/nextra/src/server/index.ts
@@ -20,6 +20,8 @@ const DEFAULT_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx']
const AGNOSTIC_PAGE_MAP_PATH = `.next${sep}static${sep}chunks${sep}nextra-page-map`
+const RE_SEP = sep === '/' ? '/' : '\\\\'
+
const nextra: Nextra = nextraConfig => {
const { error } = nextraConfigSchema.safeParse(nextraConfig)
if (error) {
@@ -152,6 +154,14 @@ const nextra: Nextra = nextraConfig => {
})
}
+ const defaultLoaderOptions = [
+ options.defaultLoaders.babel,
+ {
+ loader: 'nextra/loader',
+ options: loaderOptions
+ }
+ ]
+
rules.push(
{
// Match Markdown imports from non-pages. These imports have an
@@ -162,13 +172,7 @@ const nextra: Nextra = nextraConfig => {
issuer: request =>
(!!request && !request.includes(AGNOSTIC_PAGE_MAP_PATH)) ||
request === null,
- use: [
- options.defaultLoaders.babel,
- {
- loader: 'nextra/loader',
- options: loaderOptions
- }
- ]
+ use: defaultLoaderOptions
},
{
// Match pages (imports without an issuer request).
@@ -198,15 +202,16 @@ const nextra: Nextra = nextraConfig => {
},
{
// Use platform separator because /pages\/_app\./ will not work on windows
- test: new RegExp(`pages${sep === '/' ? '/' : '\\\\'}_app\\.`),
+ test: new RegExp(`pages${RE_SEP}_app\\.`),
issuer: request => !request,
- use: [
- options.defaultLoaders.babel,
- {
- loader: 'nextra/loader',
- options: loaderOptions
- }
- ]
+ use: defaultLoaderOptions
+ },
+ {
+ test: new RegExp(
+ `@typescript${RE_SEP}vfs${RE_SEP}dist${RE_SEP}vfs\\.`
+ ),
+ issuer: request => !!request,
+ use: defaultLoaderOptions
}
)
diff --git a/packages/nextra/src/server/loader.ts b/packages/nextra/src/server/loader.ts
index e6ee41b14e..e3d61d4cd3 100644
--- a/packages/nextra/src/server/loader.ts
+++ b/packages/nextra/src/server/loader.ts
@@ -83,6 +83,14 @@ export async function loader(
const currentPath = slash(mdxPath)
+ if (currentPath.includes('@typescript/vfs/dist/vfs.')) {
+ // Fixes https://github.com/microsoft/TypeScript-Website/pull/3022
+ // Fixes https://github.com/shuding/nextra/issues/3322#issuecomment-2384046618
+ return source
+ .replace(/String\.fromCharCode\(112, ?97, ?116, ?104\)/, '"path"')
+ .replace(/String\.fromCharCode\(102, ?115\)/, '"fs"')
+ }
+
if (currentPath.includes('/pages/api/')) {
logger.warn(
`Ignoring ${currentPath} because it is located in the "pages/api" folder.`
diff --git a/packages/nextra/src/server/page-map.ts b/packages/nextra/src/server/page-map.ts
index 49905ccfeb..a642e60d65 100644
--- a/packages/nextra/src/server/page-map.ts
+++ b/packages/nextra/src/server/page-map.ts
@@ -20,8 +20,7 @@ import {
createAstExportConst,
createAstObject,
normalizePageRoute,
- pageTitleFromFilename,
- truthy
+ pageTitleFromFilename
} from './utils.js'
const fs = gracefulFs.promises
@@ -164,7 +163,7 @@ async function collectFiles({
})
})
- const pageMap = (await Promise.all(promises)).filter(truthy)
+ const pageMap = (await Promise.all(promises)).filter(v => !!v)
return {
// @ts-expect-error -- fixme
diff --git a/packages/nextra/src/server/rehype-plugins/__tests__/rehype-icon.test.ts b/packages/nextra/src/server/rehype-plugins/__tests__/rehype-icon.test.ts
index 676c6326d1..9c930a2b20 100644
--- a/packages/nextra/src/server/rehype-plugins/__tests__/rehype-icon.test.ts
+++ b/packages/nextra/src/server/rehype-plugins/__tests__/rehype-icon.test.ts
@@ -91,6 +91,7 @@ describe('rehypeIcon', () => {
import { RustIcon } from 'nextra/icons'
import { TerraformIcon } from 'nextra/icons'
import { MoveIcon } from 'nextra/icons'
+ import { GoIcon } from 'nextra/icons'
function _createMdxContent(props) {
const _components = {
code: 'code',
@@ -231,6 +232,20 @@ describe('rehypeIcon', () => {
<_components.span>
+ {'\\n'}
+ <_components.pre icon={GoIcon} tabIndex="0" data-language="go" data-word-wrap="" data-copy="">
+ <_components.code>
+ <_components.span>
+
+
+ {'\\n'}
+ <_components.pre icon={GoIcon} tabIndex="0" data-language="golang" data-word-wrap="" data-copy="">
+ <_components.code>
+ <_components.span>
+ <_components.span />
+
+
+
>
)
}
diff --git a/packages/nextra/src/server/rehype-plugins/rehype-icon.ts b/packages/nextra/src/server/rehype-plugins/rehype-icon.ts
index f1f95c865c..caf61625b0 100644
--- a/packages/nextra/src/server/rehype-plugins/rehype-icon.ts
+++ b/packages/nextra/src/server/rehype-plugins/rehype-icon.ts
@@ -25,7 +25,9 @@ export const REHYPE_ICON_DEFAULT_REPLACES: Record = {
rs: 'RustIcon',
terraform: 'TerraformIcon',
tf: 'TerraformIcon',
- move: 'MoveIcon'
+ move: 'MoveIcon',
+ go: 'GoIcon',
+ golang: 'GoIcon'
}
function createImport(iconName: string) {
diff --git a/packages/nextra/src/server/remark-plugins/remark-static-image.ts b/packages/nextra/src/server/remark-plugins/remark-static-image.ts
index 7e81bcf47f..5f5fa8d13c 100644
--- a/packages/nextra/src/server/remark-plugins/remark-static-image.ts
+++ b/packages/nextra/src/server/remark-plugins/remark-static-image.ts
@@ -5,7 +5,6 @@ import slash from 'slash'
import type { Plugin } from 'unified'
import { visit } from 'unist-util-visit'
import { EXTERNAL_URL_REGEX, PUBLIC_DIR } from '../constants.js'
-import { truthy } from '../utils.js'
/**
* @link https://github.com/vercel/next.js/blob/6cfebfb02c2a52a1f99fca59a2eac2d704d053db/packages/next/build/webpack/loaders/next-image-loader.js#L6
@@ -99,7 +98,7 @@ export const remarkStaticImage: Plugin<[], Root> = () => ast => {
}
}
}
- ].filter(truthy)
+ ].filter(v => !!v)
})
}
diff --git a/packages/nextra/src/server/utils.ts b/packages/nextra/src/server/utils.ts
index 18c335f554..b8f5c5da0c 100644
--- a/packages/nextra/src/server/utils.ts
+++ b/packages/nextra/src/server/utils.ts
@@ -9,12 +9,6 @@ import slash from 'slash'
import title from 'title'
import { DEFAULT_PROPERTY_PROPS } from './constants.js'
-type Truthy = T extends false | '' | 0 | null | undefined ? never : T // from lodash
-
-export function truthy(value: T): value is Truthy {
- return !!value
-}
-
export const logger = {
info: console.log.bind(null, '-', '\x1b[36minfo\x1b[0m', '[nextra]'),
warn: console.log.bind(null, '-', '\x1b[33mwarn\x1b[0m', '[nextra]'),
diff --git a/packages/nextra/styles/steps.css b/packages/nextra/styles/steps.css
index e50d881e01..754e708339 100644
--- a/packages/nextra/styles/steps.css
+++ b/packages/nextra/styles/steps.css
@@ -10,7 +10,7 @@
@apply _absolute _size-[33px];
@apply _border-4 _border-[rgb(var(--nextra-bg))] _bg-gray-100 dark:_bg-neutral-800;
@apply _rounded-full _text-neutral-400 _text-base _font-normal _text-center _-indent-px;
- @apply _mt-[3px] _ml-[-41px];
+ @apply _mt-[3px] _ms-[-41px];
content: counter(var(--counter-id));
}
}