{ block: 'b-page' } | This blocks makes required HTML tags <html>, <head> and <body>. It is charged with linking CSS and JS files to a page, creating meta tags, head node and so on. Block's bemjson input data starts with block declaration including title value which is a content of <title> HTML tag. ({ block : 'b-page', title : 'Page with link', ... }) head element which corresponds to <head> HTML tag may be extended with head property containing elements for CSS and JS files to be linked to a page. ({ ... head : [ { elem : 'css', url : 'example.css', ie : false }, { elem : 'css', url : 'example.ie.css', ie : 'lt IE 8' }, { elem : 'js', url : 'example.js' } ], ... }) css element turns into <link> HTML tag that links a CSS file stated as a value of url property of the element. ({ ... head : [ { elem : 'css', content : '.b-blah { color: #f00' } }, ... ], ... }) js element is similar and links to a page JS files by <script> tag. head property does not describe the whocle content of <head> tag but extends its default value specified in its bemhtml template.
content: [ { tag : 'meta', attrs : { 'http-equiv' : 'content-type', content : 'text/html; charset=utf-8' } }, ...
content : [ ... { tag : 'meta', attrs : { 'http-equiv' : 'X-UA-Compatible', content : 'IE=EmulateIE7, IE=edge' } }, ...
content : [ ... { tag : 'title', content : this.ctx.title }, ...
content : [ ... this.ctx.favicon ? { elem : 'favicon', url : this.ctx.favicon } : '', ...
content : [ ... { block : 'i-ua' }, ... Similarly to head property there may be set meta property contained one or more meta elements: ({ ... meta : { elem : 'meta', attrs : { name : 'keywords', content : 'js, css, html' } }, ... }) ({ ... meta : [ { elem : 'meta', attrs : { name : 'keywords', content : 'js, css, html' } }, { elem : 'meta', attrs : { name : 'description', content : 'Yet another webdev blog' } } ] ... }) A value of content property of b-page block may be a hash describing page content of the only block or an array of block hashes: ({ ... content : [ { block : 'b-link', mods : { pseudo : 'yes', togcolor : 'yes', color: 'green' }, url : '#', target : '_blank', title : 'Кликни меня', content : 'Псевдоссылка, меняющая цвет по клику' } ] }) Block describing in content property are turned into HTML with their bemhtml templates. |