Skip to content

Instantly share code, notes, and snippets.

@xdghcnt

xdghcnt/t3 Secret

Created July 15, 2014 11:45
Show Gist options
  • Save xdghcnt/4aeb2d2f4c3c7d63d5b9 to your computer and use it in GitHub Desktop.
Save xdghcnt/4aeb2d2f4c3c7d63d5b9 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__section1', function (ctx) {
return [
{elem: 'item', content: 'a1'},
{elem: 'item', content: 'a2'},
{elem: 'item', content: 'a3'}
];
});
bh.match('test-block__section2', function (ctx) {
return [
{elem: 'item', content: 'b1'},
{elem: 'item', content: 'b2'},
{elem: 'item', content: 'b3'}
];
});
bh.match('test-block__section2', function (ctx) {
return ctx.applyBase().newCtx.concat([
{elem: 'item', content: 'b4'},
{elem: 'item', content: 'b5'},
{elem: 'item', content: 'b6'}
]);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment