Skip to content

Instantly share code, notes, and snippets.

module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [
module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [
module.exports = {
block: 'page',
title: 'Title of the page',
favicon: '/favicon.ico',
head: [
{ elem: 'meta', attrs: { name: 'description', content: '' }},
{ elem: 'css', url: 'index.min.css' }
],
scripts: [{ elem: 'js', url: 'index.min.js' }],
content: [
module.exports = {
block : 'page',
title : 'Title of the page',
favicon : '/favicon.ico',
head : [
{ elem : 'meta', attrs : { name : 'description', content : '' } },
{ elem : 'meta', attrs : { name : 'viewport', content : 'width=device-width, initial-scale=1' } },
{ elem : 'css', url : 'index.min.css' }
],
scripts: [{ elem : 'js', url : 'index.min.js' }],

Использование

Функция i18n может использоваться:

В шаблонах

Для работы с разными языками используется один шаблон.

@innabelaya
innabelaya / 1.md
Last active August 29, 2015 14:27

Исполнение шаблонов в браузере

Скомпилированный файл подключается на страницу как JavaScript-файл.

<script src="bundle.bemtree.js"></script>
<script src="bundle.bemhtml.js"></script>

В браузере исполнение шаблонов зависит от наличия модульной системы:

Last login: Thu Jul 2 11:18:31 2015 from 130.193.34.9
$ xliff merge bem/bem-method git ru en com bem-info-data
Merging the translated 'ru'-'en' XLIFF for 'bem/bem-method' back to DITA...
Repository: 'git'
Revision: 'bem-info-data'
bash: line 0: cd: /home/robot-xliff-farmer/YGIT/Build/l10n: No such file or directory
$ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ xliff1 merge bem/bem-method git ru en com bem-info-data
Merging the translated 'ru'-'en' XLIFF for 'bem/bem-method' back to DITA...
Repository: 'git'
Revision: 'bem-info-data'
Input files search pattern 'DEFAULT'
Project name: bem-method
Database name: en_bem
MapFolderPath: /home/robot-xliff-farmer/YGIT/bem/bem-method
executing: rm -r '/home/robot-xliff-farmer/YGIT/bem/bem-method'
executing: mkdir -p /home/robot-xliff-farmer/YGIT/bem
var techs = {
// essential
fileProvider: require('enb/techs/file-provider'),
fileMerge: require('enb/techs/file-merge'),
// optimization
borschik: require('enb-borschik/techs/borschik'),
// css
cssStylus: require('enb-stylus/techs/css-stylus'),
{
block : 'page',
title : 'Support IE8',
head : [
{
elem : 'conditional-comment',
condition : '> IE 8',
msieOnly : false,
content : { elem : 'css', url : '_simple.css' } // стили для всех браузеров, в т.ч. IE9+
},