angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open fmalcher opened this issue 1 year ago • 5 comments

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

fmalcher avatar Dec 18 '24 09:12 fmalcher

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.

SanderElias avatar Dec 18 '24 09:12 SanderElias

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.

angular-robot[bot] avatar Dec 18 '24 13:12 angular-robot[bot]

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[bot] avatar Jan 27 '25 13:01 angular-robot[bot]

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[bot] avatar Feb 16 '25 13:02 angular-robot[bot]

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[bot] avatar Jun 23 '25 13:06 angular-robot[bot]