New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow use of filenames in exportPathMap #2973
Conversation
Would this not fit as a better solution #2699 🙈? |
After reading #2699 it looks like this may be helpful for solving that PR breaking export, but otherwise unrelated - does that sound right? If so, this one could land before that one and it would be easy to test. Could integrate on another branch if that would speed up one or both of these PRs. |
Also @arunoda LMK when I should rebase this, I'll hold off until I hear from ya. |
@jesseditson The export issue mentioned in #2699 is unrelated to this. |
@jesseditson PR looks 👌 I've hit the magic rebase button for you 👍 Oh and we should document this 🙌 So if the above is correct and you've added the docs I'll merge 💯 |
@timneutkens cool, added a small note to the readme - to me this change is intuitive so I assume that's enough, but happy to add more docs if you'd like! The tests should be helpful for curious folks too. Let me know if there's anything else you'd like me to update! |
Oh and yes, those possible cases look correct to me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesomeness, just my curiosity, you're really exporting a Next app to markdown 😲
Hehe still exporting html, but I'm exporting docs from a GitHub repo to an s3 static site, and wanted the paths to match so the links would work both on GitHub and the website. Content-Type sent by s3 is text/html though! |
😄 Nice, this was released in latest beta 🙌 |
Amazing, thanks again! |
A [recent change](vercel/next.js#2973) in Next allowed for paths to be exported directly, meaning we can now generate 404.html straight from the config. This changes the build to use the redirect page to generate 404.html directly.
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
I was working on a docs site that mirrored the content from a github repo, and decided to use the new
next export
to build the static site.However, I expected that I could put any valid file path in
exportPathMap
as keys and it would render to that path. I was disappointed to find that a path offoo/bar.html
would actually render asfoo/bar.html/index.html
, which would break links in my case (I'm wrapping content with plain anchors that I don't want to transform to dynamic links).This PR changes the output (and any links to it) to be the path specified (without adding
index.html
) ifpath.extname(key)
is not empty.