next.js icon indicating copy to clipboard operation
next.js copied to clipboard

static export with less pages

Open mauvew opened this issue 8 years ago • 1 comments

Thanks a lot for creating this project.

For the with-static-export example, it exports 10 posts in the out folder and then it can be be hosted in any web server without a backend.

Just wondering is it possible to export a post page and access it like http://localhost:5000/post/?id=1 I understand it works by clicking through the index page since the browser renders it. Is there a way for us to make this also work in SSR so that user can also access this url as the first page?

I ask that because for my use case, I can have many posts(>3000), and for each post, they have 3 pages(e.g., post details, page content, page stats). It seems quite a bit of efforts to export them like 3000*3 html pages. Could we export three pages, and use param in the url to tell the pages which post to load? (I have all the data for these 3000 posts in a file, so no need to talk to any api)

Thanks a lot

mauvew avatar May 04 '18 16:05 mauvew

It sounds like you're trying to build a dynamic website by statically exporting 🤔Which goes against the "static" part in static export. What you could do however is build a dynamic Next.js app and create a LRU cache like in this example: https://github.com/zeit/next.js/tree/canary/examples/ssr-caching

timneutkens avatar May 05 '18 12:05 timneutkens