Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 setting custom permalink #11115

Closed
pspeter3 opened this issue Mar 16, 2020 · 3 comments
Closed

Allow setting custom permalink #11115

pspeter3 opened this issue Mar 16, 2020 · 3 comments

Comments

@pspeter3
Copy link

Feature request

Is your feature request related to a problem? Please describe.

Using Next and Next Export is a great way to generate a static site. Unfortunately, it is not possible to generate non HTML static assets. Adding a custom permalink would allow non important non HTML files. Examples include:

  • RSS (feed.xml)
  • robots.txt
  • Sitemap (sitemap.xml)
  • Netlify CMS Config (admin/config.yml)

Describe the solution you'd like

Add a function or parameter to set the custom permalink for a page. We could also consider making the render function of the React component return a string for the body.

Describe alternatives you've considered

You can generate these files outside of the Next.js build ecosystem but that seems like a lot of extra complexity to the developer experience.

Additional context

This idea was discussed in #9051

@eblin
Copy link

eblin commented Mar 19, 2020

This is already possible with Static File Serving feature.

public/robots.txt file will be access in your site via https://example.com/robots.txt

@pspeter3
Copy link
Author

I know that I can do that if I write the robots.txt by hand. I want the ability to generate static files at build time. I think the sitemap and RSS feed examples are more compelling to be honest.

@BrunoBernardino
Copy link

While I think this would be incredibly valuable, here I have a solution that allows you to have a dynamically-generated sitemap that covers dynamic routes and static ones, as an interim solution of sorts:

It uses a lambda for the sitemap generation, routed via @now/node in vercel.json, with the static pages/routes built with a script before deploy.

Maybe it'll help you. It supports static routes, and allows for newly-dynamic pages to still be valid and added (like for products, in that example).

@vercel vercel locked and limited conversation to collaborators Apr 12, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants