Schemas
Schemas makes it super easy to write schema.org microdata without extra cruft. Search engine operators like Google, Microsoft and Yahoo! will rely on this markup to improve search results.
<!-- BEFORE --> ACME Executive Anvil Average rating: 4.4, based on 89 reviews from $119.99 to $199.99 <!-- AFTER --> ACME Executive Anvil Average rating: 4.4, based on 89 reviews from $119.99 to $199.99
Features
Schemas makes the itemscope
property totally optional. This is because the microdata spec says itemtype
must not be specified on elements that do not also have an itemscope
attribute.
Schemas makes the http://schema.org/
prefix totally optional. This is because all major search engines now recognize this common data vocabulary.
Usage
Add Schemas to your build tool:
npm install posthtml-schemas --save-dev
Node
;
PostHTML
Add PostHTML to your build tool:
npm install posthtml --save-dev
Load Schemas as a PostHTML plugin:
;
Gulp
Add Gulp PostHTML to your build tool:
npm install gulp-posthtml --save-dev
Enable Schemas within your Gulpfile:
var posthtml = ; gulp;
Grunt
Add Grunt PostHTML to your build tool:
npm install grunt-posthtml --save-dev
Enable Schemas within your Gruntfile:
grunt; grunt;
Options
url
Type: Object|String
Default: "http://schema.org/"
Specifies the URL used to prefix your microdata vocabulary (itemtype
). You may also pass in an object of individual URLs for each vocabulary.