From ed3a7a3995212ee36a242d75eaca104a8b29dbb5 Mon Sep 17 00:00:00 2001 From: Pavel Korotenko Date: Thu, 28 May 2020 18:48:06 -0400 Subject: [PATCH 1/2] Update AMP validation docs with examples for custom validators and skipValidation mode. --- .../amp-support/amp-validation.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/advanced-features/amp-support/amp-validation.md b/docs/advanced-features/amp-support/amp-validation.md index 859024330712..48aaf5112a17 100644 --- a/docs/advanced-features/amp-support/amp-validation.md +++ b/docs/advanced-features/amp-support/amp-validation.md @@ -7,3 +7,27 @@ description: AMP pages are automatically validated by Next.js during development AMP pages are automatically validated with [amphtml-validator](https://www.npmjs.com/package/amphtml-validator) during development. Errors and warnings will appear in the terminal where you started Next.js. Pages are also validated during [Static HTML export](/docs/advanced-features/static-html-export.md) and any warnings / errors will be printed to the terminal. Any AMP errors will cause the export to exit with status code `1` because the export is not valid AMP. + +### Custom Validators + +You can set up custom AMP validator in `next.config.js` as shown below: + +```jsx +module.exports = { + amp: { + validator: "./custom_validator.js" + } +} +``` + +### Skip AMP Validation + +To turn off AMP validation add the following code to `next.config.js` + +```jsx +experimental: { + amp: { + skipValidation: true + } +} +``` \ No newline at end of file From 0f264e49a6432192a08286ba801c9e0587870ca2 Mon Sep 17 00:00:00 2001 From: Pavel Korotenko Date: Fri, 29 May 2020 08:52:27 -0400 Subject: [PATCH 2/2] Run prettier on AMP doc updates. --- docs/advanced-features/amp-support/amp-validation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/advanced-features/amp-support/amp-validation.md b/docs/advanced-features/amp-support/amp-validation.md index 48aaf5112a17..5d7f7efe52b9 100644 --- a/docs/advanced-features/amp-support/amp-validation.md +++ b/docs/advanced-features/amp-support/amp-validation.md @@ -15,8 +15,8 @@ You can set up custom AMP validator in `next.config.js` as shown below: ```jsx module.exports = { amp: { - validator: "./custom_validator.js" - } + validator: './custom_validator.js', + }, } ``` @@ -30,4 +30,4 @@ experimental: { skipValidation: true } } -``` \ No newline at end of file +```