Open betabong opened 3 years ago
Yes I face the same issue when wanting to prerender
|--posts
|----posts1.html
|----posts2.html
|--posts.html
But I digress, the solutions are always there, either use index.html
folders (gruesome), or in the next rule check the posts.html manually... or route the posts differently. But I guess it would have been a blessing for it to work out of the box with
{extensions: ['html'], redirect: false }
When we have a directory named like a file, extensions should win over redirect. Let's assume this listing:
and we set the
extensions
options to['html']
.Right now
/news
is redirected to/news/
and serves/news/index.html
But it should serve
/news.html
– only if that file is missing, it should redirect to the directory. Whereas/news/
should always go for the directory (index).I achieved this by changing the
sendFile
method like follows, but there are probably better ways to achieve the same.Does this make sense? (I am by the way trying to achieve the same kind of handling like Netlify does when serving static files).