mz-parser-partial

2.0.1 • Public • Published

mz-parser-partial

1、使用方法

fis.match('*.tpl', {
    parser: [
      fis.plugin('partial',{type:'ssi'}),
      function (content, file, settings) {
        return content.replace(/\{\{(?:(\w+)\:)?([\.\w]+)\}\}/g, function(str, func, arg ){
          if(func){
            return fis[func](arg);
          }else{
            return fis.get(arg);
          }
        });
    }]
});

2、实现原理

默认输出

<{ssi file="{{namespace}}/page/_partial/header.tpl"}>

配置为 ssi 后输出

<!--#include virtual="{{urlprefix}}/_partial/header.html"-->

Readme

Keywords

Package Sidebar

Install

npm i mz-parser-partial

Weekly Downloads

1

Version

2.0.1

License

0BSD

Last publish

Collaborators

  • kaiye