You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-131Lines changed: 6 additions & 131 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,146 +251,21 @@ See [Next.js on Netlify](https://docs.netlify.com/integrations/frameworks/next-j
251
251
252
252
1. Add `output: 'export'` in `next.config.js`. See [static exports documentation](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#configuration) for more information.
253
253
2. Comment out `headers()` from `next.config.js`.
254
-
3. Change `components/Image.tsx` to use a standard `<img>` tag instead of `next/image`:
3. Add `unoptimized: true` to the `images` key in `next.config.js`:
266
255
267
256
Alternatively, to continue using `next/image`, you can use an alternative image optimization provider such as Imgix, Cloudinary or Akamai. See [image optimization documentation](https://nextjs.org/docs/app/building-your-application/deploying/static-exports#image-optimization) for more details.
268
257
269
258
4. Remove `api` folder and components which call the server-side function such as the Newsletter component. Not technically required and the site will build successfully, but the APIs cannot be used as they are server-side functions.
270
259
5. Run `yarn build`. The generated static content is in the `out` folder.
271
260
6. Deploy the `out` folder to your hosting service of choice or run `npx serve out` to view the website locally.
272
261
273
-
## Frequently Asked Questions
274
-
275
-
### How can I add a custom MDX component?
276
-
277
-
Here's an example on how to create a donut chart from Chart.js (assumingyoualreadyhavethedependenciesinstalled) and use it in MDX posts. First, create a new `DonutChart.tsx` component in `components`:
__Note__: Deploying on Github pages require addition modifications to the base path. Please refer to the FAQ for more information.
290
263
291
-
export default Doughnut
292
-
```
293
-
294
-
Since the underlying `Doughnut` component uses React hooks, we add the `'use client'` directive to specify that it is a client side component. Also, there is an existing issue which prevents named components from being used, so we need to export the component as the default export.
Add a `SearchProvider` component such as the one shown below and use it in place of the default `SearchProvider` component in `app/layout.tsx`.
340
-
341
-
`defaultActions` are the initial list of actions.
342
-
343
-
`onSearchDocumentsLoad` is a callback function that is called when the documents specified by `searchDocumentsPath` are loaded. Set `searchDocumentsPath` to `false` to disable the dynamically loaded search feature.
Here's an example on how to create a donut chart from Chart.js (assuming you already have the dependencies installed) and use it in MDX posts. First, create a new `DonutChart.tsx` component in `components`:
Since the underlying `Doughnut` component uses React hooks, we add the `'use client'` directive to specify that it is a client side component. Also, there is an existing issue which prevents named components from being used, so we need to export the component as the default export.
Add a `SearchProvider` component such as the one shown below and use it in place of the default `SearchProvider` component in `app/layout.tsx`.
4
+
5
+
`defaultActions` are the initial list of actions.
6
+
7
+
`onSearchDocumentsLoad` is a callback function that is called when the documents specified by `searchDocumentsPath` are loaded. Set `searchDocumentsPath` to `false` to disable the dynamically loaded search feature.
0 commit comments