Skip to content

Commit 43c47e2

Browse files
authored
perf: change data to locals
1 parent 444003d commit 43c47e2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ module.exports = function(options) {
1515
if (!tree.match) tree.match = match;
1616
tree.match({ tag: 'include' }, function(node) {
1717
var src = node.attrs.src || false;
18-
var data = node.attrs.data || false;
18+
var locals = node.attrs.locals || false;
1919
var content;
2020
var subtree;
2121
var source;
2222
if (src) {
2323
src = path.resolve(options.root, src);
2424
source = fs.readFileSync(src, options.encoding);
25-
if (data) {
26-
data = JSON.parse(data);
25+
if (locals) {
26+
locals = JSON.parse(locals);
2727
var result = posthtml()
28-
.use(expressions({ locals: data }))
28+
.use(expressions({ locals: locals }))
2929
.process(source, { sync: true });
3030
source = result.html;
3131
}

0 commit comments

Comments
 (0)