Update docs for AMP export behavior (#7940)
In versions prior to ^9, default export with AMP was to create a `index.html` file for each page. This has changed in ^9.0 with intruduction of a new configuration options `exportTrailingSlash`. Current docs for AMP exports are not correct for this behaviour. Fixes #7931
This commit is contained in:
parent
45f80409dc
commit
9b7a2f5ab4
1 changed files with 6 additions and 4 deletions
|
@ -2318,14 +2318,16 @@ When using `next export` to statically prerender pages Next.js will detect if th
|
|||
|
||||
Hybrid AMP (`pages/about.js`) would output:
|
||||
|
||||
- `out/about/index.html` - with client-side React runtime
|
||||
- `out/about.amp/index.html` - AMP page
|
||||
- `out/about.html` - with client-side React runtime
|
||||
- `out/about.amp.html` - AMP page
|
||||
|
||||
AMP-only (`pages/about.js`) would output:
|
||||
|
||||
- `out/about/index.html` - Optimized AMP page
|
||||
- `out/about.html` - Optimized AMP page
|
||||
|
||||
During export Next.js automatically detects if a page is hybrid AMP and outputs the AMP version to `page.amp/index.html`. We also automatically insert the `<link rel="amphtml" href="/page.amp" />` and `<link rel="canonical" href="/" />` tags for you.
|
||||
During export Next.js automatically detects if a page is hybrid AMP and outputs the AMP version to `page.amp.html`. We also automatically insert the `<link rel="amphtml" href="/page.amp" />` and `<link rel="canonical" href="/" />` tags for you.
|
||||
|
||||
> **Note**: When using `exportTrailingSlash: true` in `next.config.js`, output will be different. For Hybrid AMP pages, output will be `out/page/index.html` and `out/page.amp/index.html`, and for AMP-only pages, output will be `out/page/index.html`
|
||||
|
||||
### Adding AMP Components
|
||||
|
||||
|
|
Loading…
Reference in a new issue