You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this release, Schema.org validation and Google Structured Data validation have been split so markup can validated independently for technical correctness and for vendor compatibility.
There are easy to accommodate but breaking API changes in this release, which should provide a stable API foundation for future updates.
* Automatically detects Schema.org markup and tests it separately from vendor specific validation.
* You can now use `--schemas` to specify schemas to check for as well as to list them.
* You can optionally prefix schema names with 'jsonld:', 'microdata:', 'rdfa:' to check for a schema specified in a particular way (e.g. `--schemas Article` or `--schemas jsonld:Article` or `--schemas Microdata:Article`).
* You can specify one or more schemas to check for, the same way the `--presets` option works (e.g. `--schemas "jsonld:Article,BreadcrumbList,microdata:WPFooter"`)
* Presets can now contain other presets (to any level), to allow for easier organisation of tests. e.g. use `--presets SocialMedia` to test social media markup, or `--presets Google` to apply rules based on those for the Google Structured Data Testing Tool.
* Presets can now have conditional tests to determine if a preset is invoked, which is useful when grouping presets inside other presets, so that groups of tests are only applied when appropriate.
* Individual tests within presets can now have conditional tests to determine if they should run.
* Added new preset called 'Google' which checks commonly used schemas for structured data properties that Google expects to see.
* Added a new preset called 'SocialMedia', containing both Twitter and Facebook presets.
* Removed `--disable-presets` option as is now redundant.
* All options available via both API and Command Line Tool.
* Updated README and inline documentation.
* This update does not validate if individual Schema.org schema properties exist or check if the contents of those properties are valid (this is possible with the API using a custom preset).
* The Google preset is contains subset of tests based on responses from the Google Structured Data Testing Tool and tests for all known Article schema types, but does not validate all supported Schemas or test the contents of properties using the same rules (this is possible with the API using a custom preset).
Copy file name to clipboardExpand all lines: README.md
+83-51
Original file line number
Diff line number
Diff line change
@@ -2,52 +2,52 @@
2
2
3
3
Helps inspect and test web pages for Structured Data.
4
4
5
-
Designed to allow automation and quick ad-hoc testing of structured data - especially in bulk or as part of a CD/CI pipeline.
5
+
The structured data testing tool is designed to allow automation and quick ad-hoc testing of structured data - especially in bulk or as part of a CD/CI pipeline.
6
+
7
+
This utility uses [web-auto-extractor](https://www.npmjs.com/package/web-auto-extractor) and [jmespath](https://www.npmjs.com/package/jmespath).
6
8
7
9
## Features
8
10
9
-
*A Command Line Interface (`sdtt`) and an API for CD/CI integration.
11
+
* Command Line Interface (`sdtt`) and an API for CD/CI integration.
10
12
* Accepts any URL or a file to test (via string, buffer, stream…).
11
-
*Tests pages for Schema.org markup in HTML (with microdata), JSON-LD and RDFa.
12
-
* Tests `<meta>` tags for specific tags and values (e.g. for Twitter and Facebook sharing data, OpenGraph tags, App Store tags).
13
-
*Tests if properties exist, should not exist and/or if they match a Regular Expression check.
14
-
* Built-in 'presets' for testing common schema types (including all types of Article schemas).
13
+
*Detects Schema.org markup in HTML (`microdata`), `JSON-LD` and `RDFa`.
14
+
* Tests `<meta>` tags for specific tags and values (e.g. for social media / sharing).
15
+
*Built-in presets for Twitter and Facebook tags.
16
+
* Built-in presets for for testing and validating common structured data expected by Google.
15
17
* API: Define your own re-useable, custom presets to write specific tests for your own site.
16
18
* API: Use with a headless browser to test Structured Data injected by client side JavaScript (e.g. via Google Tag Manager).
17
19
* CLI: Recognizes and displays info for all 1000+ schemas on Schema.org.
18
20
19
-
This tool uses [web-auto-extractor](https://www.npmjs.com/package/web-auto-extractor) and [jmespath](https://www.npmjs.com/package/jmespath).
20
-
21
-
Note: Schema.org does not define 'optional' and 'required' fields for schemas, it describes valid properties and what they may contain. Recommendations and tests in the built-in presets are based on practical errors and warnings returned by search engine providers.
22
-
23
21
## Install
24
22
25
23
npm i structured-data-testing-tool -g
26
24
27
-
## Features
28
-
29
25
## Usage
30
26
31
27
### Command Line Interface
32
28
33
-
_Note: The API supports additional options not currently exposed in the CLI tool._
0 commit comments