Skip to content

Commit

Permalink
feat(module): add option to disable validator
Browse files Browse the repository at this point in the history
close #184
  • Loading branch information
farnabaz committed Oct 4, 2020
1 parent fca767b commit fe3c315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ General options of amp module
| cdnBase | `https://cdn.ampproject.org/v0/` | Any String | A CDN Domain to load AMP elements scripts |
| tags | `{}` | Object of tag options | Define new tags or modify current tags, for instance if you want to use `amp-mustache` version 0.1, tags value must be `{ 'amp-mustache': { version: '0.1' } }` |
| origin | `` | Any String | Main domain of website. Using this AMP modules tries to add missing canonical link for pages. |
| mode | `hybrid` | `only\|hybrid\|false` | Default behaviour of amp module. (`only` all pages serve in AMP mode by default, `hybrid` pages serves in both normal and AMP mode, `false` pages does not serve AMP by default ) |
| mode | `hybrid` | `only\|hybrid\|false` | Default behaviour of amp module. (`only` all pages serve in AMP mode by default, `hybrid`
pages serves in both normal and AMP mode, `false` pages does not serve AMP by default ) |
| validator | `true` | `true\|false` | Validate generated HTML of AMP routes on development environment |
| routeAliases | `auto` | `auto\|Array` | Allows to limit route aliases to only AMP pages. With `auto` the module will create aliases for every route. If your app uses AMP only on a few routes you can provide those routes into an Array. Routes are absolute, without '/amp' prefix, eg. `['/story', '/page2']` |


Expand Down
3 changes: 2 additions & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = function (moduleOptions) {
mode: 'hybrid',
tags: {},
routeAliases: 'auto',
validator: true,
...this.options.amp,
...moduleOptions
}
Expand All @@ -28,7 +29,7 @@ module.exports = function (moduleOptions) {
registerRendererHook.call(this, options)
ensureMeta.call(this, options)

if (this.nuxt.options.dev) {
if (options.validator && this.nuxt.options.dev) {
registerValidator.call(this, options)
}

Expand Down

0 comments on commit fe3c315

Please # to comment.