Skip to content
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

Pretty Static Export Paths #2944

Closed
kennedyrose opened this issue Sep 12, 2017 · 7 comments
Closed

Pretty Static Export Paths #2944

kennedyrose opened this issue Sep 12, 2017 · 7 comments

Comments

@kennedyrose
Copy link

Is there any way to trim the / off of the static export output? Many static hosts like GH pages and Netlify support trimming the .html off of your paths for "pretty" URL paths.

But it looks like static export turns all of your /path/links to /path/links/. It'd be nice if there was an option to turn on pretty URL paths for exporting to the static hosts that support them.

@kennedyrose kennedyrose changed the title Static Export Paths Pretty Static Export Paths Sep 12, 2017
@markozxuu
Copy link
Contributor

Can not be omitted "/". Could you give me an example of what you are saying about the routes.

@kennedyrose
Copy link
Author

kennedyrose commented Sep 14, 2017

So basically, in my next.config.js file, I've got a route specified as /path/product. Whenever I export, the path becomes /path/product/ in all .html files.

But most static hosts actually do support the /path/product link without the trailing slash. So I was wondering if it'd be possible to provide a CLI option to next export that would not rewrite the URLs to have trailing slashes.

@pruhstal
Copy link

@kennedyrose sounds like a job for custom routes:

https://github.com/zeit/next.js/blob/master/examples/with-next-routes/routes.js

Although if you're already doing that, then express has an optional param you can pass in called strict for strict routing.

screen shot 2017-09-22 at 11 35 10 pm

Maybe that'll do it?

@timneutkens
Copy link
Member

timneutkens commented Sep 23, 2017

@pruhstal @kennedyrose There's a wiki article for that:tm: https://github.com/zeit/next.js/wiki/Centralizing-Routing

Edit: thought this was a different issue 😅

@pruhstal this is specifically directed a next export so you can't use a custom server 👍

@kennedyrose seems like a reasonable request, I'll put it on the backlog 👍

@timneutkens timneutkens added good first issue Easy to fix issues, good for newcomers help wanted labels Nov 12, 2017
gkaemmer added a commit to gkaemmer/next.js that referenced this issue Nov 15, 2017
gkaemmer added a commit to gkaemmer/next.js that referenced this issue Nov 15, 2017
gkaemmer added a commit to gkaemmer/next.js that referenced this issue Nov 15, 2017
gkaemmer added a commit to gkaemmer/next.js that referenced this issue Nov 15, 2017
@timneutkens timneutkens added Status: Ready and removed good first issue Easy to fix issues, good for newcomers help wanted labels Jan 30, 2018
gkaemmer added a commit to gkaemmer/next.js that referenced this issue May 30, 2018
gkaemmer added a commit to gkaemmer/next.js that referenced this issue Jun 2, 2018
@NathanielHill
Copy link
Contributor

This is solved 🎉
https://zeit.co/blog/new-static-deployments

@mrcoles
Copy link

mrcoles commented Oct 27, 2018

It is only solved for now deployments. It’s not solved for general exports.

@NathanielHill
Copy link
Contributor

@mrcoles Seems you are right. Hopefully this can be addressed someday 🤷‍♂️

@lock lock bot locked as resolved and limited conversation to collaborators Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants