Skip to content

Commit 712a028

Browse files
committed
docs: blog/my-article as the only example
1 parent a0271cf commit 712a028

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ If you want the option in Angular, please give the issue and the pull request a
5151

5252
- Angular 22 with the application builder (`@angular/build:application`)
5353
- `"outputMode": "static"`
54-
- A host that serves `foo.html` under `/foo` without a redirect (see [Hosts](#hosts))
54+
- A host that serves `blog/my-article.html` under `/blog/my-article` without a redirect (see [Hosts](#hosts))
5555

5656
## 🚀 Quick Start <a name="quickstart"></a>
5757

@@ -101,7 +101,7 @@ A route whose last segment is `index` (`/index`, `/docs/index`) fails the build
101101

102102
Static site generators have offered this choice for a long time. We decided to borrow the terminology from Astro: `build.format` with `'directory'` and `'file'` became `prerenderFormat` with the same values.
103103

104-
| Framework | Option | `about/index.html` | `about.html` |
104+
| Framework | Option | `blog/my-article/index.html` | `blog/my-article.html` |
105105
|---|---|---|---|
106106
| **Astro** | `build.format` | `'directory'` (default) | `'file'` |
107107
| Next.js (static export) | `trailingSlash` | `true` | `false` (default) |
@@ -118,10 +118,10 @@ Measured on **Cloudflare Pages** with `prerenderFormat: "file"`:
118118

119119
| Request | Response |
120120
|---|---|
121-
| `/foo` | 200, `foo.html` |
122-
| `/foo/` | 308 → `/foo` |
123-
| `/foo.html` | 308 → `/foo` |
124-
| `/foo` with `foo.html` next to the folder `foo/` | 200, `foo.html` |
121+
| `/blog/my-article` | 200, `blog/my-article.html` |
122+
| `/blog/my-article/` | 308 → `/blog/my-article` |
123+
| `/blog/my-article.html` | 308 → `/blog/my-article` |
124+
| `/blog` with `blog.html` next to the folder `blog/` | 200, `blog.html` |
125125

126126
Old addresses with a trailing slash keep working, they redirect to the address without it.
127127

@@ -131,14 +131,14 @@ Check your host before switching.
131131
## 🔧 How it works <a name="how-it-works"></a>
132132

133133
The builder calls `buildApplication` from `@angular/build` and wraps its internal `prerenderPages()` function, which returns the prerendered pages as a record of output paths.
134-
The wrapper renames `foo/index.html` to `foo.html` before anything is written, so the service worker manifest and all later build steps see the final file names.
134+
The wrapper renames `blog/my-article/index.html` to `blog/my-article.html` before anything is written, so the service worker manifest and all later build steps see the final file names.
135135

136136
`prerenderPages()` is internal API, so this package supports Angular 22 only.
137137
After a successful build, the builder checks that the prerendered pages actually went through the wrapper, and fails otherwise.
138138

139139
## 📁 Known limitations <a name="limitations"></a>
140140

141-
- **Static builds only, by design.** `prerenderFormat: "file"` solves a problem of static hosting and makes no sense in other setups. An `ssr` entry is fine as long as `"outputMode"` is `"static"`: Angular then uses it only during `ng build` to prerender the pages, and no server is deployed. If a server is deployed, the build fails: a server needs no `.html` files, it answers `/foo` directly without redirecting to `/foo/`, and the Angular SSR server looks up prerendered pages as `index.html`.
141+
- **Static builds only, by design.** `prerenderFormat: "file"` solves a problem of static hosting and makes no sense in other setups. An `ssr` entry is fine as long as `"outputMode"` is `"static"`: Angular then uses it only during `ng build` to prerender the pages, and no server is deployed. If a server is deployed, the build fails: a server needs no `.html` files, it answers `/blog/my-article` directly without redirecting to `/blog/my-article/`, and the Angular SSR server looks up prerendered pages as `index.html`.
142142

143143
✅ Works: static output, the `ssr` entry only renders at build time
144144

0 commit comments

Comments
 (0)