I know that hugo is a static site generator . Comparing NextJs to Hugo, Nextjs has additional features to pre-render the page on the server using
I like Hugo over Nextjs, because it gives a lot of features out of the box, but I don’t want to be stuck if ssr is needed in the future.
One possible way that came to mind is to create my own server using nodejs, dotnet or which ever framework and serve Hugo generated html files + implement ssr on some other pages.
Is this a good approach?
Do you have any working codebase which serve as an example?
There is no example of what you are trying to do as far as I know.
Hugo is not designed to publish pages that are rendered server side.
Hugo can render data from external APIs with
Hi thanks for your reply.
My idea is:
1-keep using hugo to generate my static files.
2- add hugo generated files to the public directory of my server
That way, if the user requests a static page, will serve the page from the public directory otherwise will handle the request and generate an html page
Your question is kind of OT here because Hugo simply ouputs static HTML along with its assets.
Please try asking in a forum that accepts general questions about server configuration and user authentication.