Dynamic routing with next export to static
See original GitHub issueHi, according to the v3-beta docs, next.js support exporting to static html, and apparently also support “dynamic routes”. Was wondering if there was some documentation on how to create dynamic routes when exporting static html.
This is a way to run your Next.js app as a standalone static app without any Node.js server. The export app supports almost every feature of Next.js including dynamic urls, prefetching, preloading and dynamic imports.
I’ve added this to my next.config.js
but it doesn’t seem to work.
exportPathMap: () => {
return {
"/": { page: "/" },
"/account/:id": { page: "/account" }
}
}
I also tried "/account/*"
, but no luck. Any help would be greatly appreciated.
- I have searched the issues of this repository and believe that this is not a duplicate.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
Top Results From Across the Web
NextJs: Static export with dynamic routes - Stack Overflow
I think without this netlify hack, my goal of static export + working links to dynamic routes is not possible with next.js according...
Read more >Advanced Features: Static HTML Export | Next.js
Export your Next.js app to static HTML, and run it standalone without the need ... file for each page in your pages directory...
Read more >Static export and dynamic route #32375 - vercel/next.js - GitHub
Hello, i have a dynamic route to edit a customer: image. i'm using static export (im not using any staticpath or staticprops methods),...
Read more >Understanding static HTML export in Next.js - LogRocket Blog
Learn why you should use HTML static exporting from a Next.js ... Note that if you have dynamic routes set up, more pages...
Read more >Static Site Generation with Next.js and TypeScript (Part IV)
Dynamic Routes Any page component that's defined within a file whose. ... then you can export a getStaticPaths() function that specifies the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, I am currently trying to handle this situation using Netlify: https://www.netlify.com/docs/redirects/
I think this demo will work fine for Export as static HTML of dynamic urls. 👍 👌
https://github.com/zeit/next.js/tree/canary/examples/with-static-export