🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

semantic-blocks

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-blocks

Easily add Schema.org to your BEM-project

0.0.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

semantic-blocks

NPM version Build status devDependency status

Easily add Schema.org to your BEM-project.

Install

Just install it as npm package:

npm install bh

Add level node_modules/semantic-blocks/schema to your BEM/ENB make file, and add i-bem__schema to deps:

({
    mustDeps: {
        block: 'i-bem',
        elem: 'schema'
    }
});

Usage

itemtype

Add any available schema to any block or element:

bh.match('my-blog__post', function(ctx) {
    ctx.itemtype('Article');
});

yields

<div class="my-blog__post" itemscope itemtype="http://schema.org/Article"></div>

itemprop

Add any itemprop available for your scheme to any block or element:

bh.match('quote__author', function(ctx) {
    ctx.itemprop('author');
});

yields

<div class="quote__author" itemprop="author"></div>

Predefined blocks

Now there is only one block which has schema.org properties: article. So, if you call your block article, it will get an itemtype= http://schema.org/Article.

Other blocks are comming soon. Send me pull-request with blocks you need, or open an issue.

Keywords

BEM

FAQs

Package last updated on 15 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts