Skip to content

Instantly share code, notes, and snippets.

@xdghcnt

xdghcnt/t4 Secret

Last active August 29, 2015 14:03
Show Gist options
  • Save xdghcnt/cb688b5d0751cc27eeae to your computer and use it in GitHub Desktop.
Save xdghcnt/cb688b5d0751cc27eeae to your computer and use it in GitHub Desktop.
module.exports = function (bh) {
bh.match('test-block', function (ctx) {
ctx.content([
{elem: 'section1'},
{elem: 'section2'}
]);
});
bh.match('test-block__item', function (ctx) {
ctx.content(ctx.param('par'));
});
bh.match('test-block__section1', function (ctx) {
return [
{elem: 'item', par: 'a1'},
{elem: 'item', par: 'a2'},
{elem: 'item', par: 'a3'}
];
});
bh.match('test-block__section2', function (ctx) {
return ctx.content();
});
bh.match('test-block__section2', function (ctx) {
ctx.content([
{elem: 'item', par: 'b1'},
{elem: 'item', par: 'b2'},
{elem: 'item', par: 'b3'}
].concat(ctx.content()), true);
});
bh.match('test-block__section2', function (ctx) {
ctx.content([
{elem: 'item', par: 'b4'},
{elem: 'item', par: 'b5'},
{elem: 'item', par: 'b6'}
].concat(ctx.content()), true);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment