Skip to content

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

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

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

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

fmalcher opened this issue Dec 18, 2024 · 4 comments
Labels
angular/build:application area: @angular/build area: @angular/ssr feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors 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.

Copy link
Contributor

angular-robot bot commented Jan 27, 2025

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot angular-robot bot removed the feature: votes required Feature request which is currently still in the voting phase label Feb 16, 2025
Copy link
Contributor

angular-robot bot commented Feb 16, 2025

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

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

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Feb 16, 2025
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: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

3 participants