Static html output for routes with [locale] and [slug], mdx content site.
Unanswered
Burgos Pointer posted this in #help-forum
Burgos PointerOP
I am working on a little side project that aims to have an mdx based wiki for a TTRPG project. I've ran into the issue where even if I use generateStaticParams and export const dynamic = "force-static", I am not getting the static html sites I am expecting. I cannot use " output: 'export'" since I'm using some API features.
32 Replies
@Burgos Pointer I am working on a little side project that aims to have an mdx based wiki for a TTRPG project. I've ran into the issue where even if I use generateStaticParams and export const dynamic = "force-static", I am not getting the static html sites I am expecting. I cannot use " output: 'export'" since I'm using some API features.
what API features are you using? can you share some build logs?
Burgos PointerOP
As for the API features, they are external search engines
@alfonsüs ardani what API features are you using? can you share some build logs?
Burgos PointerOP
what build logs do you need?
it says its a static site
what do you mean by "not getting the static html sites"?
Burgos PointerOP
Yes, but I cannot find any of the corresponding generated html files in my dist/server/app, which I need for pagefind
next build doesn't produce html files even if its static. it just serve pre-rendered html-like files
Burgos PointerOP
I see, and if this says "/[locale]/library/[...slug]" is static, do I have any way of checking that those "[...slug]" routes are actually being generated in this "html-like" format?
Burgos PointerOP
Assuming I should be seeing all my 1000 mdx files as some kind of pre-rendered version here?
@alfonsüs ardani yeah, in the `.next` folder somewhere
Burgos PointerOP
They do exist as static chunks:
@Burgos Pointer They do exist as static chunks:
that is what next does yeah.
Burgos PointerOP
So... this is as static as it's going to get I'm assuming? So in order to get actual rendered HTML files I need to either crawl my own site or give up?
but other than that, yeah
why do you need to get actual rendered html files? just curious, i might learn something
Burgos PointerOP
Pagefind creates an indexable fast search for large content sites, but it requires static html to generate that
ahh yeah
last time i did that i resorted to just compiling the MDX and building the indexing directly in dev
Burgos PointerOP
The thing is I have an integrated search engine using the Next API, so I don't want to turn the whole site static (plus, that kinda defeats the purpose of using next in the firs place no?)
It's a standard google engine but I obviously cant expose the key to the frontend
have you tried this?
https://www.petemillspaugh.com/nextjs-search-with-pagefind
https://www.petemillspaugh.com/nextjs-search-with-pagefind
The thing is I have an integrated search engine using the Next API,can always run 2 separate nextjs instance for it, or monorepos
unless ure using server actions to access the standard google engine thing
@alfonsüs ardani > The thing is I have an integrated search engine using the Next API,
can always run 2 separate nextjs instance for it, or monorepos
Burgos PointerOP
Yeah, I'd have to check how to do that in the free vercel tier tho
@alfonsüs ardani unless ure using server actions to access the standard google engine thing
Burgos PointerOP
I am but it could also be a standalone api somewhere else, it really does not need to be within next if it's gonna cause this many problems
what thats irrelevant, vercel free tier have limit of 100 projects
from what i seen in that article you dont need the static html files and those chunks would just do fine
Burgos PointerOP
I may have misread the article yeah
When I ran pagefind it just found the 404 file etc, so I might have misjudged how this works