const template = require('art-template');
//引入系统模块path
const path = require('path');
let route = path.join(__dirname, '05_layout.art');
console.log(template(route, {
msg: 'fj'
}));
被继承文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
//挖坑用block标记
{{block 'content'}}
{{/block}}
</body>
</html>
要继承其他文件的文件
//要继承的文件路径
{{extend './05.art'}}
//内容填充
{{block 'content'}}
<li>{{msg}}</li>
{{/block}}