Next.js Discord

Discord Forum

Serving static content

Unanswered
Basset Fauve de Bretagne posted this in #help-forum
Open in Discord
Basset Fauve de BretagneOP
As a side project to improve my NextJS skills, I want to implement a personal blog in NextJS. I have an existing portfolio/resume site and want to extend it. It will not receive much traffic.

What would be a straight-forward way to serve the blog content? I've read up on static export, but it looks to me like the entire site will be served statically then?

My current plan is just to create the blog entries as HTML and serving them as SSR components. Currently hosting with Vercel. I assume that they will get cached there?

I'm also using some client components (navbar with usePathname() to highlight current page), so I think that rules out a 100% static content solution, as I'm using client side components?

@Anay-208 Tagging, as you assisted in the off-topic channel.

9 Replies

Basset Fauve de BretagneOP
No, but would definitely consider it
If you’re not, then it won’t change much, but only CSR will be enabled
Instead of SSR
Vercel automatically enables SSR
Basset Fauve de BretagneOP
Is it a bad idea to just keep blog content as HTML files and redeploy the site every time I want to create a new blog post? Not going to have comments or anything I would need a DB for
In that way it should be simple to implement and I assume quite fast since the content would be cached by Vercel?
American Crow
The docs are quite good about what is supported and unsupported using static export:
https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features
Only you know if you need one of those features.
If yes, you are not using static export but you can still decide on a route basis if a route should be statically or dynamically rendered. Think of static export as running Nextjs without a Node Server. So you basically decide if you need a server at runtime or not.

In both approaches, statically rendered websites will be always very fast as you pointed out.
You can keep your blog content as HTML files it's just very uncomfortable maintaining those.
Most people would go with md or mdx files and a mdxparser/lib like velite
Basset Fauve de BretagneOP
Thanks for the input! Will go through the docs and consider using MD instead.