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

SSG/Prerendering: Allow generating foo.html instead of foo/index.html #29173

Open
fmalcher opened this issue Dec 18, 2024 · 2 comments
Open

SSG/Prerendering: Allow generating foo.html instead of foo/index.html #29173

fmalcher opened this issue Dec 18, 2024 · 2 comments
Labels
angular/build:application area: @angular/build area: @angular/ssr feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature

Comments

@fmalcher
Copy link
Contributor

fmalcher commented Dec 18, 2024

Description

Angular's Prerendering puts nested routes into a subfolder with index.html:
=> Route blog/myslug becomes blog/myslug/index.html

The web server adds a trailing slash (for the folder) which is then removed by the Angular router, and it leads to an initial redirect.

Describe the solution you'd like

Some static site generators allow to create a flat structure instead with no subfolder:
=> Route blog/myslug becomes blog/myslug.html

Proposed solution:

  • Output myslug/index.html by default, it is the most compatible output that works on each and every web server
  • add an option for flat output (myslug.html) that can be used if I know my web server supports this

Context

Most cloud hosting providers allow to serve myslug.html under myslug:

Further read on trailing slash and framework/provider support: https://bjornlu.com/blog/trailing-slash-for-frameworks

@SanderElias
Copy link

I like the idea.
Just ensure that it is appropriately documented that only some providers support this.
Preferably, this should be done even in a way that surfaces this in the code-editor when they use this option.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Dec 18, 2024
Copy link
Contributor

angular-robot bot commented Dec 18, 2024

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
angular/build:application area: @angular/build area: @angular/ssr feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

3 participants