From 9b7a2f5ab4f530d03eda9d0c6a2af1ce942ba00e Mon Sep 17 00:00:00 2001 From: Sudhir Mitharwal Date: Sat, 13 Jul 2019 01:23:06 +0530 Subject: [PATCH] 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 --- packages/next/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/next/README.md b/packages/next/README.md index d6980efef7..9ee058b7f0 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -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 `` and `` 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 `` and `` 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